Back to blog posts

12 min

How Kata Containers uses lightweight VMs to isolate containers

Learn how Kata Containers isolates each Kubernetes pod in a lightweight VM.

Nicolas LecomteNico is a founder of Blaxel, who usually writes about AI, agentics, and the future of AI runtimes.

Teams running untrusted code or multi-tenant pods must decide what stands between each workload and the host kernel. With runc, every container shares that kernel, so one exploitable bug can expose the whole node.

Kata Containers is an OCI-compatible runtime that puts each pod in its own lightweight VM with a separate guest kernel. Existing images run unchanged, and Kubernetes still schedules ordinary pods.

For code an AI agent writes and executes, that runtime choice is a security decision first.

Key takeaways

  • Each Kata pod boots its own guest kernel inside a lightweight VM, away from the host kernel.
  • Escaping a Kata pod usually requires a guest-kernel bug plus a hypervisor bug.
  • A RuntimeClass selects Kata per pod, so runc and Kata pods share one cluster.
  • Each pod carries a guest kernel, an agent, and a virtual machine monitor (VMM). Together, they add memory and startup time.
  • Choose Kata for multi-tenant clusters and CI runners on KVM-capable nodes. Kata also fits untrusted code on those nodes.

What is Kata Containers?

Kata Containers is an open-source container runtime that runs each container or pod inside its own lightweight virtual machine (VM) with a dedicated guest kernel. Kata Containers launched in December 2017 as a merger of Intel Clear Containers and Hyper.sh runV.

Intel says Clear Containers focused on boot speed and security. runV focused on supporting many CPU architectures and hypervisors.

The OpenStack Foundation backed Kata as a pilot, and in April 2019 it became the first pilot to graduate. Today, the OpenInfra Foundation, now part of the Linux Foundation, provides administrative support. Contributors elect a seven-member Architecture Committee that sets technical direction, with at most two seats per organization.

Kata's default runtime changed in 2026:

  • Runtime-rs, a Rust rewrite of the runtime, became the default in the 4.0 release. Kata 4.0 shipped in July 2026.
  • The Go runtime remains available but deprecated, with removal forecast no sooner than 5.0.0.
  • Runtime-rs includes Dragonball, a VMM from Ant Group and Alibaba that runs inside the shim process.
  • The latest release is Kata 4.4.0, published November 17, 2026.

Kata is also the base for Confidential Containers. The Cloud Native Computing Foundation (CNCF) accepted Confidential Containers as an incubating project in July 2026. Its docs list attestation on Intel Trust Domain Extensions (TDX), AMD SEV-SNP, and IBM Secure Execution. In that mode, the host is untrusted, and the CPU encrypts guest memory.

Check the runtime behind each RuntimeClass. Runtime-rs classes get new features, and Go-runtime classes get only fixes.

How Kata Containers differs from runc

runc runs each container as an ordinary host process. Kernel namespaces and cgroups keep it apart from its neighbors, but every container calls into the same host kernel. One exploitable kernel bug therefore exposes the whole node, and that is how a container escape becomes a host compromise.

Kata keeps the OCI interface but moves the workload into a guest with its own kernel. To touch the host, code in that guest usually has to exploit the guest kernel and then the hypervisor. For agent workloads, the microVM vs Docker comparison weighs that boundary against container startup speed.

Any pod that runs code your team didn't write is a candidate for that guest-kernel boundary.

Kata Containers vs gVisor vs Firecracker vs runc

Each runtime places a different boundary between workload and host. Figures come from each project's or provider's docs as of November 2026.

The Kata and gVisor startup and memory cells use GKE Sandbox figures:

RuntimeIsolation boundarySyscall compatibilityStartupMemory overheadKubernetes fitHardware needs
KataGuest kernel behind KVM hypervisorFull Linux guest kernel1 to 2 s on GKE's microVM class130 MiB fixed per pod on GKERuntimeClass via containerd or CRI-OKVM: bare metal or nested
gVisorUser-space Sentry kernel, host seccomp292 of 352 amd64 syscalls full or partialUnder 100 ms on GKE SandboxDynamic, Sentry and Gofer processesrunsc RuntimeClass, GKE SandboxNone with Systrap
Firecracker (direct)Guest kernel in a minimal VMMFull guest kernelFirecracker spec: ≤125 ms to guest init≤5 MiB VMM for 1 vCPU, 128 MiB VMNeeds your own orchestrationKVM
runcShared host kernelNative host kernelHost process startNo sandbox layerDefault runtimeNone

gVisor sacrifices some syscall speed to place a user-space kernel between the workload and the host. The gVisor vs Firecracker analysis measures that cost. Teams that would rather not run a VMM fleet can compare managed services in the microVM platform roundup.

When to choose Kata Containers

Pick Kata when untrusted or tenant-supplied code shares nodes. Huawei uses it in CCE Turbo so customers can host their own SaaS. IBM Cloud said in October 2025 that its Kata-based CI/CD grew 30 to 40 times in five years.

That CI/CD platform peaks above 10,000 vCPUs across about 400 nodes. Microsoft's AKS Pod Sandboxing runs on Kata and Cloud Hypervisor, as does GKE's microVM class.

For first-party code that passed your own review, runc is enough. Semi-trusted code and hosts without KVM suit gVisor, if the workload is light on syscalls and file operations.

AI-generated code belongs in the same untrusted category as tenant uploads. Agent code belongs behind a separate guest kernel, from Kata or Firecracker. A coding agent running pip install and test suites all day performs constant file operations.

Each one adds a small fixed overhead under gVisor, per its performance guide.

How Kata Containers works

A Kata pod has four parts: a host-side shim, a VMM, a guest kernel, and an in-guest agent.

Runtime, shim v2, and kata-agent

The host-side Kata runtime is the containerd-shim-kata-v2 binary, a containerd shim v2 implementation. The Kata architecture docs describe one shim instance serving an entire pod, regardless of how many containers it holds.

The shim starts the hypervisor and its VM. Inside the guest, kata-agent, written in Rust, supervises the containers. Only one agent runs per VM.

Shim and agent talk over ttRPC, the protocol that replaced gRPC in Kata 2.0. The ttRPC channel runs over a vsock socket between host and guest. The socket carries container management commands plus the stdin, stdout, and stderr streams.

Kata 1.x ran more host processes: a kata-shim per container, plus a kata-proxy when vsock was missing. The 2.0.0 release in October 2020 dropped both to reduce attack surface. In 4.0 built-in mode, the shim calls Dragonball as a library.

Each pod then appears on the node as a single shim process.

Host Guest VM
containerd / CRI-O guest kernel
└─ containerd-shim-kata-v2 <== ttRPC/vsock ==> kata-agent
└─ VMM: Dragonball (built-in) └─ containers
or QEMU / Cloud Hypervisor / Firecracker

Hypervisor options

As of November 2026, Kata's main-branch hypervisors doc names five VMMs: Cloud Hypervisor, Dragonball, Firecracker, QEMU, and StratoVirt.

The doc marks only QEMU for GPU support, Intel TDX, and AMD SEV-SNP. Confidential and GPU runtime classes therefore use QEMU. The 4.0 overview pairs runtime-rs with QEMU, Cloud Hypervisor, and Dragonball. Firecracker ships as the Go-runtime kata-fc class.

Kata's virtualization design doc rates startup latency as Good for QEMU and Excellent for Cloud Hypervisor and Firecracker. Dragonball gets Best. The doc gives no numbers behind those ratings. Under Kata, Firecracker has no filesystem sharing, device hotplug, or Virtual Function I/O (VFIO) passthrough. CPU and memory hotplug are missing too.

Without virtio-fs, Firecracker under Kata uses block storage only. Block storage needs the containerd devmapper snapshotter and a thin-pool on each node. Kata's Firecracker how-to notes that kata-deploy can't create that thin-pool for you.

The Firecracker explainer covers running Firecracker directly, outside Kata.

Storage and networking inside the VM

Kata shares the container rootfs, volumes, Secrets, and ConfigMaps into the guest with virtio-fs. Virtio-fs replaced 9pfs as the default in release 2.0, according to the virtio-fs how-to. Kata maintainers recommend block-based volumes in that guide, attached through device passthrough or virtio-blk.

Block volumes avoid a shared filesystem between host and guest. A cache-size setting controls Direct Access (DAX), which maps file contents into guest memory. The runtime build default sets that cache to 0 MiB.

With QEMU, virtio-fs backs guest memory with a file on /dev/shm. The tmpfs defaults to half of physical memory, which caps total Kata guest memory at 50% of node RAM.

Traffic Control (TC) filter is the default network mode, per Kata's networking design. TC filter redirects traffic from the Container Network Interface (CNI) device to a tap device attached to the VM. Kata still supports Media Access Control virtual TAP (MACVTAP) and has deprecated bridge mode.

How to run Kata Containers in Kubernetes

The project recommends the kata-deploy Helm chart for Kata Containers on Kubernetes. Per the Helm install docs, the chart installs Kata on each node, configures containerd or CRI-O, and creates RuntimeClasses.

The chart needs Kubernetes 1.22 or later and nodes that allow kernel module loading.

Shell
CHART="oci://ghcr.io/kata-containers/kata-deploy-charts/kata-deploy"
VERSION="<latest Kata release tag>"
helm install kata-deploy "${CHART}" --version "${VERSION}"

The default chart installs QEMU, Cloud Hypervisor, Dragonball, and Azure classes. Examples include kata-qemu-runtime-rs, kata-clh, and kata-dragonball. kata-fc comes from the separate try-kata-fc.values.yaml profile.

The general-purpose starting point is kata-qemu-runtime-rs, per Kata's RuntimeClass guide. Pod overhead, a fixed CPU and memory reservation per pod, is on by default. The 4.4.0 chart template sets 320Mi of memory and 250m of CPU for this class.

The template also pins the class to Kata nodes:

YAML
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: kata-qemu-runtime-rs
handler: kata-qemu-runtime-rs
overhead:
podFixed:
memory: "320Mi"
cpu: "250m"
scheduling:
nodeSelector:
katacontainers.io/kata-runtime: "true"
kata-deploy.katacontainers.io/default: "true"

A pod opts in with one field. Pods without runtimeClassName keep running on runc on the same nodes.

YAML
apiVersion: v1
kind: Pod
metadata:
name: untrusted-code
spec:
runtimeClassName: kata-qemu-runtime-rs
containers:
- name: app
image: python:3.12-slim

RuntimeClasses are cluster-wide and ignore node architecture, as the Helm configuration doc notes. The chart still creates amd64-only classes such as kata-clh on mixed clusters.

For manual setups, containerd uses runtime_type = "io.containerd.kata.v2". For CRI-O, Kata's CRI-O how-to sets the vm runtime type:

Toml
[crio.runtime.runtimes.kata]
runtime_path = "/usr/bin/containerd-shim-kata-v2"
runtime_type = "vm"
runtime_root = "/run/vc"
privileged_without_host_devices = true

After installation, run kubectl get runtimeclasses and schedule one test pod per class you plan to use.

Performance overhead and density

No single benchmark covers every VMM, so read each figure inside its own setup:

  • Bare-metal startup: The Edera Goldilocks Isolation paper, revised April 2026, measured 1,913 ms of startup for Kata with Dragonball. Docker on KVM took 571.6 ms. The paper averaged five runs with cached images.
  • Nested startup and memory: ComputingForGeeks tested Kata 4.3.1 with QEMU in October 2026, nested on Proxmox. Pod startup took 4.60 s against 0.61 s for runc. Idle memory was 179.9 MiB against 5.3 MiB.
  • Network throughput: The same test served 1,966 nginx requests per second under Kata and 41,762 under runc. The author treats nested numbers as a ranking only.
  • VMM footprint: Hyperflux (August 2026) measured resident set size (RSS) for a Hello World workload. Dragonball used 170.3 MB, and QEMU used 337.7 MB.
  • Density: An AWS sample test published in March 2026 placed 210 Kata pods on c6i.metal. Each pod requested 1 GiB plus 160 MiB of overhead.

Kata's VM templating saved 9 GB across 100 containers with 128 MB guests. The same doc warns that templating opens cross-VM side channels such as CVE-2015-2877. Benchmark on your own nodes, comparing pod startup time, idle memory per pod, and p99 latency against runc.

Limitations of Kata Containers

Kata's costs show up in hardware, features, privileged access, and patching:

  • Hardware virtualization: Kata needs bare metal or nested virtualization, per its installation guide. KVM hosts need a usable /dev/kvm and the vhost_vsock module.
  • Feature gaps: Host networking, subPath mounts, Podman, and checkpoint or restore are unsupported, per the limitations doc.
  • Privileged pods: A privileged container tries to expose every host device by default. Setting privileged_without_host_devices stops that, per the privileged guide. The kata-deploy chart sets it, but manual containerd and CRI-O setups must add it.
  • Patch cadence: Under the project's security policy, Kata maintainers ship security fixes only for the current monthly release. Operators therefore need to track current releases.

The VM boundary narrows the attack surface without closing it. Kata's threat model names KVM and QEMU flaws as a threat class. Kata's own code has had guest-to-host escape bugs. The 3.31.0 fix closed CVE-2026-47243, which let guest root reach host root through runtime-rs virtio-fs.

Dragonball received guest-to-host advisories in July and October 2026. Host-mounted volumes extend the host into the guest.

Kata doesn't filter outbound traffic. Kata's quick-start guide adds that multi-tenancy also depends on network, storage, and control-plane isolation. Outbound traffic therefore needs its own control, such as an egress allowlist per workload.

Explore managed microVM isolation for agent code

A self-managed Kata deployment leaves your team with KVM-capable nodes, VMM selection, regular upgrades, and density tuning. Baseten Sandboxes offer the VM boundary as a managed API instead. Every Baseten Sandbox gets a dedicated Firecracker microVM, with a guest kernel no other sandbox shares. Kata isn't part of that stack.

A sandbox starts from an API call in under a second. After roughly 15 seconds of network inactivity, it enters standby, then resumes in under 25ms. For security reviews, Baseten Sandboxes hold SOC 2 Type II, HIPAA, and ISO 27001 compliance.

A microVM limits what code can reach on the host. It does nothing about data a permitted process chooses to send. Outbound traffic gets domain filtering and proxy secrets injection, both in public preview and not yet recommended for production.

FAQs about Kata Containers

Is Kata Containers more secure than gVisor?

Each one stops an attacker at a different layer. Kata runs a full guest kernel behind a hardware hypervisor. In gVisor, a user-space Sentry kernel answers syscalls, and host seccomp filters restrict the Sentry. Neither boundary is absolute, and Kata and its VMMs have shipped escape fixes. For hostile multi-tenant code, the hardware boundary exposes less of the host kernel.

Does Kata Containers work with Docker?

Yes. Docker has supported Kata since version 22.06, through docker run --runtime io.containerd.kata.v2. The install guide asks for Docker v26 or later, and upstream tests Docker only with QEMU. A February 2026 issue in Docker's upstream Moby project reported loopback-only networking for Kata on Docker 28 and later. Kata's docs recommend containerd and its nerdctl tool instead.

Can Kata Containers run on cloud VMs?

It can, as long as the instance exposes hardware virtualization extensions. Compute Engine supports nested virtualization with KVM only. Google warns that CPU-bound workloads might experience a 10% or greater performance decrease. On AWS, recent Intel instance families support nested virtualization, and bare-metal instances expose VT-x directly. GKE's microVM sandbox type became generally available on October 7, 2026. EKS Nitro Sandboxes use Firecracker microVMs rather than Kata.

Does Kata Containers use Firecracker?

Yes. Firecracker is one of five Kata VMMs, offered through the kata-fc RuntimeClass on the Go runtime. The hypervisor options section covers its feature gaps and storage requirements. The chart's general-purpose starting class, kata-qemu-runtime-rs, uses QEMU.

Related articles