How can I install macOS Mojave, macOS High Sierra, and macOS Yosemite as VirtualBox VM Guests on Mac hardware?


2 Answers 2


Here's the configuration I installed:

Late 2015 Retina iMac (probably any new enough Mac will work)
----- VirtualBox 5.2.19 (no foreseeable reason future revs of VirtualBox won't work)
--------- macOS High Sierra 10.13.6 (probably works with several macOS release versions)

  1. First download High Sierra installer from app store. (App store app puts it into /Applications and launches it. The autorun installer can be quit so that it can be converted to an ISO)

  2. You can convert the installer DMG to an ISO, using the script at the end of this answer. Some other approaches work too. You may need or want to tweak the file names or the name of the OS/Installer app depending on what OS you're trying to install, etc...

  3. After creating the ISO, create a Virtual Machine with the following configuration settings:

OS Type: macOS 10.13 High Sierra (64-bit)
Base Memory: 4096 GB RAM
Disk Size: 32 GB disk size
Video RAM: 128 MB
2 CPUs
disable floppy
disable serial port
disable audio

From command line create the following VirtualBox extra data values for the VM.

NOTE: These seemed to be critical for me to get the installer to boot and run.

These extra data settings I found to be omitted from most or all of the Mac installation instructions that I found online. I borrowed these values from Windows VirtualBox install instructions, and modified the system product to match my iMac's (iMac17,1). Without these extra data settings, the installer failed mid-boot, infinitely looping with some error pertaining to trying to reboot MACH).

    VBoxManage setextradata  {vm name or ID} "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac17,1"
    VBoxManage setextradata  {vm name or ID} "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
    VBoxManage setextradata  {vm name or ID} "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
    VBoxManage setextradata  {vm name or ID} "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
    VBoxManage setextradata  {vm name or ID} "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
  1. Point the VM to the ISO you created in step 2, and boot it.

When the recovery partition's GUI comes up (wherein you have the option to reinstall (also used for initial install)), first choose Disk Utility, and find and format (e.g. Erase), the virtual disk you created during the initial creation of the VirtualBox Guest VM. In Disk Utility, the hard disk will show up as a disk on the left. Erase/format it as Mac OS Extended Journaled.

If you don't first explicitly format the virtual disk, the macOS installer will not find any disks to install macOS on. If you haven't formatted the disk, the installer will not err out but will just sit there expecting you to choose a disk, with none listed, and no option to continue with the installation.

After the first reboot during installation, I got stuck at the UEFI shell prompt, which is obtuse and confusing for the uninitiated (i.e. I didn't know what to do about it).

The reason I got dumped in the UEFI boot shell is that macOS wasn't installed yet in the boot partition, and the boot loader doesn't automatically boot into the recovery partition if the first partition isn't valid.

To manually boot/execute code in recovery partition in order to complete the installation, do the following (credit to VirtualBox forums for this information):

  1. At UEFI shell prompt: Type exit
  2. You'll be brought into an EFI text-mode GUI.
  3. Select Boot Maintenance Manager and click.
  4. Select Boot From File and click

You should see a list populated with two cryptic looking entries (PCI bus paths)

The first is the PCI path to a boot partition that is not valid because you haven't installed macOS on it yet. After installing macOS the boot should find that partition and boot normally, without dumping you out at the UEFI shell.

The 2nd partition is the recovery partition, the one you need to boot from to do the macOS installation.

  • Click the 2nd entry, you should see (and then click): macOS Install Data
  • Then click: Locked Files
  • And finally click: boot.efi

At that point the installer boot will continue and you should get to the point where macOS can be installed.

Bash script to convert macOS installer app downloaded from app store to ISO

installer="/Applications/Install macOS High Sierra.app"    
hdiutil create -o /tmp/HighSierra.cdr -size 5500m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo "$installer"/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv /tmp/HighSierra.cdr.dmg ~/Downloads/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra
hdiutil convert ~/Downloads/InstallSystem.dmg -format UDTO -o ~/Downloads/HighSierra.iso

Following link explains how to create an installer media and install macOS in VirtualBox on a macOS host. The guide works for macOS Catalina as well.


You can use this setup script to create the installer media ISO that can directly be mounted on a Virtualbox VM.

  • 2
    Please quote the essential parts of the answer from the reference link(s), as the answer can become invalid if the linked page(s) change.
    – DavidPostill
    Apr 11, 2020 at 16:27
  • 1
    In addition this appears to be your blog. You must disclose that information if it is correct.
    – DavidPostill
    Apr 11, 2020 at 16:30
  • Also the script used gives errors Install media now available at "/Volumes/Install macOS Catalina" hdiutil: detach failed - No such file or directory hdiutil: convert failed - Resource temporarily unavailable mv: rename macOSinstaller01052020.cdr to macOSinstaller01052020.iso: No such file or directory
    – Jonny
    May 1, 2020 at 6:27
  • By the way, I fixed those last few steps by ejecting the disk manually from Finder, then running something like this: hdiutil convert /tmp/macOSinstaller01052020.sparsebundle -format UDTO -o ./macOSinstaller.cdr
    – Jonny
    May 1, 2020 at 6:37
  • The instructions and script supplied in the link in this answer was the only thing I could get working on Catalina. No messing around with UEFI required. I was able to install Mojave in VirtualBox to allow me to run 32bit apps.
    – camslice
    Jul 12, 2021 at 4:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.