Skip to content

32 macOS ​

A macOS VM on the apple platform, installed from Apple's restore image, with an account and SSH set up on its first boot.

WARNING

macOS guests are experimental. Everything up to the install is tested, but a full install has not been run end to end yet. Please report what happens.

What you practice ​

  • platform: apple: Apple's Mac machine instead of the generic UEFI one
  • A restore image (.ipsw) under disks as installer media, and the disk macOS installs onto
  • The same init: cloud-config as Linux, used here to create the account without Setup Assistant

Topology ​

NodeDisksCPUs / memoryAddressesRole
macmacos-arm64.ipsw installer, empty 80GiB disk4 / 8GiBmgmt 10.132.0.11macOS, login lab / lab

Before you start ​

Check the free space first: the restore image is about 26 GB, and the installed system takes about 20 GB more on macos.asif. vz image pull refuses to start without room for the download.

bash
df -h ~
vz image pull ipsw macos    # the newest macOS this Mac can run

Run it ​

bash
cd examples/32-macos
vz validate                 # one warning: macOS guests are experimental
vz up                       # returns once the install has started
vz node ls                  # "installing N%", 20 to 30 minutes, then "running"
vz node display mac         # watch it, or log in on the screen
ssh lab@10.132.0.11             # password: lab

Try it ​

bash
ssh lab@10.132.0.11 'sw_vers'           # the macOS version
vz node display mac                 # the desktop, at 1920x1080
vz node pause mac                   # freeze it; SSH hangs
vz node resume mac
vz down                             # shuts macOS down
vz up                               # boots the installed system: no second install

Notes ​

  • There is no serial console: vz node console mac says to use the display or SSH.
  • The account is created only on the first boot after the install. After changing init/mac/user-data, reinstall: vz down, vz node reset mac --yes, vz up.
  • Only users and ssh_pwauth in the user-data mean something to macOS. vz validate warns about any other key.
  • One Mac runs at most two macOS VMs at a time; vz validate checks this per lab.
  • Once macOS is installed, the node also starts without the .ipsw line in disks.
  • macos.asif is ignored by git, so the installed system is never committed.

Clean up ​

bash
vz down
vz destroy --yes    # deletes the Mac machine's state; macos.asif stays in this folder
rm macos.asif           # the installed system