Malhar Ujawane

Notes

Note·

TIL: bwrap --disable-userns fails with 'No space left on device'

Inside a bubblewrap sandbox started with --disable-userns, unshare fails with ENOSPC, 'No space left on device'. That error means the block works.

Cohere’s Qwen3.8 report shows a model using unshare -Urm to make itself root in a private namespace and mount a RAM disk. I wanted to see that on a plain Linux box (Debian 13, Linux 6.12, util-linux 2.41.5, bubblewrap 0.12.0), as an ordinary user:

$ id -u
1000
$ unshare -Urm --propagation private sh -c 'mount -t tmpfs -o exec tmpfs /mnt 2>&1 && echo MOUNT_OK; id -u'
MOUNT_OK
0

It works, no sudo needed. Then the same command inside bubblewrap with –disable-userns:

$ bwrap --ro-bind / / --dev /dev --proc /proc --tmpfs /tmp \
    --unshare-user --disable-userns \
    unshare -Urm --propagation private sh -c 'mount -t tmpfs -o exec tmpfs /mnt && echo MOUNT_OK'
unshare: unshare failed: No space left on device

The disk isn’t full. The bwrap docs explain that –disable-userns works by “setting the user.max_user_namespaces sysctl to 1, and then entering a nested user namespace which is unable to raise that limit in the outer namespace.” Creating one more user namespace goes over that limit, and unshare(2) reports that as ENOSPC, whose standard message is “No space left on device”.

So if an agent’s logs show that error right after an unshare, the sandbox is doing its job. –disable-userns also requires –unshare-user. I used this in a two-layer sandbox for agent shell tools.

Get new posts in your inbox

© 2026 Malhar Ujawane. Built with Astro.