Skip to content

Instantly share code, notes, and snippets.

@shurick81
Last active December 14, 2025 23:08
Show Gist options
  • Select an option

  • Save shurick81/b271d893509b641fc7841dae78adcbae to your computer and use it in GitHub Desktop.

Select an option

Save shurick81/b271d893509b641fc7841dae78adcbae to your computer and use it in GitHub Desktop.
MacOS VM

mac-vms

Programmatically create macOS ARM64 virtual machines that have desktop/GUI interface on Apple Silicon using macosvm.

Setup

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
cd /opt/homebrew/bin/
ls
PATH=$PATH:/opt/homebrew/bin
cd
touch .zshrc
echo export PATH=$PATH:/opt/homebrew/bin -> .zshrc

brew install git
brew install aria2

git clone https://github.com/s-u/macosvm.git /tmp/macosvm
cd /tmp/macosvm
make

# Copy the binary to your workspace
cd /Users/aleksandr/code/mac-vms
cp /tmp/macosvm/macosvm/macosvm .

Download macOS

aria2c -x 16 -s 16 \
  -o UniversalMac_26.2_25C56_Restore.ipsw \
  "https://updates.cdn-apple.com/2025FallFCS/fullrestores/093-37399/E144C918-CF99-4BBC-B1D0-3E739B9A3F2D/UniversalMac_26.2_25C56_Restore.ipsw"

More versions: https://mrmacintosh.com/apple-silicon-m1-full-macos-restore-ipsw-firmware-files-database/

Create VM

./macosvm --disk macos-tahoe-disk.img,size=64g \
  --aux macos-tahoe-aux.img \
  -c 4 -r 8g \
  --restore UniversalMac_26.2_25C56_Restore.ipsw \
  macos-tahoe-vm.json

Run VM

# With GUI (for initial setup)
./macosvm -g macos-tahoe-vm.json

# Headless
./macosvm macos-tahoe-vm.json

# Ephemeral (no changes saved)
./macosvm --ephemeral -g macos-tahoe-vm.json

After First Boot

  1. Complete Apple Setup Assistant
  2. Enable Remote Login and Screen Sharing in System Settings → Sharing
  3. Clone your VM: cp -c macos-tahoe-disk.img macos-tahoe-master.img

Notes

  • Guest macOS version must be ≤ host version
  • VMs use NAT networking by default
  • Run ./macosvm -h for all options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment