How to install Mac OS X Snow Leopard in VirtualBox (Windows or Linux host)

Published on 14th June 2010
Updated on 6th October 2010

What you will need

Installation

  1. Rip your original retail DVD of Snow Leopard in ISO format. In Windows I recommend ImgBurn. If you ripped it with a Mac and you got a DMG file, you can convert it following these steps, or using Windows and dmg2img (dmg2img source_file.dmg destination_file.iso).

  2. In VirtualBox, create a new virtual machine. Name it as you want, but select "Mac OS X" as the operating system, and "Mac OS X Server" as the version. Click next. Assign a good amount of RAM to the VM. I chose 1024 MB. Click next. Create a new virtual hard disk, I chose 20 GB of dynamically expanding storage. Click finish.

  3. Open the settings for this new virtual machine, and in the Storage section, load the Snow Leopard ISO in the now empty CD/DVD device.

  4. This is optional, but I like the VM having its own IP on the network. In the Network section choose the Adapter 1 tab, select Attached to: Bridged adapter, and then select your real network card, in case that you have more than one.

  5. I also enabled 3D acceleration and put 128 MB of video memory, but I am not sure if this will do something useful, I don't know the state of the 3D emulation for Mac OS X guests.

  6. Now close VirtualBox (important!). Find the XML file that defines the virtual machine that you just created. In Windows XP it's normally in C:\Documents and Settings\<username>\.VirtualBox\Machines\<name of the VM>\<name of the VM>.xml. In Windows Vista/7 I guess it will be in the same place but in C:\Users\ instead of C:\Documents and Settings\. In Linux it should be in /home/<username>/.VirtualBox/Machines/<name of the VM>/<name of the VM>.xml (thanks Mark!).

    Anyway, you have to search some lines that have ExtraDataItem in them. Just after the last one, add these two:

    <ExtraDataItem name="VBoxInternal2/EfiBootArgs" value=" "/>
    <ExtraDataItem name="VBoxInternal2/SmcDeviceKey"
        value="ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"/> 
    

    Save and close the file.

  7. Open VirtualBox and power on the virtual machine. The installation will start after some minutes. Choose your language. Now open Disk Utility under Utilities menu. Select the virtual disk and click Erase. Close it and you can now install OSX. Before that, you can choose to customize the installation. It can be interesting to disable extra language translations or printer support (you save about 2 GB).

Mac OS X Snow Leopard running in VirtualBox 3.2

There is no sound!

In the default retail installation in VirtualBox there is no sound. You have to install this driver. Just download the PKG file, run it and reboot. Sound should be working, although a bit flaky sometimes.

Resolution is fixed to 1024x768

Just like before, power down your VM and close VirtualBox. Then edit the XML file associated to your VM and add this line just after the other two:

<ExtraDataItem name="VBoxInternal2/EfiGopMode" value="N"/>

Where N is a digit from 0 to 4, referring to 640x480, 800x600, 1024x768, 1280x1024, 1440x900 resolutions respectively. No other video modes are allowed at the moment with the VirtualBox EFI (maybe others are available in other loaders?).

CPU usage is always 100% even when idle

This is a common problem. It seems related with the fact that the virtual CPU that VirtualBox emulates does not support power management, and OSX floods the kernel logs with debug and error info. Just delete the file /System/Library/Extensions/AppleIntelCPUPowerManagement.kext, and rebuild the kext cache with sudo kextcache -system-caches. Reboot and the CPU usage should be normal now.

Useful sources