···15551555 used to sandbox guest networking.
15561556- `/dev/kvm`: for hardware acceleration (unless you disable
15571557 KVM with `SPINDLE_MICROVM_PIPELINES_ENABLE_KVM=false`).
15581558-- `/dev/vhost-vsock`: the guest agent talks to spindle over
15591559- vsock.
15581558+- `/dev/vhost-vsock`: used by QEMU to enable guest-to-host vsock
15591559+ communication.
15601560+- `/dev/vsock`: used by spindle on the host to listen on vsock ports
15611561+ and accept guest agent connections.
15621562+- `/dev/net/tun`: required by `slirp4netns` to set up tap devices
15631563+ for sandboxed guest networking.
1560156415611565On NixOS, the [spindle
15621566module](https://tangled.org/tangled.org/core/blob/master/nix/modules/spindle.nix)
15631567puts `qemu`, `e2fsprogs`, `slirp4netns`, `iproute2` and
15641568`util-linux` on the service's `PATH` for you.
15691569+15701570+#### Container virtualization
15711571+15721572+Running `spindle` inside a container (e.g., Docker, Podman, or LXD) requires passing host device nodes into the container and granting the runtime additional privileges. Because spindle uses nested namespaces (`unshare`) and helper tools (`slirp4netns`), the container configuration will require:
15731573+15741574+- `/dev/vsock`, `/dev/vhost-vsock`, `/dev/kvm`, and `/dev/net/tun` mapped from the host.
15751575+- `NET_ADMIN` and `SYS_ADMIN` capabilities to manage network namespaces and mounts inside the container.
15761576+- Relaxed seccomp filters (e.g., `seccomp=unconfined`) and SELinux/AppArmor containment if they restrict namespace creation or device access.
1565157715661578#### Building images
15671579
+4-3
spindle/engines/microvm/README.md
···7272and right before launch we also check the referenced files actually exist on
7373disk and that the host has the commands we need: `mkfs.ext4` for volume
7474formatting, plus whatever the selected runner requires. For QEMU that's the QEMU
7575-binary for the spec's arch, `/dev/vhost-vsock`, `/dev/kvm` (if KVM is enabled),
7676-and the `ip`, `mount`, `slirp4netns`, `unshare` toolchain when the image has
7777-network interfaces.
7575+binary for the spec's arch, `/dev/vhost-vsock` (for guest vsock configuration),
7676+`/dev/vsock` (for host listener sockets), `/dev/kvm` (if KVM is enabled), `/dev/net/tun`
7777+(for guest networking), and the `ip`, `mount`, `slirp4netns`, `unshare` toolchain when the
7878+image has network interfaces.
78797980## microVM lifecycle
8081