Skip to content


Installing macOS Sierra 10.12 in VirtualBox 6.1 to use audio-related platform-dependent software

A lot of audio creation and manipulation software exists only for Mac, because of an historic reason where musicians always went around with Mac notebooks to play stuff (or maybe I’m making up stuff, I don’t know). Luckily, nowadays most of the good shit is for Windows too (luckily between quotes, I mean, Linux would be the ideal goal), see e.g. FL Studio. But if you ever need a Mac install for some small obscure software, here is my quick howto.

Why Sierra?

Because we’re already going to install a piece of bloated crap (i.e. a modern operating system), not Fedora or something, so we might as well go as minimal as possible, especially since we are emulating the OS. Sierra is fast enough and stable enough. You can always update directly inside Sierra to new versions (maybe on a second virtual machine) if you feel the need to do so.

VBox settings

VBox settings

OS image

Sierra (v10.12.6 build 16G29)

Download from: https://support.apple.com/en-us/HT211683[šŸ”•]

InstallOS.dmg SHA1: 9ba989d30e3548341fc8f5847e856709cb5c67c2

Steps

Extract (if necessary, in multiple steps, using a mix of file-roller and p7zip-full) the file:

InstallOS.dmg/Install macOS/InstallOS.pkg/InstallOS.pkg/InstallESD.dmg/OS X Install EDS/BaseSystem.dmg

Convert it to a VirtualBox virtual disk:

sudo apt install dmg2img
dmg2img BaseSystem.dmg BaseSystem.img
VBoxManage convertfromraw --format VDI BaseSystem.img BaseSystem.vdi

This will give you a very basic installation of macOS, like launching a bare-bone linux recovery distro, let’s say.

Now you need the actual Sierra installation data though, in a separate disk with InstallOS.dmg inside.

You can crete such disk either by

Make it NTFS. To refresh your memory:

Also add an empty *.vdi disk that will be your main hard disk. The SATA configuration should look like:

  1. Optical drive (empty)
  2. macOS.vdi (empty)
  3. BaseSystem.vdi
  4. Installer.vdi (the one with InstallOs.dmg inside)

Now you need to trick the messages that the virtual CPU is sending to the guest OS, in order to make it believe that it’s an Apple CPU:

my_vm_name="macOS"
VBoxManage modifyvm "$my_vm_name" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$my_vm_name" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac19,1"
VBoxManage setextradata "$my_vm_name" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$my_vm_name" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Mac-F22589C8"
VBoxManage setextradata "$my_vm_name" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$my_vm_name" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1

Start the thing and do the installation.

After the language, select Disk Utility, choose the last hard disk, which should be the empty one (Installer.vdi; you’ll see it has no child in the list), give it a name, and format it. This will be your actual installation (the other hard drives won’t be needed after the installation).

Now, on the top menu, choose Utilities → Terminal. It’s bash, so it should be nothing new to you, except for some utilities we’re going to call.

Mount the installer and jump in it:

hdiutil attach /Volumes/Installer/InstallOS.dmg
cd /Volumes/Install\ macOS

Make it an app: Installer -pkg InstallOS.pkg -target /Volumes/macOS

Use the Assistant to finally install macOS: /Volumes/macOS/Applications/Install\ macOS\ Sierra.app/Contents/MacOS/InstallAssistant

Select the macOS disk to install the OS in it. Go ahead, it’s all GUI.

Now…

Guest additions (not really)

The isssue here are Guest Additions, which are useless because the Darwin package (which is actually from VMWare, is generally not compatible, old, or whatever. So you have to download it manually.

The file that you want is the mysterious darwin.iso, which is to be found inside VMware Tools packages or VMware vSphere, or VMware FUsion Tools… etc.

You also need a version of it around 10.3.10; any 11.* and above won’t work on Sierra. So…

Here[šŸ”•] or here[šŸ”•] you can officially download it, but they want you to give them your phone number and we don’t like that kind of bs, do we.

Here[šŸ”•] the directory is publicly listed; there’s just a tiny problem: there’s every version available but what we need.

So, yeah, let’s say that you could grab it from… other (almost-)realiable resources.

Now, mount the ISO and install the damn thing. You should likely have to reboot, then.

Check in the top menu → About this Mac if the video memory is 128 MB. If it’s something like 3 MB, double-check that you are using VMSVGA in the virtual machine’s settings (see the picture above).

At this point, we could be done, but it’s not like a Linux or Windows guest where you can just full-screen or resize the window and it works already. You have to use these darwin tools, by doing (search for ā€œTerminalā€ in the top-right search-thingy):

/Library/Application\ Support/VMware\ Tools/vmware-resolutionSet 2560 1440

Don’t do a 22:9 ratio or stuff like that, because it glitches for some reason; anyway, just experiment, it changes immediately and it’s quite responsive.

Now, if you don’t want to do that every time, you can make it work at each login by creating a ā€œshell-appā€.

Sources