Skip to content

Repository files navigation

sandboxctl

A CLI tool that spins up a Linux sandbox VM on your machine for local development. Powered by QEMU and Ubuntu cloud images — no Docker, no VirtualBox, no cloud account required.

Requirements

  • macOS or Linux (Windows support is experimental)
  • macOS or Linux: QEMU — brew install qemu / sudo apt install qemu-system qemu-utils
  • Node.js 18+

Agent Skill

sandboxctl ships an agent skill for Claude Code, Cursor, Codex, and other AI coding assistants. It analyzes your project and writes a sandbox.json for you — detecting runtimes, port requirements, and appropriate VM sizing automatically.

Install it with:

npx skills add inputforge/sandboxctl

Once installed, ask your assistant: "create a sandbox for this project" and it will run the full setup wizard inline.

Quickstart

Run in any project directory:

npx sandboxctl

This launches a setup wizard that checks prerequisites, walks you through configuration, and optionally boots the VM — all in one session.

Or install globally for day-to-day use:

npm install -g sandboxctl
sandboxctl # setup wizard
sandboxctl ssh # shell inside the VM

Commands

sandboxctl <command>
Commands:
init Configure sandbox.json interactively
start Build (if needed) and boot the sandbox VM
stop Gracefully shut down the VM
destroy Delete the VM and all associated files
status Show sandbox name, status, SSH port, and uptime
ssh Open an interactive SSH session into the VM
send Sync project files from host → VM (uses rsync or tar)
receive Sync files from VM → host
forward [port] Forward a port: <guest-port> or <host-port>:<guest-port>
doctor Check that required dependencies are installed

No-argument wizard

Running sandboxctl with no arguments starts the setup wizard:

  1. Prerequisite check — verifies the required backend (Lima on macOS, QEMU on Linux) is installed and prints the install command if not
  2. Configuration — runs the init prompts; if sandbox.json already exists all fields are pre-populated with current values so you can press Enter to keep them
  3. Boot offer — asks whether to start the VM immediately after saving config

doctor

Checks that the required binaries are present for your platform and reports the install command for anything missing:

sandboxctl doctor

First start

On first boot, the tool will:

  1. Download the Ubuntu cloud image (cached in ~/.local/share/sandboxctl/images/)
  2. Create a QCOW2 overlay disk
  3. Build a cloud-init seed image with your SSH public key and install script
  4. Boot the VM in the background
  5. Stream the package install log until ==> Done.
  6. Rsync your project files into the VM

Subsequent start calls skip provisioning and boot in seconds.

Configuration — sandbox.json

Generated by sandboxctl init (or the wizard). You can also write it by hand:

{
"ubuntu": "24.04",
"vm": {
"cpus": 4,
"memory": "4G",
"disk": "20G"
},
"packages": {
"nodejs": { "enabled": true, "version": "22" },
"bun": { "enabled": false },
"python": { "enabled": true },
"go": { "enabled": false }
},
"send": {
"remotePath": "/home/ubuntu/my-project"
},
"ports": [{ "host": 3000, "guest": 3000, "protocol": "tcp" }]
}

Supported packages

PackageVersionedDefault
Node.jsyes22
Bunyes1.3.12
Python 3no
Java (OpenJDK)yes21
Goyes1.24.3
Rubyno
PHPno
Swiftyes6.0.3

Port forwarding

ports is an optional array of host↔guest port mappings. Useful for accessing a dev server running inside the VM.

Config change rules

ChangeAction required
ubuntu versiondestroy + start
packagesdestroy + start
vm.disk (grow only)stop + start
vm.cpus / vm.memorystop + start
ports / send.remotePathstop + start

File sync

send pushes your current directory to the VM (respects .gitignore). It uses rsync when available and falls back to tar over SSH.

sandboxctl send # host → VM
sandboxctl receive # VM → host

Development

npm install
npm run build # compile all packages (required before npm run cli)
npm run cli # run the compiled CLI

License

MIT

About

Create and manage Linux sandbox VMs for local development

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages