unContainer

Concepts

Runs and sessions

Both start a Linux guest from a snapshot of your checkout. A run ends with its command. A session stays until you close it.

The snapshot in /work

At startup, unContainer copies the Git worktree root (or the current directory outside Git) into /work. The copy includes uncommitted, untracked and ignored files. Large directories such as node_modules add to startup time and guest memory.

Runs

uncontainer run -- COMMAND boots a guest, runs the command in /work, relays stdout, stderr and the exit code, and discards the guest. Every run sees the current state of your files.

Session lifecycle

  • Open. session open boots a guest for the current worktree. Opening it again from the same worktree reuses the running session.
  • Exec. session exec -- COMMAND runs in /work. Commands share files, processes and localhost.
  • Refresh. Host edits made after startup enter the guest when you close and reopen the session. A fresh run always sees them, and run --https copies them in as you save.
  • Close. session close discards guest state, including build outputs and Docker data.

Sharing a session

Agents working in the same worktree share its session. One agent can start a service while another runs tests against it. Coordinate before closing a shared session.

CPU, memory and distro

SettingFlagRangeDefault
vCPUs--cpus N1–161
Guest RAM--memory SIZE128MiB–4GiB, whole MiBEngine default
Distro--distro NAMEdebian, alpine, debian:dockerdebian

Settings apply when the guest boots. Opening an existing session without them keeps its current allocation. To change them, close and reopen. Alpine uses musl and BusyBox; Debian uses glibc. Pick the one that matches your project’s Linux binaries.

Sessions without a worktree

A session can outlive the worktree it came from. session list marks those entries, and prune closes them:

uncontainer session prune --dry-run uncontainer session prune

Pruning closes sessions whose original worktree disappeared or whose path now points to a different directory. Use session close ID from any directory to close a single one.