Installation
This page lists what vz needs, the two ways to install it, and how to check that it works.
Requirements
| Requirement | Why | Check |
|---|---|---|
| A Mac with Apple silicon | vz runs arm64 VMs with Apple's Virtualization framework | uname -m prints arm64 |
| macOS 27 or newer | vz uses APIs that are new in macOS 27 (vmnet networks, DiskImageKit, Accessory Access) | sw_vers -productVersion |
| Disk space | A cloud image is a few GB once unpacked; overlays grow as guests write | df -h ~ |
| Xcode 27 or its Command Line Tools | Only to build from source | swift --version |
Optional:
qemu-img(brew install qemu). When it is on yourPATH(or in/opt/homebrew/binor/usr/local/bin), vz uses it to convert qcow2 images (Ubuntu, Fedora, AlmaLinux, Rocky). Without it vz uses its own built-in converter, so this is not required.- An M3 or newer chip, only if you want nested virtualization (KVM inside a VM).
NOTE
Intel Macs are not supported, and guests must be arm64 operating systems.
Install
Release tarball
curl -fsSL https://github.com/rayanparsa/vz/releases/latest/download/vz-darwin-arm64.tar.gz | sudo tar -xz -C /usr/local
vz --versionRun it again to upgrade. To install without sudo, use a prefix you own whose bin is on your PATH, such as ~/.local. Keep bin and share in the same prefix: vz finds its schema and examples in ../share/vz.
To check the download against the release's checksums first:
cd "$(mktemp -d)"
curl -fLO https://github.com/rayanparsa/vz/releases/latest/download/vz-darwin-arm64.tar.gz
curl -fLO https://github.com/rayanparsa/vz/releases/latest/download/checksums.txt
shasum -a 256 -c checksums.txt && sudo tar -xzf vz-darwin-arm64.tar.gz -C /usr/localTIP
A binary downloaded with a web browser is quarantined by macOS. Remove the flag with sudo xattr -d com.apple.quarantine /usr/local/bin/vz.
From source
git clone https://github.com/rayanparsa/vz.git
cd vz
make release # build and sign .build/release/vz, as yourself
sudo make install # copy it to /usr/localmake install copies the binary to $(PREFIX)/bin, the schema and examples to $(PREFIX)/share/vz, and the completion scripts to $(PREFIX)/share/zsh and $(PREFIX)/share/bash-completion. PREFIX defaults to /usr/local; use another one without sudo:
make install PREFIX="$HOME/.local"WARNING
Never run make release or make build with sudo. It leaves root-owned files in .build and every later build fails with "Operation not permitted". If that already happened: sudo chown -R "$(id -un)" .build.
To work on vz itself, see Building and testing.
Check your setup
vz --version # for example 1.0.0 (commit b7a1fb7, release #3); dev for a source build
vz schema | head -3 # finds the bundled JSON Schema
vz image ls # lists the images vz can pullvz only starts VMs when its binary is signed with the com.apple.security.virtualization entitlement. All three install methods do this. To check:
codesign --display --entitlements - "$(command -v vz)"The output must contain com.apple.security.virtualization. If it does not, vz up stops with a message that tells you so.
Shell completion
The tarball and make install put completion scripts where the shells look for them:
| Shell | Script |
|---|---|
| zsh | /usr/local/share/zsh/site-functions/_vz |
| bash | /usr/local/share/bash-completion/completions/vz |
Press TAB to complete commands and flags, and names from the lab file in the current folder (or the one -f names):
| Command | Completes |
|---|---|
vz up, vz node stop|restart|reset|console|display|logs ... | node names |
vz link up|down | link names |
vz port up|down | node/interface |
vz image pull disk|iso|ipsw | image names and aliases |
vz init --example | example numbers and names |
Completion only reads files: it never asks the running lab or the network, and a broken lab file completes nothing.
zsh. /usr/local/share/zsh/site-functions is on zsh's default fpath, so completion works once ~/.zshrc runs compinit (Oh My Zsh and most setups do). If nothing completes, add:
autoload -Uz compinit && compinitbash. The script works with the bash 3.2 that macOS ships, but nothing loads it there. Either load it from ~/.bash_profile:
source /usr/local/share/bash-completion/completions/vzor use a newer bash with bash-completion 2 (brew install bash bash-completion@2), which loads it from /usr/local/share by itself.
Other prefixes and fish. vz completion zsh|bash|fish prints the script. Save it where your shell looks:
vz completion zsh > ~/.zfunc/_vz # then in ~/.zshrc, before compinit: fpath=(~/.zfunc $fpath)
vz completion bash > ~/.local/share/bash-completion/completions/vz
vz completion fish > ~/.config/fish/completions/vz.fishEditor support for lab files
Lab files can start with a modeline for editors that use the YAML language server (for example VS Code with the Red Hat YAML extension):
# yaml-language-server: $schema=https://raw.githubusercontent.com/rayanparsa/vz/refs/heads/main/schema/27.jsonThat URL is the schema's $id. To work offline, or to be sure the schema matches your vz version, save a local copy and point the modeline at it:
vz schema > lab.schema.json# yaml-language-server: $schema=./lab.schema.jsonYou get completion, hover help and errors for unknown keys while you type. vz validate checks much more than the schema can, so still run it.
Where vz keeps its files
Everything vz writes for you lives under ~/.vz (or $VZ_HOME): pulled images, download cache, the state of each lab and the list of running labs. See Files and environment.
Uninstall
| Installed with | Remove with |
|---|---|
| Tarball | sudo rm -rf /usr/local/bin/vz /usr/local/share/vz /usr/local/share/zsh/site-functions/_vz /usr/local/share/bash-completion/completions/vz |
make install | sudo make uninstall (with the same PREFIX) |
Stop your labs first (vz ls lists them). To also delete images, caches and all lab state:
CAUTION
rm -rf ~/.vz deletes every pulled image and every node's disk overlay. Anything you changed inside your VMs is gone.