The four crates
sandkiln-protocolcarries the wire format shared by host and guest: length-prefixed JSON, kept dependency-light so neither side reaches into the other.sandkiln-guest-agentruns inside the microVM as a systemd service. It listens on vsock and answers exec/read/write/list, shipping as a static musl binary.sandkiln-vmmdrives Firecracker directly: boot, snapshot/resume, network leasing, drives, the vsock client. A hand-rolled HTTP client talks to Firecracker’s own API socket.sandkiln-daemonis the axum + tokio HTTP API wrapping the lifecycle (create, exec, list, stop, snapshot, images, drives) with auth, tags, and tracing built in from day one.
sandkiln-protocol depends on nothing, and nothing depends on sandkiln-daemon. That’s what lets the guest agent ship as an independent static binary and sandkiln-vmm stay usable standalone, outside the daemon entirely.
Boot lifecycle
- Lease. A tap device and IP are leased from the pool, attached to the bridge.
- Boot. Firecracker starts; boot-source, drive, machine-config, and vsock are configured over its API socket.
- Agent up. The guest kernel boots, systemd starts the guest agent, it binds its vsock port.
- Ready. The host’s vsock client connects; the sandbox can run anything sent to it.
Deeper dives
Each of the following came from hitting a real constraint on real hardware, not a whiteboard preference:- Jailer & privilege model: ambient
CAP_NET_ADMIN, a static tap pool, and a root that stays out of the hot path. - vsock wire protocol: vsock, a length-prefixed JSON frame, and a client that doesn’t reach for a full HTTP stack.
- Snapshot, resume, and fork: sandbox vs. session, and why a snapshot points at paths instead of carrying values.
- Bug hunt: the vsock timeout, a case study of a real bug that could hang a stop forever.
- SDK and CLI design: zero runtime dependencies, and why async Python is a fully separate client, not a mode of the sync one.
- Testing and benchmarking: the 24-topic concurrent integration suite and the criterion benchmarks behind every “live-verified” claim in these docs.