Kagex/Guides
macOS 14+Platforms & Hypervisors · 5 min read

Rootless Apple Silicon MicroVMs with Virtualization.framework & APFS CoW

No Lima VM tax, no Docker Desktop license, and no sudo required at runtime. Kagex uses Apple's native hypervisor entitlement with APFS copy-on-write cloning for ~32 ms sandbox starts.

Hypervisor
Apple Virtualization.framework (Code-Hex/vz/v3)
Disk CoW
APFS clonefile (~instant snapshot copies)
Egress stack
gVisor tap-vsock userspace netstack
Build, ad-hoc sign, and start sandboxd on macOS
git clone https://github.com/CodewithEvilxd/kagex.git && cd kagex
make images build   # fetches kernel, builds rootfs, signs with infra/vz.entitlements
./_out/bin/sandboxd install --artifacts _out
./_out/bin/sandboxd doctor

Key Engineering Points · MicroVM Kernel & Compute Isolation

All 10 key points →
  • 1Every Kagex sandbox boots a dedicated single-tenant Ubuntu 24.04 Linux kernel rather than sharing the host OS kernel.
  • 2macOS 14+ (Apple Silicon) runs natively via Apple Virtualization.framework (Code-Hex/vz/v3) with rootless ad-hoc entitlements in infra/vz.entitlements.
  • 3Linux amd64 and arm64 hosts run Firecracker v1.12.1 over /dev/kvm with per-VM Linux network namespaces and nftables packet filters.
  • 4Windows 10 (19041+) and Windows 11 (x64/arm64, Home/Pro/Enterprise) supervise Firecracker KVM inside WSL2 without requiring Hyper-V Pro or Admin privileges.
  • 5Guest base kernels are sha256-verified via infra/scripts/fetch-kernel.sh before registration into _out/images/vmlinux-<arch>.
  • 6Every microVM boots from an immutable Ubuntu 24.04 ext4 rootfs built reproducibly with Docker or native debootstrap.

Rootless Entitlement Signing

make build automatically runs codesign with infra/vz.entitlements so sandboxd boots native Linux guests as your regular unprivileged macOS user.

APFS Clonefile & Memory Budget Reserve

Each golden image clone or fork allocates disk blocks via APFS copy-on-write without duplicating gigabytes. By default, scheduler reserves ~50% of Mac unified memory safely.

Inspect this architecture live in 3D

Step through MCP ingress, Ghost Secrets, CoW blades, and run sandboxctl commands interactively in your browser.

Frequently Asked Questions

No. Docker Desktop is only used once if building the Ubuntu base rootfs locally via make images; runtime microVMs have zero Docker dependency.