Kagex/Guides
Linux KVMPlatforms & Hypervisors · 5 min read

Linux KVM & Firecracker v1.12.1 MicroVMs with Per-VM Netns & nftables

Hardware KVM virtualization paired with dedicated per-VM netns/nftables firewalls gives autonomous agents isolated Linux kernels with near-zero memory overhead.

VMM
Firecracker v1.12.1 over /dev/kvm
Network
Per-VM netns + nftables + MITM proxy
Architectures
Linux x86_64 (amd64) & arm64
Provision KVM prerequisites and build on Linux
sudo ./infra/scripts/setup-linux.sh   # Firecracker, nftables, iproute2, e2fsprogs
make images build                     # Builds kernel, rootfs (Docker/debootstrap) & binaries
sudo ./_out/bin/sandboxd install --artifacts _out

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.

Defense-in-Depth Per-VM Namespaces

Every Firecracker instance receives an isolated Linux network namespace wired via nftables rules so raw packet spoofing, LAN probes, and metadata requests (169.254.169.254) drop at kernel level before reaching host proxies.

Sparse SEEK_DATA & FICLONE CoW Storage

On XFS/Btrfs filesystems supporting reflink, snapshots clone instantly via FICLONE; on ext4, Kagex falls back to sparse SEEK_DATA/CopyFileRange copies keeping disk usage minimal.

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. infra/scripts/build-rootfs.sh works with Docker when present or native debootstrap directly on Linux.