A lightweight virtual machine tool, for personal use.
only support Apple Silicon and macOS
- create and run both Linux and MacOS VM
- run in GUI or detached mode
Usage: vz <COMMAND>
Commands:
ls list vm status
create create vm
run run vm
stop stop vm
ipsw get macOS restore image ipsw url
edit edit vm (cpu, ram, increase disk image size)
install install macOS
completion generate shell completion
help Print this message or the help of the given subcommand(s)
Options:
-h, --help Print help
-V, --version Print version
create vm
Usage: vz create [OPTIONS] <NAME>
Arguments:
<NAME> vm name
Options:
--os <OS> create a linux or macOS vm [default: linux] [possible values: linux, macOS]
--cpu <CPU> cpu count [default: 1]
--ram <RAM> ram size in gb [default: 1]
--disk <DISK> disk size in gb [default: 50]
--ipsw <IPSW> macOS restore image file, e.g. --ipsw=UniversalMac_14.5_23F79_Restore.ipsw
-h, --help Print help
./build/build.sh# fish
vz completion | tee ~/.config/fish/completions/vz.fish
# zsh
vz completion | sudo tee /usr/local/share/zsh/site-functions/_vz# here use debian as example, install binfmt-support
apt install binfmt-support
# mount rosetta directory on startup
sed -i -E '$arosetta /run/rosetta virtiofs rw 0 2' /etc/fstab
# install rosetta via systemd-binfmt.service
echo ':rosetta:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x3e\x00:\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/run/rosetta/rosetta:FOC' | tee /etc/binfmt.d/rosetta.conf
# to enable AOT cache daemon, or make it as systemd service
/run/rosetta/rosettad daemon &- all data is stored at
~/.local/share/vz - use
vz lsto find ip, or checkcat /var/db/dhcpd_leases - for local docker host, refer to setup-docker-host.md
- refer to swift version if interested, https://github.com/neowu/vz-swift
- after macos updating, dhcp could broken due to firewall, either restart again, or manually unblock
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd