talira

Application Kernel for Containers

open sourceApache-2.0self-hostablefree

gVisor is an application kernel written in Go that runs in user space between a container and the host: its Sentry implements the Linux system call interface itself instead of passing calls to the host kernel, and a separate Gofer process handles file system access, so a kernel bug the application can reach is far less likely to become a container escape. It ships runsc, an OCI runtime with a containerd shim, so Docker and Kubernetes can run sandboxed containers with existing images. System calls are intercepted by the systrap platform (the default, which works inside VMs) or KVM (best on bare metal), and NVIDIA GPUs and TPUs can be used from the sandbox. Google created it; it's now a CNCF sandbox project under Apache-2.0.

Problems it solves

  • run untrusted or customer-supplied code in containers without exposing the host kernel
  • a single kernel vulnerability shouldn't let a container escape to the host
  • sandbox containers in Kubernetes without running a full VM per pod
  • isolate multi-tenant workloads on shared nodes with something stronger than seccomp
  • run sandboxed Docker containers with our existing images
  • a container sandbox that works inside cloud VMs without nested virtualization
  • run AI agent generated code in an isolated sandbox on Linux
  • give an untrusted ML workload access to an NVIDIA GPU while keeping it sandboxed
  • reduce the host kernel attack surface our containers can reach
  • a userspace TCP/IP network stack we can import into a Go program
  • choose a stronger isolation runtime for some pods while the rest use the normal one
  • low overhead isolation for containers with fast startup, unlike traditional VMs

Features

  • Sentry: a Linux-compatible application kernel in user space that handles system calls, signals, memory and threads
  • Gofer: a separate host process for file system access, while the Sentry runs under a restrictive seccomp filter
  • runsc OCI runtime and containerd-shim-runsc-v1 for Docker, containerd and Kubernetes
  • systrap platform (the default, works inside VMs) and KVM platform (best on bare metal)
  • NVIDIA GPU and TPU devices usable from the sandbox
  • user-space network stack (netstack), importable as Go packages from the go branch
  • apt repository and release tarballs, with HEAD, nightly and dated release channels
  • x86_64 and ARM64 hosts
  • written in Go, a memory-safe language

Limitations

  • Doesn't implement every Linux system call or /proc and /sys file: some applications don't run in the sandbox12
  • Slower for system-call-heavy workloads: each system call costs more than in an ordinary container1
  • Doesn't run on macOS or Windows hosts: it needs Linux 5.6 or later on x86_64 or ARM6434

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what gVisor does.

  1. Kata Containers The speed of containers, the security of VMs
  2. Firecracker Secure and fast microVMs for serverless computing
  3. runc CLI tool for spawning and running containers according to the OCI specification
  4. CRI-O Lightweight Container Runtime for Kubernetes

Compare gVisor with the top 3