Contributing to vz
Thank you for helping. vz is a small project, and every bug report, tested image, example lab and doc fix makes it better for the next person.
This page covers how to report problems, how to send changes, and what a pull request needs. The detailed developer pages are linked from Development setup.
Ways to help
| You can | How |
|---|---|
| Report a bug | Open an issue with the details listed below |
| Test an OS image | Pull an image from vz image ls, boot it on your Mac, and report what does not work |
| Add an example lab | Follow Writing examples |
| Improve the docs | Fix anything that is wrong, unclear or missing. Small pull requests are welcome |
| Add an OS image | Follow Adding an OS image |
| Add a lab file feature | Open an issue first to agree on the design, then follow Adding a lab file key |
A good bug report
Please include:
- [ ]
vz version - [ ]
sw_versand your Mac's chip (for example M2 or M4) - [ ] How you installed vz (release tarball or built from source)
- [ ] The
lab.yaml, or the smallest lab file that shows the problem - [ ] The exact command and its full output (add
--jsonif it helps) - [ ] The lab process log:
<state>/lab.log, by default~/.vz/state/<lab name>/lab.log - [ ] For boot problems, the console log (
vz node logs <node>withconsoleLog: true)
Development setup
You need an Apple silicon Mac with macOS 27 and Xcode 27 (or the Command Line Tools).
git clone https://github.com/rayanparsa/vz.git
cd vz
make build # debug build, signed with the virtualization entitlement
make test-core # fast tests, no VMs needed
.build/debug/vz versionThe details:
- Building and testing: every
maketarget, signing, test suites - Architecture overview: layers, processes, networking
- VM assembly: machine parts, platforms and image makers
- AGENTS.md: the short version of the project rules, also used by AI coding agents
Pull requests
Fork the repository and create a branch from
mainwith a short descriptive name, for examplefix-port-forward-ipv6orimage-opensuse.Make your change. Keep one topic per pull request.
Run the checks:
bashmake check # lint, fast tests, schema and examples, repository rulesmake schema-checkneedscheck-jsonschema(pipx install check-jsonschema).If you changed behavior, update the docs in the same pull request: CLI reference, Lab file reference, or the matching guide.
Open the pull request against
main. Say what changed, why, and how you tested it (for runtime changes, which labs you booted).
TIP
For anything bigger than a bug fix (a new command, a new lab file key, a change to the layers), open an issue first. It saves you from writing code that has to be redone.
What CI runs
Every pull request runs these workflows. All of them must pass before a merge.
| Workflow | Job | What it checks |
|---|---|---|
ci | format (Linux) | swift format lint --strict, in the Swift 6.4 Linux image |
| build and test (macOS 27) | A build with warnings as errors, the fast test targets, a smoke test of the vz binary (help, schema, image ls --json, validate on every example, exit codes), and a release build, so a release never fails at tag time | |
| schema, examples, docs and rules (Linux) | docs/reference/schema.md is current, every example and fixture matches the JSON Schema, scripts/check-repo.sh (no em dashes, no AI attribution in commits), links between docs | |
security | codeql (swift) | CodeQL static analysis of the Swift code. Weekly and on demand (Run workflow), not on pull requests: its traced build takes 10 to 15 minutes |
| workflow audit | zizmor on the GitHub Actions workflows | |
| secrets | gitleaks over the whole history | |
pages | build site, deploy | Builds the website when docs/, examples/ or site/ change; deploys from main |
Scorecard rates the repository's security practices weekly for the README badge, and Dependabot opens one pull request a week for new action versions and one for package versions.
A newer push to a pull request cancels its older runs. Runs on main always finish.
The runtime tests need a signed binary and real VMs, so CI does not run them. Run make test locally when you change LabRuntime.
Code style
- Format with swift-format:
make formatrewrites files,make lintchecks them. The settings are in.swift-format: 4 spaces, 120 columns. - Respect the layers: each target depends only on the ones below it, and the engine has no per-OS code. See Architecture overview.
- Comments say why, not what. Keep them short. New files start with a short header comment that says what they are for.
- Error messages are for users: say what is wrong and what to do, for example "Rebuild with: make build".
- Validation collects every problem and reports it with a path into the file (
nodes[2].interfaces[1].attach), so users see all of them at once. - Commands that print output also support
--json.
Commit messages
- Use the imperative mood and keep the subject short: "Add Rocky Linux 10 image", "Fix port forwarding on IPv6".
- Explain the reason in the body when it is not obvious.
- Do not add AI attribution trailers such as
Co-Authored-Bylines for AI tools, or "Generated with" footers.
License
vz is licensed under the Apache License 2.0. By contributing, you agree that your contributions are licensed under the same license.