Building a High Sierra Virtual Box VM on Ubuntu
This post is an effort to collect all the information I found when trying to build a macOS High Sierra VM for VirtualBox on Ubuntu and create a “full” guide.
The main problem I found was that all existing articles and tutorials, and there are plenty, require you to download a pre-built VM and then tweak a few settings.
This requires you to trust the source of the VM which I inherently do not and wanted to understand the steps to actually create one myself.
Firstly please note I am using version 5.1.30 of VirtualBox. I haven’t tried with 5.1.32 but when I updated to 5.2.6 it broke the VM and it would not boot at all. Admittedly I didn’t spend that long troubleshooting and just downgraded VirtualBox. Starting from scratch with 5.2.6 or later may have more success. There were some guest escape vulnerabilities discovered for versions prior to 5.1.30, with exploits publicly available, so you may want/ need to try with the most recent version.
You will need an ISO installer image. I’m not going to describe how to do this as there are even more articles on how to than getting the VM working. There is a clean 10.13.0 ISO here for anyone that doesn’t already have a Mac to download the installer app and create one or is just lazy (yes I realise the irony having just previously said I don’t trust downloading a VM):
shasum -a 256 HighSierra_10.13.0.iso 8057f5264257f9203a2ff77fe74692e7f4d66e7ea903af61f3d1f83c0116b2a6 HighSierra_10.13.0.iso
When creating the new VM here are the settings I used:
4GB RAM
2 Processors
Video Memory 128MB
Audio disabled (this was more because I had no intention of using it than having to do this)
USB 2.0 (it would not boot with USB 3.0 selected)
System > Motherboard > Chipset: ICH9
> Enable I/O APIC
> Enable EFI
It is then necessary to run the following commands on the host machine:
VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "High Sierra" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
where High Sierra was the name I had given the VM.
More info on the cpuidset command can be found here and here. The value I have used is for an Ivy Bridge.
After this the VM would still not boot to the installer. I can’t remember if it went straight to the Boot Manager in this screenshot automatically or I had to hit F12 to get to it. Either way you will need to select “EFI Internal Shell”.
From there enter the following as seen in the next screenshot:
Shell> fs1: FS1:> cd "macOS Install Data" FS1:\macOS Install Data> cd "Locked Files" FS1:\macOS Install Data\Locked Files> cd "Boot Files" FS1:\macOS Install Data\Locked Files\Boot Files> boot.efi
The above was found on this Github issue.
This should then take you to the usual installer screen. During the setup DO NOT select APFS when formatting the drive. VirtualBox does not currently support it and your VM will not boot.
Once installed, if you have issues where the VM will not boot try getting back into the “EFI Internal Shell” and running the System boot.efi, as opposed to the Install one previously:
FS1:>/System/Library/CoreServices/boot.efi
When updating the VM I experienced a number of problems. Most frequently it would just boot into the normal OS without having completed the update process. It was therefore necessary to hit F12 at the restart and the same command as during the install:
FS1:\macOS Install Data\Locked Files\Boot Files> boot.efi
I will try and update this so it is more readable and with more information on what various settings mean and where I found all this but wanted to get this down first. Also please be aware I have had problems updating to 10.13.3 so will update this further if I have any luck with that.










