ConfigsApr 15, 2026·3 min read

gVisor — Container Sandbox with User-Space Kernel

gVisor is Google's application kernel that intercepts container syscalls in user space, giving you VM-like isolation for untrusted workloads without the overhead of full virtualization.

TL;DR
gVisor intercepts container syscalls in user space, giving VM-like isolation without full virtualization overhead.
§01

What it is

gVisor is an application kernel developed by Google that runs in user space and intercepts container system calls. It provides a security boundary between the container and the host kernel, offering isolation comparable to virtual machines without the resource overhead of full virtualization.

gVisor targets security-conscious teams running untrusted or multi-tenant workloads in containers. It is the runtime behind Google Cloud Run and GKE Sandbox, providing defense-in-depth for containerized applications.

The project is actively maintained and suitable for both individual developers and teams looking to integrate it into their existing toolchain. Documentation and community support are available for onboarding.

§02

How it saves time or tokens

gVisor eliminates the need to run full VMs for workload isolation. Containers start in milliseconds (not seconds like VMs) while still getting a strong security boundary. This means you can safely run user-submitted code, CI/CD jobs, or third-party containers without dedicating VM-level resources to each workload.

For teams evaluating multiple tools in the same category, the clear documentation and active community reduce the time spent on research and troubleshooting. Getting started takes minutes rather than hours of configuration.

§03

How to use

  1. Install gVisor's runsc runtime on your host system.
  2. Configure Docker or containerd to use runsc as the container runtime.
  3. Run containers with the --runtime=runsc flag (Docker) or the runsc handler (containerd).
  4. Verify isolation by checking that container processes use gVisor's Sentry kernel instead of the host kernel.
§04

Example

# Install gVisor on Debian/Ubuntu
curl -fsSL https://gvisor.dev/archive.key | sudo gpg --dearmor -o /usr/share/keyrings/gvisor-archive-keyring.gpg
echo 'deb [signed-by=/usr/share/keyrings/gvisor-archive-keyring.gpg] https://storage.googleapis.com/gvisor/releases release main' | \
  sudo tee /etc/apt/sources.list.d/gvisor.list
sudo apt update && sudo apt install runsc

# Configure Docker to use gVisor
sudo runsc install
sudo systemctl restart docker

# Run a container with gVisor isolation
docker run --runtime=runsc -it ubuntu:22.04 bash
§05

Related on TokRepo

§06

Common pitfalls

  • Not all system calls are implemented in gVisor. Some applications that make exotic syscalls may fail. Check the compatibility documentation before deploying.
  • Performance-sensitive workloads (high I/O, networking) may see degradation due to syscall interception. Benchmark your specific workload before committing to gVisor in production.
  • gVisor does not replace network policies or RBAC. It adds a kernel-level isolation layer but does not protect against application-level vulnerabilities.
  • Not reading the changelog before upgrading. Breaking changes between versions can cause unexpected failures in production. Pin your version and review release notes.

Frequently Asked Questions

How does gVisor differ from traditional containers?+

Traditional containers share the host kernel directly. gVisor interposes a user-space kernel (Sentry) that handles syscalls, so container processes never interact with the host kernel directly. This reduces the attack surface significantly.

Does gVisor work with Kubernetes?+

Yes. GKE Sandbox uses gVisor natively. For self-managed clusters, you configure containerd to use the runsc handler and set a RuntimeClass in your pod specs.

What is the performance overhead of gVisor?+

Syscall-heavy workloads may see 10-30% overhead. Compute-heavy workloads (CPU-bound processing) see minimal impact because computation runs natively. I/O-heavy workloads show the most overhead due to syscall interception.

Can gVisor run GPU workloads?+

GPU support in gVisor is limited and experimental. Most GPU passthrough configurations bypass the gVisor kernel, which reduces the isolation benefit. Check the latest gVisor documentation for GPU compatibility status.

Is gVisor used in production?+

Yes. Google uses gVisor in production for Google Cloud Run, GKE Sandbox, and internal workloads. It handles billions of containers at Google-scale deployments.

Citations (3)

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets