7

I would like to install a VirtualBox guest of macOS High Sierra on my MacBook Pro that is also running macOS High Sierra so that I can experiment with MDMs, etc. without rendering my primary laptop unusable. I've created an ISO of High Sierra by downloading the installer from the Mac AppStore and running the following commands:

hdiutil create -o /tmp/HighSierra.cdr -size 7316m -layout SPUD -fs HFS+J

hdiutil attach /tmp/HighSierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build

asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase

hdiutil detach /Volumes/OS\ X\ Base\ System

hdiutil convert /tmp/HighSierra.cdr.dmg -format UDTO -o /tmp/HighSierra.iso

mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso

I've also created my VirtualBox guest on VirtualBox 5.2.0 r118431 with 8GB RAM and 2 processors. However, when I attempt to boot from the ISO to start the install process, I'm met with a blank, black screen.

Is there something else I need to do in order to create my virtual macOS instance?

0

2 Answers 2

9

Your final HighSierra.iso is missing the complete InstallESD content (AKA the real High Sierra installer). You just copy a probably defunct and thus non-bootable base macOS system to the image.

I use the following shell script to create a working macOS installer iso file. Basically it's the same method as Apple's recommended way to create a bootable macOS installer thumb drive. The destination is a sparse dmg though.

#!/bin/bash

hdiutil create -o /tmp/HighSierra -size 5600m -layout SPUD -fs HFS+J -type SPARSE
hdiutil attach /tmp/HighSierra.sparseimage -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ High\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
hdiutil detach /Volumes/Install\ macOS\ High\ Sierra/
hdiutil convert /tmp/HighSierra.sparseimage -format UDTO -o /tmp/HighSierra.iso
mv /tmp/HighSierra.iso.cdr ~/Desktop/HighSierra.iso
rm /tmp/HighSierra.sparseimage

The script assumes the default location of the High Sierra installer in /Applications.

If you don't want to create a script, copy & paste & execute the commands in the script line by line in Terminal.


Before booting apply some mods to the VM:

VBoxManage modifyvm "name_of_vm" --cpuidset 00000001 000306a9 00020800 80000201 178bfbff
  • Remove the Floppy in System > Mainboard > Boot devices
  • enable USB3 in Ports > USB
  • set video memory in Display > Screen > Video Memory 128 MB
  • Set RAM and number of CPUs in System > Motherboard: 4GB; Processors: 2 CPUs
5
  • Hmmm... I followed these steps, but I'm left with the same results. A black, blank screen. No UI. No activity.
    – Shadowman
    Dec 4, 2017 at 17:45
  • Thanks! Most instructions online are for installing Mac OS in a VirtualBox running on Windows, so the VBboxManage commands shown are different. Got it running with this ;)
    – kontur
    Jan 13, 2018 at 10:08
  • Thanks for this great answer. Any chance you could expand on what each of these steps are for? e.g. the --cpuidset
    – MmmHmm
    Apr 2, 2018 at 0:33
  • You need to have a (very) recent download of the "Install macOS High Sierra" application, or else the installer will boot to the macOS Utilities menu, but will do nothing when you choose "Install MacOS". Older installers refuse to run. Check the Created date of your Install macOS High Sierra app, and that it is less than a month old. As of writing, the 2018-05-17 installer works, but the 2018-04-04 no longer works.
    – Colin
    Jun 9, 2018 at 1:46
  • I erased the internal (virtual) hard disk as Mac OS Extended (Journaled) and installed macOS High Sierra onto it, however, it never reboots with that hard disk. I just get the EFI screen. Anyone found a way around this?
    – Colin
    Jun 9, 2018 at 3:12
6

You should enter a few of vboxmanage commands before booting.

Different tutorials give alternative set of parameters. It seems there are two sets usually repeated changing only the two first commands. The differences seems to be about emulating different Mac models.

Settings for iMac11,3:

VBoxManage modifyvm "vbox-machine-name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "BOARD-PRODUCT"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "SERIAL"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Settings for MacBookPro11,3:

VBoxManage modifyvm "vbox-machine-name" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "BOARD-PRODUCT"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/efi/0/Config/DmiSystemSerial" "SERIAL"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "vbox-machine-name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
0

Not the answer you're looking for? Browse other questions tagged .