gVisor - Source Code
runsc/sandbox vs runsc/boot
runsc/sandbox is outside of sandbox, runsc/boot is inside the sandbox.
runsc/sandboxis outside the sandbox (Host-side): It is the management component that runs on the host. It is responsible for setting up the environment, creating the namespaces, and spawning the actual sandbox process. If you look atrunsc/sandbox/sandbox.go, it usesexec.Commandto launch the runsc boot process and then communicates with it over a Unix Domain Socket using RPCs (likeboot.ContMgrRootContainerStart).runsc/bootis inside the sandbox (Guest-side): It is the entry point for the Sentry process. Oncerunsc/sandboxspawns it, it runs inside the restricted environment (the sandbox). It initializes the guest kernel, sets up the virtualized network/filesystem, and starts executing the containerized application. ThecontainerManageracts as the RPC server inside this isolated environment, listening for commands from the host-side runsc/sandbox component.
Is runsc/boot still alive after the boot?
Yes, absolutely. The name "boot" is slightly misleading—it doesn't just bootstrap the environment and exit.
The runsc boot process becomes the Sentry (the guest kernel). It stays alive for the entire lifetime of the sandbox.
The controller.go file defines the containerManager and a urpc server. This RPC server runs continuously inside the sandbox. The host-side runsc process connects to this server over a Unix Domain Socket to control the sandbox dynamically. If the boot process died, the host would have no way to interact with the sandbox.