WS Sandbox Proxy Overview & Quick Start
Self-hosted KVM sandbox control plane running owner-scoped Incus virtual machines on your own Linux hosts.
WS Sandbox Proxy (wssp, the name of its Rust CLI and node daemon) is a self-hosted sandbox control plane for running owner-scoped Incus KVM virtual machines on Linux hosts you enroll. It provides a web dashboard, a native /v1 HTTP API, a TypeScript SDK (@wssp/sdk), a built-in /mcp server, and interactive CLI shells, port forwards, and keyless SSH—all driven over outbound WebSockets so your sandbox hosts never need inbound ports.
Architecture
WS Sandbox Proxy separates the web/API control plane from the Linux machines that run KVM workloads. Node daemons connect outbound to /ws/sandbox-host, execute dispatched operations against their local Incus daemon, and enforce sandbox lifetimes and network policies locally even while disconnected.
+-------------------------------------------+
| Control Plane |
Browser (Cookie) | apps/web (React / TanStack Router SPA) |
SDK (/v1 Bearer) | apps/server (Hono, Better Auth, oRPC, |
MCP (/mcp OAuth) | /v1 API, /mcp, Relay, Transfer Spool) |
CLI (wssp login) | apps/worker (BullMQ jobs, webhooks) |
+---------------------+---------------------+
|
+--------------------+--------------------+
| |
PostgreSQL 18 + Valkey 9 Outbound WSS
(Metadata, Ops, Rate Limits) (/ws/sandbox-host)
|
+-----------------+-----------------+
| Enrolled Linux Host(s) |
| wssp host run (unprivileged) |
| wssp-guard (root nftables) |
| Incus 6.14+ KVM VMs |
| wssp-sbx-<id> (wssp project) |
+-----------------------------------+
Core packages and applications in the repository:
| Component | Role |
|---|---|
apps/web |
React / TanStack Router dashboard with browser terminal, PWA support, and localized routes |
apps/server |
Hono API server, Better Auth, /v1 native API, /mcp endpoint, host relay, and transfer spool |
apps/worker |
Optional dedicated BullMQ consumer container (runs embedded in apps/server by default) |
apps/cli |
Linux-only Rust binary (wssp) serving both user commands and the outbound node daemon |
packages/sandbox-contracts |
Public /v1 DTO schemas, error catalog, route registry, and generated OpenAPI document |
packages/sdk |
Server-side TypeScript client (@wssp/sdk) |
crates/sandbox-protocol / crates/sandbox-runtime |
Relay protocol 1.0 contract and Incus KVM / fake runtime adapters |
Prerequisites
Local development stack
- Node.js 26 LTS (
26.13.1or newer) - pnpm
12.18.0(pinned inpackage.json) - Docker or Podman (for local PostgreSQL 18 and Valkey 9)
portless(npm install -g portless) for localhttps://*.localhostorigins- Rust 1.99+ (to build or run the
wsspCLI and node daemon from source)
Real sandbox hosts
- Linux (
x86_64oraarch64) with KVM (/dev/kvmusable by Incus) - Incus 6.14 or newer with the
network_aclextension (Ubuntu 24.04 ships 6.0.0; install from Zabbly) br_netfilterkernel module loaded withnet.bridge.bridge-nf-call-ip6tables=1conntrackpackage installed (conntrackon Debian/Ubuntu,conntrack-toolselsewhere)- Root access once per host to install the
wssp-guardnftables service
Local development quick start
Install dependencies, initialize local services, and start the control plane:
npm install -g pnpm@12.18.0 portless
pnpm install
pnpm setup:app
pnpm dev
[!NOTE] Use
pnpm setup:apprather thanpnpm setup—setupis a built-in pnpm command that takes precedence over a same-named package script. On Linux/WSL, if pnpm fails withmkdir '/Users', unset any stale macOSPNPM_HOMEenvironment variable and retry.
pnpm setup:app creates missing .env files, generates auth and SANDBOX_REQUEST_HMAC_SECRET values, records ADMIN_EMAILS, starts PostgreSQL 18 and Valkey 9, and applies committed Prisma migrations. Once running:
- Dashboard:
https://wssp.localhost - API:
https://api.wssp.localhost
Validate your local environment at any time with:
pnpm doctor:app
First local login (Mailpit)
Public signup is disabled by default (SIGNUP_ENABLED=false), while addresses listed in ADMIN_EMAILS can bootstrap the first administrator account. Every account must verify its email address before signing in.
- Confirm
ADMIN_EMAILSin the root.envmatches your email address (for exampleyou@example.com). - Start a local Mailpit container to capture verification emails:
docker run -d -p 1025:1025 -p 8025:8025 axllent/mailpit
- Set the following in the root
.env:
SMTP_HOST=localhost
SMTP_PORT=1025
SMTP_FROM=noreply@dev.local
- Restart
pnpm dev, sign up athttps://wssp.localhostwith yourADMIN_EMAILSaddress, openhttp://localhost:8025to click the verification link, and enroll two-factor authentication (required for admins).
Connecting your first host
You can either enroll a real Linux KVM + Incus host or test the control plane locally without VMs using the fake runtime.
Option A: Enroll a real Linux KVM + Incus host
Install wssp on the Linux host as the unprivileged user that has Incus admin access (matching your server version):
curl --proto '=https' --tlsv1.2 -fsSL --max-time 120 https://wssp.example.com/install.sh | sh
Enroll the machine via device login, install the root-owned egress guard once, and start the daemon:
wssp host enroll --slug desk-01 --server https://wssp.example.com
sudo "$(command -v wssp)" host guard install --daemon-user "$USER"
wssp host run
- Open the verification URL printed by
wssp host enrollin your signed-in browser and approve the host. - In the dashboard, open Templates → Create from community image to prepare a tested Ubuntu base VM image (OCI container images are not VM images).
- Create your first sandbox from Sandboxes → Create sandbox or via the CLI/SDK.
Option B: Try locally without VMs (WSSP_RUNTIME=fake)
To exercise enrollment, pools, lifecycle operations, webhooks, and the /v1 or /mcp APIs on a development stack without KVM or Incus, run the daemon with --runtime fake (or WSSP_RUNTIME=fake):
cargo run -p wssp -- host enroll --slug dev-fake --server https://api.wssp.localhost
WSSP_RUNTIME=fake WSSP_FAKE_ENFORCE_EGRESS=1 cargo run -p wssp -- host run
WSSP_FAKE_ENFORCE_EGRESS=1makes the fake runtime advertise egress enforcement (which it does not actually perform) so creates are accepted on local stacks.WSSP_FAKE_FAIL_CREATE_FILE=/tmp/fail-createscauses new creates to fail while that file exists—useful for testing retry andsandbox.create_failedwebhook paths.wssp host runrefuses to start the real Incus runtime if either fake testing variable is set.
Known limitations
Be aware of these current boundaries before adopting WS Sandbox Proxy:
- Not a drop-in E2B server replacement. WS Sandbox Proxy does not implement E2B’s REST or
envdwire protocols, so official E2B SDKs cannot connect to it.@wssp/sdkadopts ergonomic E2B-like conventions on top of/v1. - No built-in public URLs (
getHost). Guest ports are never exposed directly to the public internet. To share a web app inside a sandbox, configure an optional external Tunnel server for short-lived gated preview links, or usewssp sandbox forwardlocally. - No snapshots, live restore, or VM fork. Those operations currently return
UNSUPPORTED_CAPABILITY. Stopping a sandbox keeps its root disk (not RAM or running processes); with an S3 image store, stopped disks can offload and restore on another eligible host. - No live migration or failover. Placement picks among currently eligible hosts (or queues in a pool’s FIFO wait queue when
waitForCapacityMsis set). A running sandbox stays on its assigned host. - Shared-pool trust model. Pool sharing is by explicit invitation only. A node owner’s daemon user is an Incus admin and retains full access to every VM on their hardware, including other users’ shared-pool sandboxes. Pool users never receive host access to someone else’s machine.
- Linux-only CLI and daemon. Release binaries ship for
x86_64andaarch64Linux (static musl). On Windows, runwsspinside WSL 2. - Single-replica control plane. Run exactly one
apps/serverreplica: host relay sockets, browser/CLI terminal sessions, in-process revocation signals, and the/app/.datatransfer spool assume one server process.