Skip to content

Firecracker hosts: package caches, builds, the jailer and snapshots #345

Closed

Description

@fctl-sh

#344 adds the firecracker driver (ADR 0070): each session in a microVM of its own on Linux hosts with KVM, from the same images as Docker, without root. It leaves these for later, each its own pull request:

  • Package caches. The VMs share no filesystem with the host (Firecracker has no virtio-fs or 9p), so projects that share caches get none there. A project's ext4 disk attached to its VM works for one sandbox at a time; several sandboxes of a project at once need something else, such as a file server over the vsock.
  • Image builds. allowed_builds is always empty with this driver: building a Dockerfile without Docker takes a builder (BuildKit, say) in a VM.
  • The jailer. Firecracker runs as the host's user, so a VM escape lands where the runner's token is. A host that runs as root could run each VM through Firecracker's jailer, as a user of its own in a chroot and a cgroup.
  • Snapshots. Stopping a sandbox shuts its VM down, so a resume starts Claude again. A snapshot would resume it with its programs running, for the VM's memory on disk.
  • CI that boots VMs. GitHub's x86_64 runners have KVM: run cargo test -p fctl-host boots_a_sandbox -- --ignored there, which only ran by hand on aarch64 (Firecracker nested under QEMU). x86_64 hosts and Ubuntu's AppArmor profile for passt are untried.
  • Disk. Images share no layers, so each takes its whole size, and the first pull of an image unpacks it in a VM, which takes longer than Docker's.

Activity

  1. added
    enhancement
    host
    on Oct 29, 2026
  2. fctl-sh commented on Oct 29, 2026

    @fctl-sh
    ContributorAuthor

    The Firecracker driver and what it needs are merged:

    What this issue lists is still to do.

  3. FilipeNas commented on Nov 5, 2026

    @FilipeNas

    in a new ubuntu vm shows this. so firecracker not ready yet right?

    filipe@ubuntuvm:~$ FCTL_SERVER=https://app.fctl.sh fctl host install --token xyz
    error: No VM or container runtime is ready on this machine:
      apple: Apple container needs macOS 26 on Apple silicon
      docker: the docker CLI is not installed
      lima: limactl is not installed (install Lima: https://lima-vm.io)
    Install one, or pass --driver process to run agents without isolation.
    filipe@ubuntuvm:~$ 
    
  4. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    @FilipeNas The Firecracker driver has been in fctl since v0.27.0, but fctl host install uses it only when you pass --driver firecracker: --driver auto picks among Apple's container, Docker and Lima. The error you got named Firecracker only once it was ready, so it didn't say what your VM lacks. On Ubuntu it needs KVM that your user may use, and two packages:

    sudo usermod -aG kvm $USER   # then log in again
    sudo apt install passt e2fsprogs
    fctl host install --driver firecracker --token …

    Inside a VM, /dev/kvm exists only when the hypervisor that runs it has nested virtualization turned on. fctl host install --driver firecracker checks all of this before it registers anything and says what is missing, as fctl host doctor does.

    That pull request makes the error list Firecracker on Linux with what it lacks, and say that it needs --driver firecracker. The rest of this issue's list is still to do.

  5. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    #426 is merged (67a1dc1). From the next fctl release, fctl host install lists Firecracker on Linux with what it lacks when no driver is ready, and says that it needs --driver firecracker. No release has it yet; CI pins fctl.sh's docs to it, so the CLI page's note about this goes live there. Nothing on this issue's list changes: package caches, image builds, the jailer, snapshots, CI that boots VMs, and disk are all still to do.

  6. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    Each item on this list now has a pull request, all open and none merged yet. They're stacked on #429, which the others need for CI that boots VMs:

    Integration left between them, for whichever merges second: package caches and snapshots (a resumed VM must mount its caches again), and the jailer with each of those (a jailed Firecracker can't reach a cache server's socket that root made, and a snapshot written in the chroot goes with it). Each pull request's description says so.

  7. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    hyperstructure/sandbox#15 is merged (4e00425), and its Kernel workflow published ghcr.io/hyperstructure/sandbox-kernel:6.18.59-1, the kernel with 9p. No host uses it yet: hosts pull the kernel their fctl release pins, and #430 is what pins this one. With it published, #430's VM tests pass in CI on x86_64 (two sandboxes of a project sharing their caches at once), so #430 is out of draft and ready for review. All six pull requests for this issue (#429 to #434) now pass their checks; #429 goes first, and #432 before #433.

  8. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    #429 (CI that boots VMs, and Firecracker's network on Ubuntu and on root hosts) is merged as 13199ed, and #434 (the jailer for hosts that run as root) as 3127408, both on main. No release has them yet: the newest is v0.30.1, so hosts get them with the next one. #430, #431 and #432 were stacked on #429 and now target main; I'm bringing them up to date with it, and giving #430 (package caches) and #431 (snapshots) what they need for jailed VMs, since the jailer merged first. #433 stays stacked on #432.

  9. fctl-sh commented on Nov 6, 2026

    @fctl-sh
    ContributorAuthor

    #432 (image builds with BuildKit in a VM of each project's own) is merged as aafb7e3, and #433 (images kept over the images they're built on, with their layers' digests checked) as e743b4a, both on main. No release has them yet (the newest is v0.30.1). Left open: #430 (package caches) and #431 (snapshots), both up to date with main as of the jailer and passing their checks; I'm bringing them up to date with these two merges. A jailed VM saves no state yet; that is #437.

  10. fctl-sh commented on Nov 7, 2026

    @fctl-sh
    ContributorAuthor

    #431 (stopped sandboxes resume where they were) is merged as 62d24e0, on main; no release has it yet (the newest is v0.30.1). A jailed VM saves no state yet (#437). #430 (package caches) is the last of these pull requests still open: it's up to date with main and now serves and mounts a resumed VM's caches again, and its checks pass.

  11. fctl-sh commented on Nov 7, 2026

    @fctl-sh
    ContributorAuthor

    Everything on this list is merged into main, each with its VM tests passing in CI's "Firecracker sandboxes" job on x86_64 (as the runner's user, and as root for the jailer):

    No release has these yet (the newest is v0.30.1): Linux hosts get them with the next one. Left for later, in their own issues:

  12. fctl-sh commented on Nov 7, 2026

    @fctl-sh
    ContributorAuthor

    #437 (jailed VMs saving no state) is done: #439 is merged as 33f177e, so hosts that run as root save and resume their VMs' state too. No release has it yet (the newest is v0.30.2); hosts get it with the next one. Of the follow-ups listed above, only #438 (a first pull of an image that lies over nothing downloads every layer before a VM unpacks them) is left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementhost

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions