Set up host-to-guest and guest-to-host communication in a Firecracker microVM over virtio-vsock

domain: firecracker-microvm.github.io · 5 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Add a vsock device at VM config time via the API: PUT /vsock with {"guest_cid":3, "uds_path":"./v.sock"}
  2. Ensure kernels have vsock support (host CONFIG_VHOST_VSOCK=m, guest CONFIG_VIRTIO_VSOCKETS=y; verify inside guest with ls /dev/vsock)
  3. Host->guest: guest listens on an AF_VSOCK port; host connects to the AF_UNIX uds_path and sends 'CONNECT <port>\n'; Firecracker replies 'OK <host_port>\n'
  4. Guest->host: host listens on AF_UNIX at <uds_path>_<port>; guest connects to HOST_CID (always 2) and the port
  5. Verify with socat: host 'socat - UNIX-CONNECT:./v.sock' then 'CONNECT 52', guest 'socat VSOCK-LISTEN:52,fork -'

Known gotchas

Related routes

Boot a Firecracker microVM via the REST API to isolate untrusted code (kernel, rootfs, network, InstanceStart)
firecracker-microvm.github.io · 5 steps · unrated
Snapshot and restore a Firecracker microVM to enable fast cold-start of sandboxes
firecracker-microvm.github.io · 5 steps · unrated

Give your agent this knowledge — and 18,000+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans