blitz.cloudPricingSign inPut your app onlineStart

Running strangers' containers in gVisor. Six things that broke

Every app on our platform runs in a gVisor sandbox. Nix builds, Jellyfin, dpkg, build speed, process spawning and a database port all broke on it. What each failure looked like and what we changed.

·

When you host containers for people you don't know, a container is not a security boundary. Anyone can sign up and run anything, and Linux containers share the kernel of the server they run on. So from the start, every app on our platform has run under gVisor, Google's sandbox that puts its own user-space kernel between the app and the real one.

I still think that was the right call. It's also why root inside a container is fine for us: root inside the sandbox is not root on the server. But gVisor is not Linux, and some software notices. Here are the six things that broke for us, roughly in the order we found them.

1. Nix can't build without a terminal

On our first open day in September, 12 of 12 builds failed. Half of the apps that failed that day were images that expected to run as root, which we didn't allow yet. Another part was our first build path for projects without a Dockerfile: Nixpacks, which builds with nix.

Every Nixpacks build died right at the first local derivation, after all downloads had finished:

while waiting for the build environment ... reading a line: Input/output error

nix's builder child wants a pseudo-terminal, and the sandbox didn't give it one. We reproduced it in 40 seconds with a throwaway pod running the Nixpacks image under the gVisor runtime class and a one-line nix-build. Setting sandbox = false, filter-syscalls = false or an empty build-users-group changed nothing. 8 of 8 Nixpacks builds we had ever run had failed.

We stopped using Nixpacks the same day. For a while a build without a Dockerfile simply asked for one. Today it gets one written for it, from a standard recipe for common stacks or by a model.

The lesson I took: don't tweak settings for hours when the tool fundamentally needs something the sandbox doesn't have. Find out what it needs, check whether gVisor has it, and move on if it doesn't.

No Jellyfin install on our platform ever worked until 26 September. It stopped at startup with:

NetworkInformationException (95): Operation not supported

.NET watches for network changes through a netlink socket bound to the link, address and route multicast groups. gVisor supports only the link group. The bind fails, and Jellyfin gives up.

The worse part: Jellyfin then keeps serving its own startup page for ten minutes. Our store check only asked whether the port answered, so Jellyfin passed it. A port-only health check calls a dead app "online".

We didn't want to maintain a patched image. Jellyfin only subscribes while its DetectNetworkChange setting is true, and it reads startup settings from environment variables with a JELLYFIN_ prefix. A container's addresses never change while it runs, so turning the watch off costs nothing. Our reconciler now sets this on any Jellyfin image, unless the owner set it themselves:

JELLYFIN_DetectNetworkChange=false

With that, Jellyfin was healthy after 1:37. If you run another .NET app and hit error 95, look for a setting that skips the network change subscription first.

Some builds failed inside apt-get with this:

unable to make backup link ... No such device

16 builds across 4 apps, and none of those apps had ever built successfully. Upgrading libc6, or installing nginx on Debian trixie, triggered it.

The cause was a stack of two things. Rootless BuildKit can't mount a kernel overlay inside gVisor, so it stacks image layers with fuse-overlayfs instead. dpkg hard-links a file from a lower layer as a backup before replacing it, and under gVisor that hard link across fuse-overlayfs fails. A link between plain files works fine.

So an app that hits the error gets plain layers from then on (--oci-worker-snapshotter=native). Plain layers cost disk and time on every step, which is why only apps that met the error get them. If it still fails with plain layers, the build tells you to start from a newer base image.

4. Builds were eight times slower

This one isn't a bug, just the price. A test recipe took 159 to 190 seconds to build under gVisor and 20 seconds under plain runc, on the same idle build server. Most of the difference was downloads and the image export.

We first suspected gVisor's network stack, because small requests took about 240 ms against 110 ms under runc. Switching the build pod to host networking changed nothing. The cost was the sandbox's own syscall and page fault overhead on these virtual machines. gVisor's KVM platform would help, but our build servers have no /dev/kvm.

On 3 October we moved builds off gVisor. Build pods now run under runc with seccomp and AppArmor profiles we wrote ourselves. We started from containerd's default seccomp profile and added one rule at a time until the test recipe built. Upstream BuildKit's Kubernetes example just sets both to Unconfined, which we didn't want. The probe on both build servers came out at 20 to 23 seconds against 159, and the hostile RUN lines we tried behaved the same in both sandboxes.

The trade is real. A build step's syscalls now reach the server's kernel, filtered, instead of gVisor's. We accept it because build servers run nothing but builds, and every app that actually runs stays on gVisor.

5. posix_spawn and EINVAL

While builds still ran under gVisor, a pnpm monorepo failed when one tool started another:

Failed to spawn process: underlying os error: Invalid argument (os error 22)

Node reports the same thing as spawn <cmd> EINVAL. gVisor refused the vfork-style clone a large parent process makes when it starts a child. It's deterministic, so retrying is pointless. The build now says plainly that this is our sandbox's limit and not the project's fault, and the runc build sandbox from point 4 is the actual fix.

6. A port that never comes back

This was the nastiest, because it looked like the database's fault.

A database crashed once, restarted, and then failed to start forever with Address already in use on its own port. We watched one pod go through 174 restarts.

A container restart inside a pod keeps the pod's gVisor sandbox and its network stack. Older gVisor releases kept the port of a closed socket bound to 0.0.0.0 reserved inside that stack after the process closed it. So the restarted database could never bind its port again, and only deleting the pod, which makes a new sandbox, cleared it. The upstream bug is google/gvisor#16102, fixed in November and first released in 20261109.0.

We bumped our pinned gVisor version. We also taught the database reconciler to recognise the pattern: a single-container pod that was Ready once in its current sandbox, stopped being Ready, and now logs a bind failure on its own port gets deleted, so it starts with a fresh sandbox. When any of those conditions doesn't hold, it does nothing, because then something else might really hold the port.

One nice surprise

Ports below 1024 bind fine as a non-root user under gVisor. We tested nginx on port 80 as uid 1000 with every capability dropped, and it just worked. gVisor doesn't even have the ip_unprivileged_port_start file. I had expected the opposite.

Would I pick gVisor again?

Yes. For a platform where anyone can sign up and run any image, the second kernel is the fence I trust most. blitz.cloud runs every app in its own sandbox and I don't see that changing.

What I'd do differently is test earlier. Before opening, take the 30 most popular images people will try and run them under the sandbox with a check that asks the app itself whether it's healthy, not just whether the port answers. Most of the failures above would have shown up in an afternoon. Instead, our first users found them.

If you deploy a Docker image with us, the docs on deploying an image explain what the sandbox means for root and ports.

Put your first app online today.

Start on the free plan, no credit card. Move to Pro when an app has to stay online.

Put your app online