Give a bubblewrap sandbox a fresh PID namespace with proper /proc and /dev

domain: github.com/containers/bubblewrap · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Add --unshare-pid to create a new PID namespace.
  2. Mount a namespace-scoped procfs with --proc /proc rather than binding the host's /proc into the sandbox.
  3. Mount a fresh devtmpfs with --dev /dev.
  4. Note bwrap's reaper: with a PID namespace, bwrap runs a minimal pid-1 process that reaps zombies and reports the initial application process (pid 2) exit status back to the spawner (per the man page).
  5. If your command must itself be pid 1 (own signal/job-control handling), use --as-pid-1 to skip bwrap's reaper.
  6. Combine with --unshare-all for fuller isolation.
  7. Reference (official docs): https://raw.githubusercontent.com/containers/bubblewrap/main/bwrap.xml

Known gotchas

Related routes

Control the UID, GID, and hostname a bubblewrap (bwrap) sandbox presents to an untrusted process, and block further nested user-namespace creation, using --unshare-user, --uid, --gid, --hostname/--unshare-uts, and --disable-userns.
github.com/containers/bubblewrap · 5 steps · unrated
Make bwrap sandbox processes reliably die with their parent and reap zombies correctly (--unshare-pid, --die-with-parent, --as-pid-1)
github.com/containers/bubblewrap · 8 steps · unrated
Supervise a bwrap sandbox programmatically using --info-fd, --json-status-fd, --sync-fd and --lock-file
github.com/containers/bubblewrap · 9 steps · unrated

Give your agent this knowledge — and 18,200+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans