Repository navigation
docs: mounting into a VM guest - #8
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Firecracker is verified now — and it needs less than the page claimedA real Firecracker v1.16.1 microVM (guest kernel The "not witnessed" note is gone, and the section now carries the tap setup, a complete Two findings that changed the pageNo The guest needs no network commands at all, given an On the container restartNot needed in the end. A new user namespace grants a full capability set (
|
Adds `docs/1.guide/5.vms.md`: serve a driver on the host, mount it inside a VM with one command and nothing installed in the guest. QEMU gets 9P over `trans=tcp`. Its default user-mode networking already routes 10.0.2.2 to the host's loopback, so there is no tap device, no bridge, no host-side `ip` command and no root on the host — the server stays bound to 127.0.0.1. Verified end to end against an Alpine 3.21.3 `virt` guest (kernel 6.12.13-0-virt): mount with three options and no `modprobe`, then ls/read/write/mkdir/dd/rename/unlink/umount. Firecracker gets NFSv4.1, because it cannot do 9P at all: it emulates no `virtio-9p` device, and its published guest kernels ship `# CONFIG_NET_9P is not set`. Those kernels do carry NFSv4.1 (and not NFSv3), which is exactly the half that landed in #7. The tap wiring that Firecracker requires is not yet witnessed here, and the page says so. Also records both in `.agents/environment.md`, and amends the NFS note in AGENTS.md: NFSv4.1 was listed as having no real-client verification for want of a `mount.nfs` on this host, and a VM guest supplies one — the same server mounted `vers=4.1` from a real Linux kernel client and passed the same workload. Still not a Tier-2 column; that would mean carrying a VM in the suite. Guide pages renumbered to slot it after Mounting; URLs are unaffected, since the numeric prefix is routing-only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A real Firecracker v1.16.1 microVM (guest kernel 6.1.102, their own ubuntu-22.04 root image) mounted this NFSv4.1 server and passed the same workload the QEMU columns do: ls, read, write, mkdir -p, 16 MiB dd both directions, rename, unlink, umount. Two findings worth the page: - **No `nfs-common` is needed in the guest.** Firecracker's root image has neither `mount.nfs` nor `mount.nfs4`, and the mount works anyway: with `addr=` and `clientaddr=` given explicitly there is nothing left for the helper to resolve, so `mount(8)` falls through to the `mount(2)` syscall. That is the difference between "rebuild your image" and "nothing to install", so the page now spells both options out deliberately. - **The guest needs no network commands**, given an `ip=` kernel boot arg. The page drops its "not witnessed" note and gains the tap setup, a complete `vm.json`, and the mount that was actually run. `.agents/environment.md` records the reproduction, including the part that made it possible without a container restart: this container has `/dev/net/tun` but no `CAP_NET_ADMIN` in its bounding set, so `ip tuntap add` is refused even for root — while a new user namespace grants a full capability set over the netns it owns, so the tap, the server and the VM all run inside one `unshare -Urn --map-root-user`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Rebasing onto main picked up `fix: keep every entry point loadable by node's type stripping`, which removes the one constraint the VM harnesses worked around: `node src/nfs/…` used to die on `src/nfs/v4/state.ts` with ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX, so they imported `dist/` after a build. Re-verified against the rebased tree and corrected the note. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Serve a driver on the host, mount it inside a VM with one command and nothing installed in the guest. New page at
/guide/vms, slotted in after Mounting.The guide index already described 9P as serving "the local kernel, or a VM guest" — this is that page.
QEMU → 9P
The recipe is three commands, and the reason it is that short is worth stating: QEMU's default user-mode networking already routes
10.0.2.2to the host's loopback. So there is no tap device, no bridge, no host-sideipcommand and no root on the host, and the server stays bound to127.0.0.1where nothing on the network can reach it.Verified end to end against a stock Alpine 3.21.3
virtguest (kernel6.12.13-0-virt) driven over the serial console:modprobe—mount -t 9pautoloadsv9fs/9pnet_fdls, read, write,mkdir -p, 16 MiBddboth directions,mvacross directories,rm,df -T,umountmsize=, which is the same proof-by-omission the local-mount notes already rely on; asking formsize=1048576makes it appearThe page also separates this from QEMU's own
-virtfs, which exports a host directory through QEMU's built-in 9P server. Every-fsdevbackend is directory-based (-fsdev sock,…→fsdriver sock not found), so there is no way to pointvirtio-9pat an external server — TCP is genuinely the route, not a fallback.Firecracker → NFSv4.1
Firecracker cannot do 9P, for two independent reasons, and the page says so plainly rather than offering a recipe that cannot work:
virtio-9pdevice# CONFIG_NET_9P is not setWhat those kernels do carry is
CONFIG_NFS_V4=y/CONFIG_NFS_V4_1=yand# CONFIG_NFS_V3 is not set— so the transport is NFSv4.1 specifically, the half that landed in #7.NFSv4.1 now has a real kernel client
AGENTS.md listed NFSv4.1 as having no real-client verification, for want of a
mount.nfson this host. A VM guest supplies one. The same server was mountedvers=4.1from a real Linux kernel NFSv4.1 client and passed the same workload — mount, read, write,mkdir, 16 MiBdd, rename, unlink, unmount — with norpcbindand no MOUNT program involved. AGENTS.md is amended accordingly.This is still not a Tier-2 test column: the host itself has no
mount.nfs, so a v4.1 mount test would have to carry a VM, which is a bigger decision than this PR.Not verified, and marked as such
The Firecracker tap wiring has not been exercised end to end — this container has no
/dev/net/tun, and every Firecracker network is a tap device. The kernel-config and device facts are read from Firecracker's own published kernels and docs, and the NFSv4.1 mount itself was verified from a QEMU guest (which needs no tap). The page carries a note saying exactly this, and it can come out once the run happens.Notes
.agents/benchmarks.md.tuningandtroubleshootingare unchanged andvmsis new..agents/environment.mdrecords the reproduction details, including the two container limits that shaped this (/dev/kvmneedssudohere;/dev/net/tunis absent).pnpm test: 58 files passed / 4 skipped, 2779 tests passed. Docs site builds clean (22 pages).🤖 Generated with Claude Code