UPDATE: For installing Yosemite on VirtualBox, you can check that link.
The market of computer applications is moving day by day from desktop to web and now is moving to smart phone and tablet. Although Android is the most popular operating system on mobile devices but last month two big customers of my company (I work there, not the boss 🙂 ) decided to use iOS for their mobile devices. That means the softwares should be ported, maintained, developed further and supported on iOS. On the market iOS is also the leader on tablet area with its Ipad series. With all of these reasons, I , a .Net/Java programmer, decide to learn programming with Objective C on iOS as my secondary skill.
Like any other programming language, I’ll need a IDE (Integrated Development Environment) but it’s too expensive for me to buy a Macbook running Mac OS. So I just manage to install a MAC OS on VirtualBox and learn Objective C from that fake MAC OS. In this post, I would like to describe step by step how I get a MAC OS 10.7.3 running on VirtualBox. It’s really simple, it just depends on which you download from Internet :).
1. Go to homepage of VirtualBox and download its latest version appropriate with your host OS https://www.virtualbox.org/wiki/Downloads . Install it.
2. On the homepage of VirtualBox, download “VirtualBox x.x.x Oracle VM VirtualBox Extension Pack”.
3. Open VirtualBox, menu File –> Preferences
4. On VirtualBox – Settings dialog –> Extensions –> Add Package
5. Enable Hardware Virtualization Technology (VT) in your BIOS. You must be sure that your processor supports VT and 64 bits. Without these prerequisites, the virtual machine won’ work.
6. The pre-configured Mac OS X installation image. This image is the most important part during the installation. Any ordinary installation DMG file or disc you download from Apple or any torrent sites won’t work. This pre-created image is configured to be booted in VirtualBox. The credit of image, which I use in this post, belongs to souldevteam. To download this image, you can choose either torrent or direct link from links below.
Mirror 1: http://www.mediafire.com/?iftvpgrokvj8ow4
Mirror 2: https://www.box.com/s/b99a70cb61a31f9632f2
7. It’s about 3,5 GB. When the download is finished, extract .exe file to any folder on your computer, you’ll have 4 files “HackBoot Mod.iso”, “Mac OS X Lion.vbox”, “Mac OS X Lion.vbox-prev” and “Mac OS X Lion.vdi”.
8. In Virtual Box, menu Machine –> Add. Browse to “Mac OS X Lion.vbox”
9. A new virtual machine (Mac OS X Lion) will be added into VirtualBox Manager. Start it.
10. At boot screen choose Macintosh and press Enter
11. Open Terminal check its version with sw_vers command because there is still an error with this pre-configured image. When you click on Apple icon –> About This Mac, the virtual machine will be crashed.
12. Basically the installation process is done. But one of the most annoyed thing when using Mac OS X in virtual machine is keyboard layout. We can’t use Command+C, Command+V to copy and paste data with clipboard. You know, there is no Command key and some of other special keys of Mac in Windows keyboard. I thought of buying a universal keyboard working on both platform Windows and Mac. There’s some kinds of them on market but my current keyboard still works perfectly. Therefore a soft solution will be better for me. To fix this problem, I go to homepage of DoubleCommand, download it http://doublecommand.sourceforge.net/ and install it. After installation, you’ll find DoubleCommand in System Preferences
13. Click on DoubleCommand icon to open DoubleCommand windows, configure it as you like and remember to save all your changes by clicking on Save System or Save User. My sample settings are like image below.
14. Now we have a Mac OS in hand. Let’s go to Apple developer homepage http://developer.apple.com/programs/register/, download Xcode and iOS SDK. The first application “Hello World” is waiting for you. 🙂