A couple of months ago, I got Mac OSX working as a Virtual Machine running under VirtualBox on my Windows 7 host. A few weeks later, after a VirtualBox update, the VM stopped working for some reason.
I just got around to re-creating the VM, and since I’ve been having to piece this together from half a dozen sources, I thought I’d write my own tutorial. I’ve already done this once tonight (well, when this post is published it will be last night), so I know it works; I’m just going to do exactly what I did three hours ago, taking screenshots along the way. Since it’s kind of long, I’ll split it into two parts. Part two will go up Friday.
Before I begin, I should point out that running Mac OSX on non-Apple-branded hardware (including as a VirtualBox guest) is a violation of the OSX End User License Agreement. Personally I don’t really care what EULAs say, as I don’t consider them legally binding, however I do have a broken Mac in the corner of my office that I don’t want to pay to repair. I have also purchased a retail OSX Snow Leopard DVD, so whatever Apple’s lawyers might say, this a legal install.
Installing VirtualBox and configuring your computer to run it is beyond the scope of this tutorial; I am going to assume you already have a basic understanding of how to create a VirtualBox VM. I will be using the latest version of VirtualBox (3.2.10).
You’re going to need a couple of things first. Obviously the Snow Leopard retail DVD is a must (an ISO should work, too, but I used the retail DVD). If you don’t have one, you can buy one from the online (or brick-and-mortar) Apple Store, from Amazon, or you can find one at your local Apple reseller. It’s only $29 🙂
You’ll also need an EmpireEFI disc image appropriate for your host machine: if your host is an Intel machine you want this one, otherwise if you have an AMD host you want this one. I’m using EmpireEFI 1.085 on an Intel host. (I haven’t actually tested the AMD version of EmpireEFI, so please let me know in the comments if it doesn’t work.)
Alright. First, create a new VM. I’m going to name it “MacOSX” for simplicity. VirtualBox will automatically select “Mac OS X Server” as the operating system and version. If your host is running a 64-bit OS, you may want to choose the “Mac OS X Server (64-bit)” option, as I have done here:
We’re not going to be running OSX Server, but that’s the only option provided by VirtualBox, so we’ll stick with it.
Next, choose how much RAM you would like your VM to have. For this tutorial I used the default 1GB setting:
Next we create a new hard disk:
Hit Next twice, then choose whether your disk will be a dynamically expanding disk or a fixed-size disk. I chose “Dynamically expanding”:
Now we’ll choose how large the VM’s hard drive will be, and where to store it. I’m storing the disk image on a separate drive I use specifically for VM disk images; if you’re not sure, use the default location. The default size is 20 GB, which is fine, so go ahead and use that default setting as well:
Next is a drive creation summary screen, so make sure everything looks ok, and press Finish. Depending on the size of the virtual drive you created, and whether or not it’s dynamically expanding, you may get a progress dialog.
Next we get a VM summary:
Press Finish, and your VM is created. Don’t get too excited — we need to change some settings before we can install OSX. Select the new VM, and click “Settings” on the toolbar.
In the Settings dialog, click “System” on the left, and uncheck “Floppy” and “Enable EFI” on the Motherboard page:
I have outlined “Enable EFI” in red because OSX will not boot if you leave it checked! VirtualBox’s EFI only works on OSX hosts. We’re going to be using EmpireEFI instead.
If you have a quad-core machine, you may also want to change the processor count on the Processor tab; I set mine to 2, but it should work fine with just 1 CPU (the default).
Now, select “Display” on the left. On the “Video” tab, set Video Memory to 128 MB and make sure the “Enable 3D Acceleration” box is checked:
The next step is a little more complicated. Click “Storage” on the left. The Storage Tree by default has a single IDE controller with both your virtual hard disk and the optical drive. Let’s change it. Click “MacOSX.vdi” so it is highlighted, then click the disk icon with a red minus sign (Remove Attachment). “MacOSX.vdi” should disappear from the list.
Next, click the tilted rectangle with a green + on it (to the right of the “Remove Attachment” button). In the popup menu, choose “Add SATA Controller”. Click the disk icon with a green + on it (to the left of the “Remove Attachment” button). It will add a hard disk onto the SATA controller; it may not be the right one. If not, click on it, and find “MacOSX.vdi” in the “Hard Disk” dropdown on the right half of the pane.
Here’s the tricky part. Click on the “Empty” optical drive, change “CD/DVD Device” to your host drive, and check the “Passthrough” box:
The install disc won’t boot if you don’t enable passthrough!
Lastly, still on the optical drive, change it to mount the EmpireEFI iso you downloaded earlier. The “Passthrough” checkbox will uncheck and disable itself – that’s ok. VirtualBox will remember that you enabled passthrough for the host drive. (If you missed where I mentioned EmpireEFI, scroll up to just before the first screenshot.)
When you’re done, it should look like this:
The rest of the default settings are fine. There you go; your VM is properly configured to install OSX. Come back tomorrow for the good part 🙂
Update: Part 2 is up.