# Firecracker vs Cloud Hypervisor for agent sandboxes
Firecracker vs Cloud Hypervisor for agent sandboxes: device models, memory snapshots, live resizing, and why the provider's API matters more than the monitor.
URL: /blog/firecracker-vs-cloud-hypervisor
Published 2026-11-18 by Platinum team · microvm, infrastructure, agents

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.](/blog/firecracker-vs-cloud-hypervisor/firecracker-vs-cloud-hypervisor.svg)

## The two designs

| | Firecracker | Cloud Hypervisor |
| --- | --- | --- |
| Built for | Lambda- and Fargate-style workloads (AWS) | Modern cloud VMs (started at Intel, now a Linux Foundation project) |
| Devices | Minimal: virtio block, net and vsock | Virtio, plus PCI hotplug and passthrough |
| Memory snapshots | Guest RAM and device state | VM snapshot and restore |
| Memory changes while running | Balloon, within the boot allocation | Hotplug or virtio-mem, within reserved headroom |
| CPU changes while running | Not documented | Hotplug on x86, up to a boot-time maximum |

Sources, checked November 2026: Firecracker [design](https://github.com/firecracker-microvm/firecracker/blob/main/docs/design.md), [ballooning](https://github.com/firecracker-microvm/firecracker/blob/main/docs/ballooning.md) and [snapshots](https://github.com/firecracker-microvm/firecracker/blob/main/docs/snapshotting/snapshot-support.md); Cloud Hypervisor [hotplug](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/hotplug.md) and [snapshot/restore](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/main/docs/snapshot_restore.md).

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:

| Operation | What comes back | Plan for |
| --- | --- | --- |
| Stop and resume with memory | Heap, processes and disk | Reconnecting sockets, renewing tokens |
| Disk snapshot, then boot | Files | Restarting processes |
| Fork | Whatever the provider documents | A filesystem branch is not a process branch |

On Platinum, [stop saves memory when it can](/blog/stop-keeps-memory) and says so in `memory_saved` and `restore`. [Snapshots, clones and forks](/docs/snapshots) 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](/docs/sandboxes#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

| Provider | Monitor | What the docs promise |
| --- | --- | --- |
| [E2B](https://e2b.dev/docs/sandbox) | Firecracker | Pause and resume with full state |
| [Vercel Sandbox](https://vercel.com/docs/sandbox) | Firecracker | Persistent sandboxes that save on stop |
| [Platinum](/docs/sandboxes) | Cloud Hypervisor | Its 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](/status).

## 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](/docs/compare/agent-sandboxes), and the [E2B](/docs/compare/e2b-alternative) and [Daytona](/docs/compare/daytona-alternative) pages.
