Running OSX through VirtualBox within Windows 7 environment running Bootcamp

I have a great MacBook Pro with awesome retina display, but I mostly run Windows 7 on it through bootcamp. Given that I often have to make iOS related tests, and that switching back and forth between OSX and Windows 7 was quite painful, I decided to try to run OSX as a virtual OS within Windows instead of Windows as a virtual OS within OSX.

If you want to do the same here are the simple things you need to do

1. Open regedit to export a backup of HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AppleHFS and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AppleMNT
2. Keep regedit opened and delete HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AppleHFS and HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\AppleMNT
3. Reboot and make sure the OSX drive is not visible anymore as D: drive
4. Run in command line “C:\Program Files\Oracle\VirtualBox\VBoxManage.exe” internalcommands createrawvmdk -filename c:\RawAppleDisk.vmdk -rawdisk \\.\PhysicalDrive0
5. Open VirtualBox, create a new type “Mac OS X” with version “Mac OS X (64-bit)” virtual machine.
6. When asked to create a drive, select “Use an existing virtual hard drive file” and click the orange folder button, select the RawAppleDisk.vmdk that you created in step #4, it should be at the root of C: but you can move it anywhere you like before adding it to the virtual machine.

Et voila! Now your virtual machine should boot and run OS X as a virtual OS within Windows 7 running native on genuine Apple hardware :)

You can learn more about VirtualBox guest limitations for OSX here. And how to change the guest screen resolution here.

9 thoughts on “Running OSX through VirtualBox within Windows 7 environment running Bootcamp

  1. Pingback: Window 7 Tech | Running OSX through VirtualBox within Windows 7 environment …

  2. This is a really great article and is giving me hope that I can do what I would like, but I’m having some trouble with this. Upon launching my Mountain Lion guest from the Windows 8 host, the guest will hard freeze withing a few minutes. I find that launching Chrome in OSX will freeze it very consistently before anything is drawn onscreen. Any ideas?

    • Initially used Mountain Lion and now Mavericks as guest without issues for hours and days without rebooting. Will try Chrome next week and let you know.

  3. I tried this and it still did not work for me. When I rebooted, the drive no longer showed up in Windows, but when I booted the VM, I still got the waiting for root device message. I was really hopeful here as this was the first post I ran across that looked like it properly addressed the issue I’ve been facing with this. What’s really frustrating is that this all worked effortlessly with Snow Leopard. If you have any further ideas, I’d be truly grateful! I’m on Windows 7 SP1 and VirtualBox 4.3.6. I am also running MacDrive, but I disabled it to no avail. It’s like Windows still has hold of the partition somewhere and won’t let go.

      • Yes it succeeded. I also already have a raw device created the same way, but I restricted the partitions to 1 and 2 which are the GPT and the Mac HFSJ partitions. I didn’t save the output from the Vboxmanage command, but it just said something along the lines of the VMDK being successfully created. When I go to boot the VM, it definitely begins accessing the HD and then gets to a certain point and then I get the message “still waiting for root device.” I’m confident that the raw device is OK, esp. since it is the same raw device that worked before in Snow Leopard. I’m just wondering about drive locking and Mountain Lion. I have successfully installed a Mountain Lion VM using a raw device that references an external USB drive. It gave me the exact same error at first. But figuring this was some sort of an exclusive lock type of problem, I just told VirtualBox the the external USB drive was its exclusively and voila, the VM instantly continued booting, going beyond the “still waiting for root device” error message. Hope this info. helps.

  4. I was unable to figure out how to get the internet hardware to work. Also, it should be noted that you will have to re-verify all your App Store purchases.

Leave a Reply

Your email address will not be published. Required fields are marked *