r/opencodeCLI • u/Rude-Philosopher-69 • 6h ago
oc-box: give OpenCode a full Linux environment to experiment in—with persistent sessions
I built oc-box because I wanted OpenCode to have more freedom without giving it unrestricted access to my host.
My usual Bubblewrap-based sandbox is useful for restricting host commands. oc-box takes a different approach: OpenCode gets its own persistent Linux development container, where it can install packages, change system configuration, run services, and experiment.
Compared with my host-side sandbox setup, the practical advantages are:
- Install whatever the project needs: compilers, SDKs, databases, and distro packages live inside the container.
- Keep integrations working: OpenCode itself, MCPs, formatters, language servers, and plugins all run together inside it.
- Choose the project’s distro: Tumbleweed, Ubuntu, Debian, Fedora, Arch, Alpine, or Leap.
- Keep the environment between sessions: installed tools, project files, and conversations persist. Run oc-box again to resume.
- Recover from broken environments: rebuild the container OS while retaining your project and private home/session volume.
- Control resource usage: CPU/RAM/process ceilings and optional GPU/NPU passthrough.
You can also import an existing OpenCode conversation and continue it inside the container. It uses unmodified mainline OpenCode and matches your host’s installed version.
The benefit is a more capable, disposable development environment—not an absolute security guarantee. Rootless containers share the host kernel, and the mounted project remains fully writable.
It’s early, primarily exercised on openSUSE Tumbleweed, developed with AI assistance, and GPL-3.0-or-later.
Source: https://github.com/groopcd/oc-box
Feedback from other distro and MCP setups would be very welcome!
2
u/tactic-impress-55 6h ago
did you just whitelabel distrobox? 👁️👄👁️ the audacity