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
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
- making it a virtual device and copying the file in it, and then add such virtual device to your Mac virtual machine
- launching some other virtual machine you have and formatting this new VDI hard disk to it, so you can then copy the file to it.
Make it NTFS. To refresh your memory:
fdisk /dev/sdx- For the partition type GUID, choose Microsoft basic data partition
mkfs.NTFS /dev/sdx1mount -t ntfs /dev/sdx1 /mnt/...- Remember to
umount
Also add an empty *.vdi disk that will be your main hard disk. The SATA configuration should look like:
- Optical drive (empty)
- macOS.vdi (empty)
- BaseSystem.vdi
- 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ā.
- Start the Automator (use the top-right search-thingy and type);
- Select āApplicationā;
- Click āShow libraryā in the toolbar;
- Add āRun shell scriptā (from the Actions/Utilities);
- Copy-and-paste your script into the window;
- Save it somewhere: a file called yourame.app will be created);
- Test it by double-clicking it;
- Go to System Preferences ā Users and Groups ā Login items (top right);
- Add this newly-created app.
Sources
- Tons of different articles on the internet way too spread out.
- Me trying basically every possible goddamn combination of CPU and graphics settings in VirtualBox.