← Back to research
·7 min read·industry

Container-to-VM Runtimes

A comparison of 6 tools that run containerized workloads with VM-level isolation: Firecracker, gVisor, Kata Containers, Cloud Hypervisor, Hypeman, and Unikraft. The "containers aren't isolated enough" problem, solved.

Key takeaways

  • Containers share the host kernel — one escape compromises everything. These tools add VM-level isolation while keeping container-like developer experience
  • Three architectural approaches: microVMs (Firecracker, Cloud Hypervisor), userspace kernels (gVisor), and unikernels (Unikraft) — each with different tradeoffs on compatibility, performance, and security
  • AI agent sandboxing is the new killer use case — running untrusted LLM-generated code requires hard VM boundaries, not shared-kernel containers
  • Developer experience ranges from low-level VMM APIs (Firecracker) to Docker-like CLIs (Hypeman) to Kubernetes-native runtimes (Kata Containers)

FAQ

Why aren't containers enough for isolation?

Containers share the host kernel. A kernel exploit in one container can compromise the entire host and all other containers on it. VMs provide a hardware-enforced boundary — each workload gets its own kernel, so a compromise is contained.

What is the difference between a microVM and a unikernel?

MicroVMs (Firecracker, Cloud Hypervisor) run a full Linux kernel in a lightweight VM with a minimal device model. Unikernels (Unikraft) compile the application and only the needed OS components into a single binary — smaller footprint but less compatibility.

Which tool should I use for AI agent sandboxing?

For the quickest start, Hypeman gives you Docker-like UX with VM isolation. For Kubernetes environments, Kata Containers. For maximum density at scale, Firecracker. For defense-in-depth without VMs, gVisor.

How fast do microVMs boot?

Firecracker boots in ~125ms. Cloud Hypervisor is similar. Hypeman adds standby/restore for near-instant resume from snapshots. Traditional VMs take seconds to minutes.

Executive Summary

Containers revolutionized deployment but they share a fatal flaw: the host kernel is a shared attack surface. One container escape compromises everything. As workloads get more adversarial — especially AI agents executing untrusted code — the industry needs VM-level isolation with container-level developer experience.

This comparison covers six tools solving that problem, each with a different architectural approach:

ToolStarsLanguageLicenseApproachDX Level
Firecracker33KRustApache-2.0MicroVM VMMLow (API)
gVisor18KGoApache-2.0Userspace kernelMedium (OCI)
Kata Containers7.6KRustApache-2.0OCI runtime + VMMedium (K8s)
Cloud Hypervisor5.4KRustApache-2.0/BSDModern VMMLow (API)
Unikraft~4KCBSD-3UnikernelLow (custom build)
Hypeman62GoMITMulti-hypervisor CLIHigh (Docker-like)

Key finding: The market is splitting by use case. Firecracker dominates serverless (AWS Lambda/Fargate). Kata Containers owns Kubernetes. gVisor provides defense-in-depth without full VMs. And newcomers like Hypeman are targeting the developer experience gap — making VM isolation as easy as docker run.


The Problem: Shared Kernel = Shared Risk

Standard containers (Docker, containerd) use Linux namespaces and cgroups for isolation. This is process-level isolation, not machine-level. Every container on a host shares the same kernel, and the Linux kernel has ~30 million lines of code with a large syscall surface.

What goes wrong:

  • Kernel exploits (CVE-2024-1086, CVE-2022-0185) can escape containers entirely
  • Privileged containers or misconfigurations weaken isolation further
  • seccomp and AppArmor reduce attack surface but don't eliminate it

Why it matters now: AI agents running LLM-generated code are the new threat model. You cannot trust code written by a model — it might install packages, open network connections, or exploit kernel bugs. VM boundaries provide hardware-enforced isolation that containers cannot.


Architectural Approaches

MicroVMs (Firecracker, Cloud Hypervisor)

MicroVMs strip traditional VMs down to the essentials. Firecracker provides ~30 emulated devices (vs hundreds in QEMU), boots in ~125ms, and uses ~5MB of memory overhead per VM. Cloud Hypervisor takes a similar approach with broader hardware support (Intel, ARM, and experimental RISC-V).

Tradeoffs: Full Linux compatibility inside the VM. Hardware-enforced isolation. But you need to build your own orchestration — these are VMMs, not platforms.

Userspace Kernel (gVisor)

gVisor intercepts application syscalls and re-implements them in a userspace kernel called Sentry. It doesn't run a full VM — instead, it acts as a compatibility layer that limits the application's access to the host kernel.

Tradeoffs: Lower overhead than full VMs. Easy to deploy as an OCI runtime. But not all syscalls are implemented, so compatibility is less than 100%. Not a true VM boundary — a determined attacker with a gVisor exploit reaches the host kernel.

Unikernels (Unikraft)

Unikraft compiles only the OS components an application needs into a single bootable image. No shell, no unnecessary drivers, no multi-user support. The result is tiny images (sometimes less than 1MB) with minimal attack surface.

Tradeoffs: Extremely small footprint and fast boot. But building unikernel images requires specialized tooling, debugging is harder, and you lose general-purpose Linux compatibility.

Multi-Hypervisor Orchestration (Hypeman)

Hypeman takes a different approach — instead of being a VMM itself, it sits above multiple hypervisors (Firecracker, Cloud Hypervisor, QEMU, Apple Virtualization.framework) and provides a Docker-like CLI. You get VM isolation with hypeman pull and hypeman run.

Tradeoffs: Highest developer experience. But it's early (62 stars) and adds a layer of abstraction over the underlying VMMs.


Detailed Comparison

Performance

MetricFirecrackergVisorKataCloud HypervisorHypemanUnikraft
Boot time~125msN/A (process)~500ms~100msVaries by backend~1ms
Memory overhead~5MB~50MB~40MB~5MBVaries by backendless than 1MB
Density (per host)ThousandsHundredsHundredsThousandsHundredsThousands
Syscall compatFull Linux~70-80%Full LinuxFull LinuxFull LinuxApp-specific

Security Model

FeatureFirecrackergVisorKataCloud HypervisorHypemanUnikraft
Isolation typeHardware VMUserspace kernelHardware VMHardware VMHardware VMHardware VM
Kernel shared?NoPartiallyNoNoNoNo
seccompYes (jailer)Built-inYesYesDepends on backendN/A
Attack surfaceMinimal VMMSentry (~20K LoC)VMM + agentMinimal VMMBackend VMMMinimal unikernel

Developer Experience

FeatureFirecrackergVisorKataCloud HypervisorHypemanUnikraft
CLI UXREST APIrunsc (OCI)K8s runtime classREST APIDocker-likekraft CLI
K8s integrationDIYRuntimeClassNativeDIYNoKraftCloud
OCI imagesNo (rootfs)YesYesNo (rootfs)YesNo (unikernel)
SnapshottingYesNoNoYesYes (standby)No
macOS supportNoNoNoNoYes (Apple Vz)No

The AI Agent Angle

AI agent sandboxing is the fastest-growing use case for container-to-VM runtimes. The threat model is clear: LLMs generate code, agents execute it, and you have no idea what that code will do.

What agents need:

  • Fast boot — agents spin up and tear down environments constantly
  • Full Linux compat — agents install packages, run builds, use system tools
  • Network isolation — contain outbound connections from untrusted code
  • Snapshotting — save state for checkpointing and replay

Who's winning this use case:

  • Firecracker powers E2B's sandbox platform (200M+ sandboxes)
  • Hypeman powers Kernel's browser isolation for AI agents
  • gVisor powers Google Cloud Run and GKE Sandbox
  • Kata Containers used in multi-tenant Kubernetes clusters

The pattern emerging: higher-level platforms (E2B, Kernel, Sprites) build on lower-level runtimes (Firecracker, Cloud Hypervisor) and expose developer-friendly APIs. The VMM layer is becoming infrastructure — the value moves up the stack.


Choosing the Right Tool

You want maximum density at scale → Firecracker. It's battle-tested at AWS scale (Lambda, Fargate) and boots in ~125ms with ~5MB overhead.

You want Kubernetes-native VM isolation → Kata Containers. Drop-in OCI runtime that runs containers in VMs without changing your K8s workflow.

You want defense-in-depth without full VMs → gVisor. Lower overhead, easier deployment, but not a true hardware boundary.

You want Docker-like simplicity with VM isolationHypeman. Highest DX, multi-hypervisor, but early-stage.

You want minimal attack surface → Unikraft. Smallest images, fastest boot, but requires specialized build tooling.

You want a modern VMM to build on → Cloud Hypervisor. Clean Rust codebase, active Intel/ARM community.


See Also

  • Hypeman — Docker-like UX for running containers in VMs
  • AI Agent Sandboxes Compared — higher-level sandbox platforms built on these runtimes
  • E2B — ephemeral sandbox platform (uses Firecracker)

Research by Ry Walker Research