Skip to content

Installation ​

This page lists what vz needs, the two ways to install it, and how to check that it works.

Requirements ​

RequirementWhyCheck
A Mac with Apple siliconvz runs arm64 VMs with Apple's Virtualization frameworkuname -m prints arm64
macOS 27 or newervz uses APIs that are new in macOS 27 (vmnet networks, DiskImageKit, Accessory Access)sw_vers -productVersion
Disk spaceA cloud image is a few GB once unpacked; overlays grow as guests writedf -h ~
Xcode 27 or its Command Line ToolsOnly to build from sourceswift --version

Optional:

  • qemu-img (brew install qemu). When it is on your PATH (or in /opt/homebrew/bin or /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 ​

bash
curl -fsSL https://github.com/rayanparsa/vz/releases/latest/download/vz-darwin-arm64.tar.gz | sudo tar -xz -C /usr/local
vz --version

Run 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:

bash
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/local

TIP

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 ​

bash
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/local

make 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:

bash
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 ​

bash
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 pull

vz only starts VMs when its binary is signed with the com.apple.security.virtualization entitlement. All three install methods do this. To check:

bash
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:

ShellScript
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):

CommandCompletes
vz up, vz node stop|restart|reset|console|display|logs ...node names
vz link up|downlink names
vz port up|downnode/interface
vz image pull disk|iso|ipswimage names and aliases
vz init --exampleexample 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:

bash
autoload -Uz compinit && compinit

bash. The script works with the bash 3.2 that macOS ships, but nothing loads it there. Either load it from ~/.bash_profile:

bash
source /usr/local/share/bash-completion/completions/vz

or 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:

bash
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.fish

Editor 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
# yaml-language-server: $schema=https://raw.githubusercontent.com/rayanparsa/vz/refs/heads/main/schema/27.json

That 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:

bash
vz schema > lab.schema.json
yaml
# yaml-language-server: $schema=./lab.schema.json

You 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 withRemove with
Tarballsudo 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 installsudo 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.

See also ​