Skip to content
Blog

MicroVMs

Firecracker vs Cloud Hypervisor for agent sandboxes

Platinum team3 min read

Firecracker vs Cloud Hypervisor for agent sandboxes: device models, memory snapshots, live resizing, and why the provider's API matters more than the monitor.

Firecracker is a deliberately small microVM monitor built for functions and containers. Cloud Hypervisor is a cloud VM monitor with CPU, memory and device hotplug. Both snapshot memory. For an agent sandbox, what matters is which of those features the provider's API actually gives you.

E2B and Vercel Sandbox run on Firecracker. Platinum runs on Cloud Hypervisor.

Firecracker (minimal devices, a balloon within boot RAM, memory snapshots) and Cloud Hypervisor (CPU, memory and PCI hotplug, virtio-mem, snapshot and restore) both power a provider API, which decides whether stop keeps RAM, fork copies RAM and resize is live.

The two designs#

FirecrackerCloud Hypervisor
Built forLambda- and Fargate-style workloads (AWS)Modern cloud VMs (started at Intel, now a Linux Foundation project)
DevicesMinimal: virtio block, net and vsockVirtio, plus PCI hotplug and passthrough
Memory snapshotsGuest RAM and device stateVM snapshot and restore
Memory changes while runningBalloon, within the boot allocationHotplug or virtio-mem, within reserved headroom
CPU changes while runningNot documentedHotplug on x86, up to a boot-time maximum

Sources, checked November 2026: Firecracker design, ballooning and snapshots; Cloud Hypervisor hotplug and snapshot/restore.

A small device model is not security on its own. Firecracker's design also relies on seccomp and its jailer, and leaves network filtering to the host.

Memory snapshots are not disk copies#

Firecracker saves guest memory and device state; the operator manages disks separately. Restored pages load on demand. Network connections may not survive a restore, and open vsock connections close. Cloud Hypervisor restores need coordinated storage and matching configuration.

For an agent, separate three operations:

OperationWhat comes backPlan for
Stop and resume with memoryHeap, processes and diskReconnecting sockets, renewing tokens
Disk snapshot, then bootFilesRestarting processes
ForkWhatever the provider documentsA filesystem branch is not a process branch

On Platinum, stop saves memory when it can and says so in memory_saved and restore. Snapshots, clones and forks are disk-only. Cloud Hypervisor's RAM snapshots do not change that API.

Ballooning is not hotplug#

Firecracker's balloon takes memory back from the guest and returns it, but only within the boot allocation. It never adds RAM, and a compromised guest driver can ignore it.

Cloud Hypervisor can add memory into headroom reserved at boot. With virtio-mem it can also remove memory, partially if the guest cannot free enough. CPU hotplug needs a boot-time maximum and a guest that brings the new CPUs online.

Platinum exposes live CPU and memory resize within the headroom set at boot. A shrink can return partial: true. An unsupported change returns 409 sandbox_not_resizable. A 202 means pending: read the new size back before starting the bigger job.

The provider's API decides#

ProviderMonitorWhat the docs promise
E2BFirecrackerPause and resume with full state
Vercel SandboxFirecrackerPersistent sandboxes that save on stop
PlatinumCloud HypervisorIts own kernel per sandbox; stop reports whether memory was saved; forks are disk-only

Two Firecracker services make different promises. The monitor alone tells you nothing about persistence.

Compare boot paths, not boot claims#

A monitor's boot time is not your agent's wait. A create can include placement, image fetch, guest init and a network round trip. A restore skips init but pays later in page faults. Compare the same endpoint (first command completed) on the same path (cold boot or restore). Platinum's sub-second starts are measured on its status page.

Which to pick#

  • Building your own function runner with fixed resource shapes: Firecracker. The small device model, jailer and snapshots are a focused base.
  • Operating cloud VMs that need hotplug: Cloud Hypervisor.
  • Buying a sandbox service: ask what survives stop, what survives fork, what can change live, and what happens when recovery falls back to a fresh boot. See agent sandboxes compared, and the E2B and Daytona pages.