Skip to main content
This page covers running axed inside a gVisor sandbox: how to start it, what changes without cgroups, and what happens across runsc checkpoint and runsc restore. It was tested on gVisor’s systrap platform, which needs no KVM.

Run axed under runsc

axed runs under runsc like any other container entrypoint. If your container runtime is configured with runsc as a runtime (for example Docker’s --runtime=runsc, or a Kubernetes RuntimeClass), run the AXE image as you would under runc, and clients reach axed over TCP the same way. See Containers and hosts for the options that apply to any container. To drive runsc directly with an OCI bundle, which is how checkpoint and restore were tested:
  1. Create a bundle directory, for example /bundle, with the root filesystem in /bundle/rootfs. It needs the axed and axectl binaries in /usr/local/bin (see Installation), and the programs you will run. axed creates its workspace (/ws below) at startup if it does not exist. An exported debian:bookworm-slim filesystem works as the base.
  2. In the bundle directory, generate config.json with axed as the entrypoint:
  3. Edit config.json: set "terminal": false, since axed runs detached, and set "readonly": false on the root so the workspace is writable.
  4. Start the sandbox detached. The tested setup passed --platform=systrap --network=none --ignore-cgroups to every runsc command, including the ones below.
With --network=none, nothing outside the sandbox can reach axed’s ports, so run axectl inside the sandbox:
To reach axed from outside, give the sandbox a network the way your runtime normally does, and keep axed listening on an address clients can reach (the default --listen-host 0.0.0.0).

No delegated cgroups

gVisor offers no delegated cgroup hierarchy, so axed runs without cgroups. With the default --cgroups auto it logs cgroups unavailable; using process groups and rlimits and continues. --cgroups off skips the attempt. Do not use --cgroups required, because axed then refuses to start. Without cgroups:
  • Killing a process kills its process group and every descendant axed can find through /proc.
  • Memory limits map to RLIMIT_AS, which applies to each process separately. Task limits map to RLIMIT_NPROC, which counts every process of the user. Neither limits a process tree as a whole.
  • CPU limits and System.Freeze are refused.
Let gVisor and the container runtime enforce sandbox-wide CPU and memory limits. See Containers and hosts for the cgroup modes.

Checkpoint and restore

runsc checkpoint freezes the whole sandbox to an image, and runsc restore brings it back. axed needs no hooks for this:
After restore:
  • Detached processes are still running, and their output replays intact from offset 0.
  • The process table and its instance_id survive, because they are in memory.
  • axed records the resume, and axectl info shows generation 1. gVisor hides suspended time from CLOCK_MONOTONIC but not from CLOCK_BOOTTIME, and axed detects that gap.
  • Timeouts count running time only. A process with a 20-second timeout, frozen for 15 seconds, times out after about 20 seconds of running time, not 5.
Client connections end at checkpoint. Clients reconnect after restore and continue from the last offset they saw. See Snapshots for how detection works.

What was tested

Under runsc on the systrap platform:
  • The engine’s own test binaries run unchanged.
  • axed end to end: detach and offset replay, PTYs, running-time timeouts, uploads, directory watching, path confinement and tree kill.
  • Checkpoint and restore with axed as PID 1, a detached process with a 20-second timeout, and the sandbox frozen for 15 seconds, with each result listed above.