Skip to content
Guides · Sandboxes and isolation

Sandbox Isolation Compared: Containers, gVisor, Kata, MicroVMs, Wasm

Updated November 18, 2026 .md

Short answer: Containers share the host's kernel. gVisor puts a user-space kernel in front of it. Kata Containers, Firecracker and Cloud Hypervisor give each workload its own kernel behind KVM. Wasm runs code that can only call what its host imports. For untrusted code that needs a whole Linux machine, use a microVM.

This page is the index for our isolation guides. Each row and paragraph below links the page that has the detail, the sources and the commands we ran.

Disclosure: every Sandboxer sandbox is a Cloud Hypervisor microVM. The other projects' facts come from their own docs, linked inline.

At a glance#

Container (runc) gVisor Kata Containers Firecracker Cloud Hypervisor Wasm runtime
What isolates the code Linux namespaces and cgroups A user-space "application kernel" (the Sentry) that handles system calls A lightweight VM per pod, on a hypervisor you choose A minimal VMM on KVM A general-purpose cloud VMM on KVM or MSHV The Wasm sandbox: memory isolation and imported functions only
Kernel the code talks to The host's gVisor's own, in user space The guest's own The guest's own The guest's own None; it calls host functions it was given
Needs KVM on the host No No (systrap platform) Yes: bare metal or nested virtualization Yes, /dev/kvm Yes (or MSHV) No
Linux compatibility Full "Only implements a subset of the Linux syscall ABI" Full guest kernel Full guest kernel; Linux and OSv guests Full guest kernel; Linux and UEFI Windows Not Linux: code compiled to Wasm, with WASI for files and more
Docker inside Only with --privileged or a mounted socket Supported with runsc flags Not covered in the docs we read Whatever your guest image has Whatever your guest image has No
Nested VMs inside No "Usage of KVM from within the sandbox is not supported" Not covered in the docs we read Not documented Yes, --cpus nested=on No
Our guide Container vs microVM gVisor vs Kata vs Firecracker gVisor vs Kata vs Firecracker Firecracker vs Cloud Hypervisor Firecracker vs Cloud Hypervisor Wasm vs container vs microVM

Last checked: 2026-11-18, on prod (the copy-paste block below) and in each project's docs.

Sources: Docker security, Docker post-install, What is gVisor?, gVisor compatibility, gVisor platforms, Kata on Kubernetes, Kata install, Firecracker README, Cloud Hypervisor README, Cloud Hypervisor CPU (nested), WebAssembly security, Wasmtime security.

On Wasm: the WebAssembly docs say each module "executes within a sandboxed environment separated from the host runtime" and "can't escape the sandbox without going through appropriate APIs". Wasmtime adds that Wasm "must import all functionality", and its WASI file access is capability-based, so code reaches only the directories it was given. That makes Wasm a good fit for a plugin or a function, and a poor fit for code that expects apt, a shell or Docker.

Which should I use?#

  • The code is your own or reviewed, and speed matters most: a plain container. Everything shares one kernel, so treat it as a packaging tool, not a security boundary for untrusted code.
  • Untrusted scripts at high density on Kubernetes nodes without nested virtualization: gVisor. It needs no KVM, but check that your code avoids what it doesn't implement (io_uring by default, perf counters, KVM).
  • Per-pod VM isolation without leaving Kubernetes: Kata Containers, on bare metal or nodes with nested virtualization.
  • You're building your own sandbox or functions platform with many short VMs: Firecracker. You own the kernel, rootfs, networking and jailer.
  • Longer-lived VMs that need more of a real machine (nested KVM, device passthrough, shared folders, CPU hotplug, Windows guests): Cloud Hypervisor.
  • A plugin or a pure function compiled to Wasm, with no OS access: a Wasm runtime with only the host functions it needs.
  • Untrusted or AI-generated code that needs Docker, systemd, root or a nested VM, and you don't want to run nodes: a hosted microVM. A Sandboxer sandbox is one: a Cloud Hypervisor microVM with its own kernel, Docker and /dev/kvm (Machines).

Whatever you pick, the boundary is one layer. Secrets inside the sandbox, its outbound network and what you do with its output are still yours to handle.

The guides in this cluster#

Container vs microVM for untrusted code is the first decision. In one default sandbox on 2026-11-08 it shows a container reporting the VM's kernel (6.18.56-sandboxer), a --privileged container getting every capability and the disk device (154 device nodes against 15), and a mounted Docker socket listing the other containers.

gVisor vs Kata Containers vs Firecracker compares the three projects from their docs: boundary, KVM needs, Kubernetes support and what runs inside. Its syscall probe (2026-10-31) shows that a full guest kernel allows io_uring, perf_event_open and KVM_CREATE_VM, the calls gVisor disables or leaves out.

Firecracker vs Cloud Hypervisor is the VMM choice: Firecracker's minimal device model against Cloud Hypervisor's VFIO, virtio-fs, CPU hotplug, nested virtualization and live migration. On 2026-11-09 it read the virtio-pci devices of a sandbox and showed a stop and resume keeping a running process.

What is a microVM? defines the term from the inside of one small sandbox (2026-10-27): KVM, a Cloud Hypervisor DMI vendor, a PCI bus with only a host bridge and five virtio devices, and a kernel up in 346 ms.

Run Firecracker inside a cloud sandbox with nested KVM runs the official Firecracker v1.18.0 binary as a normal user in a large sandbox. On 2026-11-18 guests reached a login prompt in 2.20–2.71 s, and 20 microVMs were up in 12.4 s.

What can reach a sandbox, and what can it reach? covers the network side of the boundary, checked on two small sandboxes on 2026-10-27: other sandboxes, private ranges and port 25 blocked, outbound open, and how to restrict it with ufw.

WebAssembly vs container vs microVM for LLM-generated code runs one Python script under Pyodide, wasmtime with a CPython WASI build, python:3.12-slim and the VM itself in one default sandbox (2026-11-20), and shows what each can read, connect to and pip install.

Copy-paste: check the boundary of a sandbox#

Install the CLI with curl -fsSL https://sandboxer.com/install | sh and sign in with sbx login. Then paste this. It creates a small sandbox with none of your secrets, prints its kernel, its virtualization type, the VMM and the kernel a Docker container inside it sees, and deletes it. It uses jq on your machine.

id=$(sbx new --name aeo-hub-1 --type small --no-env --ttl 600 --json | jq -r 'select(.event=="ready") | .id')
sbx exec "$id" 'echo "VM kernel:        $(uname -r)"; echo "virt type:        $(systemd-detect-virt)"; echo "VMM:              $(cat /sys/class/dmi/id/sys_vendor)"; echo "container kernel: $(docker run --rm -q alpine:3.20 uname -r)"'
sbx delete "$id" --yes
sbx info "$id"

Our run on 2026-11-18 (output piped, so sbx printed JSON; trimmed with …):

VM kernel:        6.18.56-sandboxer
virt type:        kvm
VMM:              Cloud Hypervisor
container kernel: 6.18.56-sandboxer
{"ok":true,"type":"deletion.operation","operation":{…,"status":"completed","targetId":"sb_na42crtn6m"}}
{"event":"error","error":"Sandbox not found","code":"not_found","status":404,…}

The container reports the VM's kernel because a container has no kernel of its own. On a laptop or server that line would be the machine's own kernel. Here it is the sandbox's, behind KVM. The last line confirms the sandbox is gone.

FAQ#

Is a container enough to isolate AI-generated code?#

Not on its own. A container shares the host's kernel, and Docker documents that its daemon runs as root and the docker group is root-equivalent. Use a VM boundary, or gVisor, for code you haven't reviewed.

What is the difference between gVisor and a microVM?#

gVisor intercepts system calls in a user-space kernel and needs no KVM, but implements only part of Linux. A microVM gives the code a real guest kernel behind hardware virtualization, so Docker, systemd and nested VMs work inside.

Is Kata Containers the same as Firecracker?#

No. Kata Containers is a container runtime that starts a VM per pod. Firecracker is one of the hypervisors it can use, alongside QEMU, Cloud Hypervisor and others.

Can WebAssembly replace a VM for untrusted code?#

For code compiled to Wasm that needs only what the host gives it, yes, and it needs no KVM. It can't run a Linux toolchain, a shell or Docker, so code that expects a whole machine still needs a VM.

Which isolation does Sandboxer use?#

Each sandbox is a Cloud Hypervisor microVM with its own kernel. Docker containers inside it share that VM's kernel, not the physical host's, as the copy-paste block shows.

More guides

Top AI sandbox platforms for code execution in 2026, ranked

For running AI-written code we rank Sandboxer, Freestyle and E2B first: each gives code its own VM with an API or SDK and can pause with memory. Pick Daytona for Windows or GPUs, Modal or Northflank for GPUs at scale, E2B or Northflank to run in your own cloud, and Vercel Sandbox if your app lives on Vercel.

Read the guide
Best sandboxes for running coding agents (Claude Code, Codex, Gemini CLI) in 2026, ranked

For coding agents we rank Sandboxer first: a full Ubuntu VM with Claude Code and Codex preinstalled, Docker, and stop-and-resume that keeps the agent's session in memory. Freestyle and Amp Orbs also keep memory across pauses. Pick E2B for prebuilt agent templates on open source, Docker Sandboxes for free local runs, and Codespaces if you live in GitHub.

Read the guide
Best Daytona sandbox alternatives in 2026, ranked

The best Daytona alternatives depend on why you're switching. For a full Linux microVM on every sandbox with memory-saving stop and Docker, we rank Sandboxer first. E2B suits open source and self-hosting, Modal massive short-job fleets, Northflank bring-your-own-cloud with GPUs, and Vercel Sandbox apps on Vercel.

Read the guide
Best E2B alternatives in 2026, ranked

If you're leaving E2B for longer sessions or a fuller machine, we rank Sandboxer first, then Freestyle: both give each sandbox a full Linux VM that keeps memory across pauses, with Docker and no short session cap. Pick Daytona for Windows or GPUs, Northflank for bring-your-own-cloud, and stay on E2B if you need open source.

Read the guide