vmz - alpine x Virtualization.framework
  • Zig 65.4%
  • Swift 23.1%
  • C 9.8%
  • Nix 0.9%
  • Python 0.8%
Find a file
2026-05-22 14:11:38 +00:00
lib minor cleanup 2026-05-22 15:34:26 +02:00
src fix args 2026-05-22 16:10:05 +02:00
.gitignore minor cleanup 2026-05-22 15:34:26 +02:00
build.zig Validate user-controlled version string to prevent path traversal (#11) 2026-05-22 15:43:23 +02:00
entitlements.plist first commit :) 2026-05-18 23:11:57 +02:00
flake.lock first commit :) 2026-05-18 23:11:57 +02:00
flake.nix Validate user-controlled version string to prevent path traversal (#11) 2026-05-22 15:43:23 +02:00
README.md Fix nuke argument handling 2026-05-22 12:51:38 +02:00

vmz

vmz is a smol1 Zig CLI to boot Alpine Linux on macOS using Virtualization.framework, try it today, break it, report bugs!

Warning

only runs on apple silicon macOS with Virtualization.framework support.

curl -LO https://f.rcast.dev/vmz
chmod +x ./vmz    # rw- > rwx
./vmz download -y # download alpine's latest stable initrd and kernel
./vmz             # run the VM
./vmz nuke        # cleanup downloaded files
rm ./vmz          # goodbye, take care polar bear!

vmz currently:

  • downloads Alpine Linux netboot kernel and initramfs
  • boots the VM configuring:
    • kernel path
    • initrd path
    • kernel cmdline
    • memory size
    • cpu count
    • networking (NAT)
    • escape key
vmz boots Alpine Linux VMs on macOS using Virtualization.framework.

usage:
  vmz [version]
  vmz run [options]
  vmz download [-y|--yes] [version]
  vmz nuke [-y|--yes]
  vmz version

commands:
  vmz [version]
      boot a downloaded Alpine version, defaults to `latest-stable`.

  vmz download [-y|--yes] [version]
      download alpine netboot files and unpack the kernel.
      prompts for confirmation, use -y to skip.

  vmz run [options]
      boot directly from local kernel and initrd files
      useful for experimentation

  vmz nuke
      delete all downloaded vmz assets.
      prompts for confirmation, use -y to skip.

downloaded assets are stored in: `~/Library/Application Support/vmz/<version>/`

development

the Zig entry point calls a tiny Swift bridge (lib/libvmz.swift) through the C ABI declared in lib/libvmz.h.

requirements

  • Apple Command Line Tools, including codesign
  • zig 0.16.0 (download), or use the provided nix development shell with nix develop

build:

zig build # adds virtualization entitlement via `codesign`

build, sign and launch:

zig build run -- download -y
zig build run -- run

  1. binary size (main): 641KB ↩︎