Skip to main content

prootbox

Lightweight proot-based Linux sandboxes (Debian/Alpine) with no root required.

  • No root / no setuid: pure proot, unprivileged.
  • Persistent machines you can create, attach to, and delete.
  • Ephemeral sandboxes that vanish on exit.
  • Detached sessions that keep a machine alive in the background.
  • Per-sandbox hostname (via unprivileged UTS namespace when available).
  • Zero runtime dependencies — pure stdlib, Python 3.6+.

All state lives in the current working directory at the time each call runs (proot-<arch>, base-<distro>/, machines/, sessions/), so different project folders stay isolated.

Install

pip install prootbox

CLI

prootbox                                  # show help
prootbox run                              # ephemeral debian
prootbox run --distro alpine

prootbox create mybox --distro alpine     # create persistent
prootbox attach mybox                     # open shell
prootbox list
prootbox delete mybox

prootbox session start sess1 mybox        # detached session on mybox
prootbox session attach sess1
prootbox session list
prootbox session stop sess1

python3 -m prootbox run                   # works as a module too

Python API

import prootbox as pb

# Ergonomic builder form
pb.create(pb.alpine("my-box"))
pb.create(pb.debian("dev"))
pb.attach("dev")
pb.delete(pb.alpine("my-box"))

pb.run(pb.ephemeral("alpine"))
pb.run()                                  # ephemeral debian

# Or direct form
pb.create("my-box", distro="alpine")
pb.run_ephemeral(distro="debian")

for m in pb.list_machines():
    print(m["name"], m["distro"])

# Sessions
pb.session_start("sess1", machine="dev")
pb.session_attach("sess1")
pb.session_stop("sess1")

Requirements

  • Linux (x86_64 or arm64)
  • unshare and cp in $PATH (standard on any distro)
  • Internet access on first run (downloads proot + rootfs tarballs)

How it works

On first use in a working directory, prootbox downloads a static proot binary and the requested distro's rootfs tarball, extracts it to base-<distro>/, and patches it (DNS, sudo, apt sandboxing). Machines are created with cp -alT (hardlinks) so they take almost no extra disk until written to.

License

MIT

Metadata

Release files for prootbox 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for prootbox 0.1.0
File Size Uploaded
prootbox-0.1.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for prootbox 0.1.0
File Interpreter ABI Platform
prootbox-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.8 kB

Release files / prootbox-0.1.0.tar.gz

Download URL prootbox-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0ca01752f7665e16612bbbaf11ebfb2003e370650eed56beb02e85dcf2a2a63f
BLAKE2b-256 checksum
How to use checksums
bbfd5a0361a6fb6891761dc22252fb7cea8dca175f6a0ef2cd94ebdc39c3b32d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / prootbox-0.1.0-py3-none-any.whl

Download URL prootbox-0.1.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
175c8294679837135f71ee2376a628d441b0dde32cedb76cece32c70bf19e771
BLAKE2b-256 checksum
How to use checksums
b462b3684aef876645441a49f2f19763b26aaca5bf10ca15ffdffde4539add0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page