Installing Mac OS X on VirtualBox 4.2

With an external bootloader

December 03, 2012

By various reasons, some people need to install Mac OS X on their computer. Some want to play with it, some want to have fun messing around with the installation on their computers (google Hackintosh), and others want to produce software for it without having to pay big bucks for Apple hardware. Personally, I had to test if I can release my application to Mac users. However, I do like very much to use my Xubuntu 12.04 installation for developing, and I am not willing to install Mac OS X "natively" in my computer, so like many people, I have installed Snow Leopard in a VirtualBox 4.2 virtual machine.

What do you need?

  • Mac OS X – I suggest to buy an original retail DVD of Snow Leopard, but for testing, you can google for Snow Leopard retail DVD torrent. There are some modifications out there by the Hazard team, but I have had so much trouble during installations that I suggest the original (or a copy) of the retail DVD’s.

  • iBoot – for booting up Snow Leopard on the Virtual machine, since the retail DVD iso’s are not capable of booting themselves. You can download it from here (tonymacx86 forum – you have to register). If you have a Pentium 4 or another single core processor, I think you have to download “iBoot Legacy 2.7.2″. For Core 2 Duo Intel processors you should download “iBoot 3.3.0″. If you have an Intel i3, i5 or i7 CPU, download “iBoot Ivy Bridge 1.0.0″ or latest.

  • MultiBeast for Snow Leopard – to install the boot loader inside the virtual machine (i.e., inside Mac OS X) and more addons. Get MultiBeast also from tonymacx86 forum here.

  • Mac OS X 10.6.8 update combo v1.1 – if your retail DVD is not the latest version of Snow Leopard (10.6.8), download the combo file directly from Apple. It is a big file, about 1.1GB

  • Legacy 10.6.8 kernel – the same as previous, if you are updating to 10.6.8 you will need a 10.6.8 kernel. You can find it at forum, although you will have to be registered in the forum to download it.

1. Create Virtual machine

Open your VirtualBox installation and click on New. It will ask for a name and Operating System type. Name it as you want and select type “Mac OS X” and version "Mac OS X". You can use "Mac OS X (64 bits)" if you want. My best installation so far is with 64 bits for the virtual machine although I can not set the Mac OS X installation "real" 64 bits. Probably it is the same thing so do as you want. Set a minimum of 1024 MB of RAM to it (or more if you have enough RAM on your computer) and a minimum of 20 GB of Hard Disk.

Then, in the virtual machine Settings, the only mandatory thing is to disable the "Enable EFI" option in the System entry. For my latest installation (I've done many to test different things), I've also set 2 cores, and the video memory to 32MB. I had also the 3D acceleration set, although I changed it after the installation because something was causing the machine not to boot. But you should test it anyway if you have time for it.

2. Installation

The first time you start a new virtual machine, VirtualBox will ask you for a bootable media. Since neither the Snow Leopard ISO or DVD are able to boot, you will have to use iBoot. Mount iBoot in the virtual CD drive of the virtual machine. When iBoot boots up, unmount iBoot and mount the Snow Leopard DVD or ISO. Press F5 to refresh iBoot (Mac OS X Installer DVD will appear below the DVD icon) and press Enter to boot.

In the next screens you will have to select the System language and accept the conditions. Finally you will be asked to choose the Hard Disk where you want to install the OS. As you will soon find, the list is empty. However, in the top bar, you will find "Utils" menu which has a Disk Utility function. Select it, choose you VirtualBox hardisk, give it a name and erase it.

You will be back again in the screen where you chose the MacDisk for installation, and in the next screen, you will review the installation. Depending on the installation disks you are using, I suggest to "Personalize", and remove Printer suport, Additional fonts and Remove all translations (except English and/or your local language if not English).

Hopefully the installation will succeed and you will be asked to Reboot. Chances are that the installer will not be able to reboot, so go to "Machine" and reboot it yourself.

3. First use

After the first reboot, if you don't do nothing, you will notice that the virtual machine will not boot. As I said previously, if you left the installation DVD or ISO mounted, you can't boot, and even if you unmount the installer DVD or ISO, you won't be able to boot. You will have to use iBoot again. But this time, your disk with the installation will appear on the iBoot menu.

Select it using the arrow keys and press Enter to boot your new installation. If you are having troubles or you did use a 32 bit virtual machine, before pressing enter, write "arch=i386 -f -v" (without quotes). This will force (-f) the use of the 32 bits kernel and will make any errors visible, since we are using -v for verbose output.

It will take some time but eventually you will be taken to the register screen and then to the operating system user interface. And you’re done. However, each time you boot you will have to use iBoot, unless you install a boot loader. But if you are not using the 10.6.8 installer, I suggest you upgrade first and then install the boot loader.

4 Upgrade to 10.6.8

If you are not using the latest 10.6.8 Installer DVD, I recommend to install the update first. But before updating, I recommend to switch off all update notifications. To do that, just click on the top-left Apple logo, go to System Preferences, and in Software Update, unselect "Check for Updates".

If you have not already downloaded the 10.6.8 update Combo, you can use the Safari application to download it. But if you have already downloaded it you will have to copy the file to the virtual machine. Since Virtualbox does not handle .dmg files, and so you can't mount the file like if it was a virtual CD, you will have to copy it. I have not found a better way than using an USB pen to copy all files from my Linux host to the Mac OS X guest. While you're at it, copy the Multibeast and Legacy kernel files.

When you have the update combo file on the Mac OS X, just double click it to start the installer. Install the upgrade, it will take quite some time, and in the end, it will ask you to reboot the machine. Don’t do it yet! Install the Legacy Kernel too..

After installing the legacy kernel, you will have to install the boot loader. However, you may have a kernel panic because of switching kernels, if that happens, just reboot the virtual machine using iBoot (and the "arch=i386 -f -v" thing if needed) and you will be back to the user interface in no time.

5. Install the boot loader (and other things)

If you don't install the boot loader, you will have to use iBoot every time you want to use your Mac OS X virtual machine. Now it is time for Multibeast. Run it.

Just install EasyBeast (which contains many things, and maybe the bootloader, I haven't noticed it), the Chimera bootloader (if EasyBeast does not have the boot loader), and in Customization, on Machine, select the entry which most resembles your PC. This seem to have to do with the fact that the Apple store cross checks the specs of your computer's hardware with the information about the Mac hardware version. There are tables in the internet cross referencing each Mac hardware to something like MacPro4,1 which you will find in the Customization section. MacPro4,1 is the name of some 2008 Macs with Core 2 Duo Intel CPUs.

6. Changing screen resolution

Virtualbox does not officially support Mac OS X guests because of Apple's EULA. Because of that, there aren't any guest additions which can be installed, so you will have to do another thing if you want full resolution on your virtual machine. It is quite simple:

On your Mac OS X virtual machine, open the navigation and go to /Extras folder. You will find there a file named "org.Chameleon.Boot.plist". It is an XML file with key-value pairs. Just make sure that the following pairs are there:

<key>Graphics Mode</key>

Instead of "1280x800x32" you can set the values for your own display, but you will have to keep the quotes. Save the file back to /Extras and quit the virtual machine, and exit VirtualBox. (If you find any problem saving the file back to /Extras since it is a system folder, just save the file to the Desktop, and then move the file from the Desktop to /Extras. Mac OS X will ask for your password and will move the file).

The previous change tells the bootloader to set the OS X system to use a fixed resolution, however you have to tell VirtualBox to apply that resolution. One way is to open a terminal and write the following:

vboxmanage setextradata "Name of virtual machine" "CustomVideoMode1" "1280x800x32"

where "Name .." is the name of your virtual machine, "CustomVideoMode1" stays like that and the resolution is the same as you used in Mac OS X. Basically, this sets a property on the virtual machine XML definition file. So, the second way is to go to the location of your virtual machine files (on Linux is ~/VirtualBox VMs) and open the xxx.vbox file with a text editor (being xxx the name of your virtual machine). Look for the ExtraData entry and add

<ExtraDataItem name="CustomVideoMode1" value="1280x800x32"/>

changing the resolution for the intended. Just take care that Virtualbox was off when you did this last part, and when you start your Mac OS X should boot in the intended resolution.

7. 32 Bits problems and arch=i386 on boot

If you installed the Multibeast like I've said so earlier, chances are that the /Extras/org.Chameleon.Boot.plist file has a mention to "arch=i386" in the kernel flags. However, if your virtual machine is not booting without you having to write "arch=i386 -f -v" each time you boot, you will have to add that information to the kernel flags. Just add the value "arch=i386" (without quotes) to the "Kernel Flags" key, and reboot. It now works!

8. Miscellaneous

  • "About my Mac" does not work, gets kernel panics and restarts the user interface.

  • Shutdown and reboot from Mac OS X does not work. You will have to quit the virtual machine or reboot.

  • Sometimes the boot process hangs, I don't know why.

  • Sometimes the boot process requests to press the Power Button to power down, I don't know why also.

  • If you see that your Virtual Machine is always reading the hard disk, it is because there is a indexing process occurring for Spotlight (an application for faster file searching). Go to a terminal and run "sudo mdutil -a -i off" to disable it. It will ask for your administrator password.

Take care!