This step-by-step guide works on VirtualBox 5.x and 6.x for macOS Sierra 10.12, macOS High Sierra 10.13, macOS Catalina 10.15, and others.
Make sure your system is up to date and all dependencies are installed.
sudo apt update && sudo apt upgrade -y sudo apt install virtualbox virtualbox-dkms virtualbox-ext-pack virtualbox-guest-additions-iso virtualbox-guest-utils virtualbox-qt -y
Create a VM in VirtualBox with the following settings:
- Name it MacOS
- 4+ GB of RAM
- 100+ GB of storage
- 3+ CPUs
- Floppy disabled
- EFI enabled
- 128+ MB of video memory
- 3D Acceleration enabled
- Network Adapter set to Bridged (recommended)
- ISO installation disk added to the CD drive
Open a terminal and run the following commands to configure your VM to mimic Apple hardware:
VBoxManage modifyvm "MacOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff VBoxManage modifyvm "MacOS" --cpu-profile "Intel Core i7-6700K" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc" VBoxManage setextradata "MacOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1 VBoxManage setextradata "MacOS" "VBoxInternal2/EfiGraphicsResolution" "1920x1080"
Some of these commands can be customized:
- Skip the second line if your processor is not Intel.
- Change the resolution on the last line as needed: 1920×1200 1920×1080 1600×1200 1680×1050 1440×900 1280×800 1024×768 640×480
- You can also edit MacOS/MacOS.vbox directly to adjust VM settings, for example: Display VRAMSize=”256“
Start the VM and set up the installation partition using Disk Utility.
Find your disk. If it does not appear right away, click View then Show All Devices.
Click Erase and enter a name for the new partition.
Close Disk Utility and proceed with the installation.
BONUS
Open the Terminal and install the Homebrew package manager:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then install some useful CLI tools:
brew install wget brew install htop brew install tnftp