AlexanderWillner / runMacOSinVirtualBox

Run macOS 10.16 Big Sur (and other versions) in VirtualBox on macOS
MIT License
937 stars 125 forks source link
apple big-sur catalina high-sierra macos mojave sierra virtualbox vm

Run macOS 11 Big Sur (and other versions) in VirtualBox on macOS

Overview

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.

Codacy Badge download

macosBigSurBeta1

ToC

Required Software

The following software is needed.

Step by Step Video

Two minute summary video (Catalina):

Short Summary Video

Step by Step

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)....

Customizing your build

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

FAQ