A Disposable Pentesting Environment With Zero Disk Footprint
The standard approach to a pentesting environment is a Kali VM: download a 4GB ISO, allocate 40GB of disk, boot it with VirtualBox, and accept that you’re running a completely separate OS that diverges from your host the moment you update anything. Or you run Kali in a container, which buys you speed but costs you kernel isolation, the thing that matters most when you’re running exploit code.
kalinix.vm takes the third path: a hermetic QEMU MicroVM declared in Nix, sharing the host’s /nix/store read-only, booting under a second to a full pentesting toolset, requiring zero extra disk space, and running entirely without root on the host.
Why a MicroVM instead of a container
The threat model for a pentesting environment is different from a CI sandbox. You’re running tools that probe real vulnerabilities. You want to run nmap, sqlmap, metasploit, tools that could cause real damage if they escaped. A container shares the host kernel. A MicroVM has its own. If something goes sideways in the guest (a buggy exploit payload, a tool that touches kernel interfaces in unexpected ways) it stays in the VM.
That isolation is the point. The speed and zero-footprint properties are what make it actually usable instead of a theoretical security win.
The zero disk footprint trick
Traditional VMs duplicate everything. kalinix.vm uses a 9p ro-store share to mount the host’s /nix/store read-only into the guest at /nix/.ro-store, with a writable overlay on top. The result: nothing the guest needs is duplicated on disk. The full pentesting toolset is already on your machine. You’re just exposing it to the guest in a read-only view.
nix run .#microvm
That’s it. One command, under a second, full toolset. No ISO download. No disk allocation. No snapshot management.
Rootless networking via SLiRP
Standard QEMU networking requires either sudo for TAP/TUN or a system bridge. kalinix.vm uses slirp user-mode networking, which runs entirely in user space. No iptables rules added to the host, no firewall changes, no elevated privileges required at all. The only network surface the guest exposes to the host is a set of forwarded ports on loopback:
- 18080 → OWASP ZAP
- 18081 → mitmproxy web UI
- 18443 → Caido
- 18888 → BloodHound CE
These bind to 127.0.0.1 only. Nothing reaches the LAN. The host browser hits http://127.0.0.1:18080 and the guest runs the tool. The 1xxxx port range avoids collisions with host services.
GUI forwarding for the holdouts
Not everything has a headless mode. Ghidra, Wireshark, Burp Community still want a window. For those, kalinix.vm includes two forwarding options: Waypipe (a guest systemd service connects to the host on TCP 1337, forwarding the Wayland protocol) and standard X11 forwarding via DISPLAY. The Waypipe socket is restricted to user:users at mode 660.
The Nix advantage
The entire environment is declared in a flake. Add a tool: add it to the flake, rebuild. Remove a tool: remove it, rebuild. Roll back to any prior state: pin the lockfile to a prior revision, rebuild. There’s no “I wonder what state my VM is in.” The state is the flake, and the flake is in git.
The standalone tool bundle is also available for cases where you don’t need the isolation:
nix build .#defaultPackage.x86_64-linux
That produces a buildEnv named pentesting-tools with the full toolset on PATH, no VM required.
Fork and run:
nix run github:lowcache/kalinix.vm#microvm
Written from the machine it describes. More field notes: the archive · RSS.
Working on something in this territory? I take on scoped engagements.