Firecracker sandboxes: what you build yourself, and what flockvm manages

Last updated

A Firecracker sandbox is a microVM with its own Linux kernel, started by Firecracker on top of KVM, used to run code you don't trust: an AI agent with shell access, for instance. Firecracker itself is only the virtual machine monitor. The kernel, the disk image, the network, the firewall, the snapshots and the scheduling are yours to build, or a managed service's.

flockvm is one of those managed services: Firecracker microVMs for coding agents, one VM per agent, on a host in France. Sign-ups are open (Google, GitHub or an email link), with a 7-day free trial: card required, nothing charged for 7 days, cancel anytime. This page explains what we had to build around Firecracker, with the numbers from our hosts, and lists the other managed options.

What is a Firecracker sandbox?

Firecracker is an open-source VMM, Apache 2.0, that "uses the Linux Kernel Virtual Machine (KVM) to create and run microVMs". It was developed at AWS for Lambda and Fargate. Each sandbox gets its own guest kernel, so a process inside it does not share a kernel with the host or with the other sandboxes, as it would in a container. E2B, Fly.io and Vercel Sandbox all run on it.

The specification promises ≤ 125 ms from the InstanceStart call to the guest's init, and ≤ 5 MiB of VMM memory overhead for a 1 vCPU, 128 MiB guest, on AWS metal instances (M5D.metal, M6G.metal). Real agent sandboxes are bigger than that, and slower (see below).

For a coding agent, the point is that it can run --dangerously-skip-permissions in a VM it can break without breaking your laptop: see how to use that flag safely.

What does Firecracker give you, and what is left to build?

Layer Firecracker provides You build
Isolation KVM microVM, one process per VM, seccomp filters; the jailer (chroot, cgroup, namespaces, dropped privileges) The jail directory for each VM, the uid, the cgroup limits
Guest Boots an uncompressed kernel and a raw disk The kernel config and the root filesystem image
Network A virtio-net device attached to a TAP The TAP, IP plan, NAT, firewall, anti-spoofing, inbound access
Snapshots Pause, full snapshot (state + memory file), load Where the files go, when to fsync, clock fix-up, what to do after a host crash
Control A REST API on a Unix socket, per VM Create / pause / resume / delete for many VMs, admission, billing, logs

What does it take to run Firecracker sandboxes yourself?

Here is what runs today on the flockvm host in France, an OVHcloud bare-metal server. Everything below comes from the host's setup scripts and notes. The timings were measured on flockvm's first host, a Scaleway server in Paris retired on 10 November 2026, unless a line says otherwise.

A guest kernel and an image

Firecracker's prebuilt CI kernel boots, but it has no nf_tables, so Docker's iptables-nft calls fail inside the VM. We build Linux 6.1.191 with Firecracker's own CI config plus a fragment that adds nf_tables, IPVS, more xtables matches, WireGuard, FUSE and a few more. The root filesystem is an Ubuntu 26.04 ext4 image built with debootstrap: openssh-server, git, build-essential, Python 3, Node.js 22, tmux, and Docker started by socket activation, so it costs no RAM until the first docker command.

The guest has no DHCP: the kernel ip= boot argument sets the address, gateway and DNS before init. SSH keys reach the guest through Firecracker's MMDS on first boot.

A network you write yourself

Each VM gets an index N, a TAP device, a /30 subnet, and a host port 22000+N forwarded to the guest's port 22. All rules live in one nftables table, with two set elements per VM: one for anti-spoofing, one for the SSH DNAT. The table drops traffic from a VM to the host, to the other VMs, to private ranges and to 169.254/16 (cloud metadata), refuses outbound SMTP, and masquerades the rest to the Internet. We tested each of these from inside a VM with a second VM running. The VMs have no IPv6 yet.

The jailer, and its sharp edges

Firecracker is meant to run under the jailer in production. Two things we learned: the jailer only accepts [A-Za-z0-9-] in an id, so vm_7kq2m4 is rejected; and it refuses a chroot whose device nodes already exist, so the chroot is rebuilt at every start. Each VM's cgroup sits outside the daemon's systemd cgroup, so restarting the daemon does not kill VMs.

Snapshots: pause and resume with memory

A full snapshot writes a state file (18-24 KB here) and a memory file as large as the guest RAM: 4 GiB for a 4 GiB VM. Things that are not in the quick-start guides:

  • The guest clock stays behind by the time spent paused, unless the guest boots with clocksource=kvm-clock and the restore passes clock_realtime: true.
  • After a restore, the memory file backs guest RAM. A later snapshot must go to a new file, or it corrupts the running VM. A snapshot is single-use.
  • Firecracker says snapshots must be resumed on identical software and hardware, and that restoring the same snapshot more than once is insecure: random numbers and one-time tokens "may be used twice". That is why a safe fork takes more than copying files.
  • Writing 4 GiB takes seconds, and whether you fsync it changes the pause time a lot: on the Paris host, the snapshot write took 17.7-22.5 s with sync_snapshot_files: true, 2.0-7.2 s without.

Capacity and limits

Guest RAM is allocated lazily: an idle 4 GiB VM used 255-262 MiB of host RAM. Without a balloon device it never gives memory back until it is paused or stopped. Our admission rule is conservative: the guest RAM of running VMs must fit in host RAM minus a reserve kept for the host. On the host in France (64 GB of RAM, 12 cores and 24 threads), that leaves about 60 GB for guests: 15 small VMs by RAM alone. vCPUs give the same bound. SMT is on, with core scheduling: each VM has its own core-scheduling cookie, so two VMs never run on the two threads of one physical core at the same time. The host admits 1.25 guest vCPUs per thread, 30 in all: 15 small, 7 default, 3 large or 1 xlarge VM at once.

How fast is a Firecracker sandbox in practice?

Measured on the Paris host, retired on 10 November 2026 (Xeon E3-1230 V2, Firecracker v1.17.0, 2 vCPU / 4 GiB guest, through the jailer), on 30 and 31 October 2026:

Step Time
InstanceStart → sshd banner, first boot 0.96-1.04 s
API create → VM running (disk copy included), quiet host 1.73-1.79 s
API pause → paused (4 GiB memory file), quiet host 2.6-3.3 s
LoadSnapshot + resume, inside Firecracker 15-21 ms
API resume → running 0.30-0.43 s (0.73-0.94 s when resumed a few seconds after the pause)

The gap with the 125 ms in the specification is the guest: a full Ubuntu with systemd and sshd, not a minimal init. These are single-host numbers on an old CPU, not a benchmark. On the host in France (AMD Ryzen 9 9900X), creating a VM until its SSH server answers took 0.43 to 1.34 s, median about 1.1 s, over 12 VMs on the Agent image, on 9 and 10 November 2026.

Which managed Firecracker services exist?

Checked on 31 October 2026, on each provider's own documentation:

Service Runs on Firecracker Pause keeps memory Fork a running VM Notes
Fly Machines Yes Yes, suspend, for machines ≤ 2 GB Not documented General-purpose VMs with a REST API
Sprites (Fly.io) Runs on Fly Machines At first: a warm pause keeps memory, a later cold pause drops it (automatic); checkpoints are disk snapshots Not documented Sleep when idle, wake on request
E2B Yes, one microVM per sandbox Yes Yes, files, processes and memory Open-source runtime; EU cluster on request
Vercel Sandbox Yes No: filesystem snapshots Filesystem only (Sandbox.fork) CPU billed only while active, memory as provisioned
flockvm Yes, v1.17.0 Yes No, being built France; sign-ups open, 7-day free trial

The comparison by bottleneck (GPU, self-hosting, EU operator, price) is on /compare/e2b-alternatives. For one provider at a time, with monthly costs worked out, see flockvm vs E2B, flockvm vs Vercel Sandbox and flockvm vs Fly.io Sprites; for sandboxes started from a Cloudflare Worker, flockvm vs Cloudflare Sandbox. If you run Docker's sbx microVMs on a laptop today, Docker Sandboxes alternatives covers when to move them elsewhere.

What does flockvm manage today?

Available today:

  • create a Firecracker microVM with an Ubuntu 26.04 image, Docker included, booting to SSH in about a second;
  • pause it with its memory and resume it with the same processes, IP and SSH port;
  • SSH, serial console logs, stop, start, delete;
  • billed per second; for now, the meter counts the seconds a VM is starting or running;
  • one region, in France, on one host (up to 15 small VMs at once, across all customers). Where the data goes is on /eu-data-residency, and the companies involved, with what each one receives, are listed on /subprocessors.

Not yet:

  • no fork: the API has no fork endpoint. Forking one prepared VM into 10 to 20 agents is what flockvm is building next, for coding agent swarms;
  • no secrets proxy: the secrets you set, such as an API key, are written into the VM, and you revoke them when you are done;
  • no public status page, and no region outside France yet (others are planned).

To run Claude Code in one of these VMs, see the Claude Code integration.

Should you self-host Firecracker or use a managed one?

Self-host if you need a custom kernel or device model, you already run bare metal with /dev/kvm, or your volume makes a provider's margin matter. Budget the work above: kernel, image, network, jailer, snapshots, capacity, and the host's own hardening. E2B's runtime is open source and has a single-host mode, E2B Embed, if you want a start.

Use a managed service if you want sandboxes this week rather than a VMM project. Pick it on what you need: memory kept at pause, fork, region, billing model. A plain VPS is another option for one agent; VPS or microVM compares the two, and running agents in parallel covers the setups below one VM per agent.

To try flockvm, start a 7-day free trial.

Run your agents in their own microVMs

flockvm gives each coding agent a Firecracker microVM that pauses with its memory and resumes, billed per second. France is live, and you can start with a 7-day free trial.

Start your 7-day free trial

Card required. Nothing charged for 7 days.