MacOS – How to install OS X Mavericks in VirtualBox

bootmacosvirtualboxvirtualization

I have been trying to use Hackboot to install OSX Mavericks in VirtualBox, and using an ISO image created by following the steps at How to create bootable ISO for OS X Mavericks

The steps I have taken:

  1. Attach HackBoot1.iso, disable EFI for the VirtualBox guest and boot up
  2. Hackboot starts up. Attach the OS X Mavericks bootable ISO image
  3. Hackboot complains

Can't find /mach_kernel

Booting up directly from the ISO with EFI enabled also fails.

How can I install OS X Mavericks using either Hackboot, or to boot up directly from the ISO image?

Best Answer

If your host system is OS X, you can follow the instructions on: http://ntk.me/2012/09/07/os-x-on-os-x/

Requirement:
- Install OS X.app purchased in Mac App Store
- iesd

VirtualBox Settings:
- Operating System Version: Mac OS X (64 bit)
- Base Memory: 2048 MB (larger is better)
- Enable EFI

In the lastest VirtualBox, all the default settings work well. Some people encountered black screen upon booting the virtual machine. They reported that changing the default chipset ICH9 to PIIX3 fixes this issue.

  1. Prepare Install Disk

    gem install iesd
    

    iESD requires ruby-1.9.2 or later.

  2. Yosemite & Mavericks: The the new InstallESD.dmg is not bootable. Therefore, we need to create a bootable install disk with BaseSystem.dmg.

    iesd -i /Applications/Install\ OS\ X\ Mavericks.app -o Mavericks.dmg -t BaseSystem
    
  3. All Macs using Intel Haswell CPU (Macs after 2013) need to fake their CPU as Ivy Bridge in order to boot the virtual machine. Thank @danmccombs for this tip.

    VBoxManage modifyvm <vmname> --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
    

    On Mac Pro Early 2009 and other Macs that have ECC memory, AppleTyMCEDriver.kext will cause a kernel panic during the boot. Thus we need to remove it.

    iesd -i /Applications/Install\ OS\ X\ Mavericks.app -o Mavericks.dmg -t BaseSystem --uninstall-extension AppleTyMCEDriver.kext
    
  4. Mountain Lion & Lion: The lastest VirtualBox does not require modifying InstallESD.dmg any more. However, if your virtual machine was freezed during the boot process due to AppleIntelCPUPowerManagement.kext, you need to install NullCPUPowerManagement.kext.

    iesd -i /Applications/Install\ OS\ X\ Mountain\ Lion.app -o Mountain\ Lion.dmg --install-extension NullCPUPowerManagement.kext
    
  5. The install process is same as normal OS X install on Mac