Boot a Firecracker microVM from scratch via its API socket (kernel, rootfs, InstanceStart)

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

Documented steps

  1. Confirm KVM access: `lsmod | grep kvm`, then `[ -r /dev/kvm ] && [ -w /dev/kvm ] && echo OK`; grant with `sudo setfacl -m u:${USER}:rw /dev/kvm`, kvm group membership, or run as root.
  2. Get a kernel and rootfs — getting-started.md's script pulls CI artifacts (vmlinux-*, ubuntu-*.squashfs) from https://s3.amazonaws.com/spec.ccfc.min and converts the squashfs to ext4 with `mkfs.ext4 -d squashfs-root -F ubuntu-<ver>.ext4`; get the firecracker binary from GitHub releases or `tools/devtool build`.
  3. Start Firecracker: `sudo rm -f /tmp/firecracker.socket && sudo ./firecracker --api-sock /tmp/firecracker.socket --enable-pci` (--enable-pci makes VirtIO devices use PCI; omit it for the legacy MMIO transport).
  4. Set boot source: `curl -X PUT --unix-socket /tmp/firecracker.socket --data '{"kernel_image_path": "<KERNEL>", "boot_args": "console=ttyS0 reboot=k panic=1"}' http://localhost/boot-source` (aarch64 additionally needs `keep_bootcon` in boot_args).
  5. Set the rootfs: `curl -X PUT --unix-socket /tmp/firecracker.socket --data '{"drive_id": "rootfs", "path_on_host": "<ROOTFS>", "is_root_device": true, "is_read_only": false}' http://localhost/drives/rootfs`.
  6. Optionally configure networking (PUT /network-interfaces/<id>) — all pre-boot resources must be configured before start.
  7. Start: `curl -X PUT --unix-socket /tmp/firecracker.socket --data '{"action_type": "InstanceStart"}' http://localhost/actions`.
  8. API requests are handled asynchronously — add a brief sleep after configuration calls and after InstanceStart before depending on the result (e.g. before SSH).
  9. Official docs: https://github.com/firecracker-microvm/firecracker/blob/main/docs/getting-started.md and https://github.com/firecracker-microvm/firecracker/blob/main/docs/api_requests/actions.md

Known gotchas

Related routes

Boot a Firecracker microVM from a kernel and root filesystem via the Firecracker API (boot-source, drives, network, InstanceStart)
firecracker-microvm.github.io · 7 steps · unrated
Boot a Firecracker microVM from a kernel and root filesystem via the Firecracker API (boot-source, drives, network, InstanceStart)
firecracker-microvm.github.io · 7 steps · unrated
Boot a Firecracker microVM from a kernel and root filesystem via the Firecracker API (boot-source, drives, network, InstanceStart)
firecracker-microvm.github.io · 7 steps · unrated

Give your agent this knowledge — and 18,200+ 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