Run macOS 10.16 Big Sur (and other versions) in VirtualBox on macOS
Simple script to automatically download, install and run macOS 11 Big Sur (and other versions) in VirtualBox on macOS. Since VirtualBox does not support booting from APFS volumes, this script is copying the APFS EFI drivers automatically.
The following software is needed.
Two minute summary video (Catalina):
Execute make all
to setup and run everything. After the installer reboots, press enter in the terminal to finish the installation.
$ make all
Running checks (around 1 second)....
Creating image '/Users/awi/VirtualBox VMs/macOS-VM.dmg' (around 20 seconds, version 14.2.2, will need sudo)....
Creating iso '/Users/awi/VirtualBox VMs/macOS-VM.iso.cdr' (around 25 seconds)....
Creating VM HDD '/Users/awi/VirtualBox VMs/macOS-VM/macOS-VM.vdi' (around 5 seconds)....
Creating VM 'macOS-VM' (around 2 seconds)....
Adding APFS drivers to EFI in '/Users/awi/VirtualBox VMs/macOS-VM/macOS-VM.vdi' (around 5 seconds)....
Starting VM 'macOS-VM' (3 minutes in the VM)....
Press enter to stop VM 'macOS-VM' (e.g. after installer restarted)....
Ejecting installer DVD for VM 'macOS-VM'....
Starting VM 'macOS-VM' (3 minutes in the VM)....
Additionally the following parameters can be customized with environment variables:
variable name | description | default value |
---|---|---|
DST_DIR | root directory, where the VM will be stored | $HOME/VirtualBox VMs/ |
VM_NAME | name of the virtual machine | macOS-VM |
VM_DIR | sub directory, where the VM will be stored | $DST_DIR/$VM_NAME |
VM_SIZE | the size of the hard disk | 131072 |
VM_RES | monitor resolution | 1680x1050 |
VM_RAM | ram size in megabytes | 4096 |
VM_VRAM | video ram size in megabytes | 128 |
VM_CPU | number of cpu cores to allocate | 2 |
Execute make
to get some help:
$ make
Some available commands:
* all : run everything needed (check, installer, vm, patch, run, stop, eject)
* check : check environment
* installer: create macOS installer image
* patch : add APFS drivers to VM EFI to boot
* vm : create VM and disk
* run : run VM
* stop : stop VM
* wait : wait for VM to stop
* eject : eject installer medium
* clean : delete generated images and downloaded files
* stash : delete generated VM and disk
* test : test shell scripts
* style : style shell scripts
* harden : harden shell scripts
* release : make new release
* feedback : create a GitHub issue
installinstallmacos.py
- this produces a dmg
file which you can open. Within this image you can find the app
that should be copied to /Applications
.CMD+C
when you see Trying to find a bootable device...
to interrupt the regular boot process. At the following EFI shell prompt try to find the relevant volume holding boot.efi
in a single randomly-named sub-directory of the root directory. So try to change the current volume by entering fs4:
(or fs5:
, fs6:
, etc.), then enter cd TAB
(where TAB
is used to auto-complete the randomly-named sub-dir), then look for boot.efi
in that dir. If existing, start Recovery by entering boot.efi
.Continue
to start the installation and nothing happens for minutes.MACH Reboot
. What should I do?Error loading kernel cache (0x9)
. What should I do?Mac OS X (64-bit)
to macOS 10.13 High Sierra (64-bit)