brokenbox gives you hands-on Linux troubleshooting practice on your own machine.
Each scenario boots a fresh, disposable virtual machine, a setup script quietly breaks something,
and you SSH in to find and fix it. When you think you're done, brokenbox check tells you if you solved it.
Everything runs locally with KVM and libvirt. There's no account and no cloud, and it doesn't cost anything.
admin and work out what went wrong.Setup and check scripts are piped to the VM over SSH stdin and never written to its disk. Expected answers stay on the host and are generated for each run, so you can't find the solution by grepping the box.
Right after setup, brokenbox takes a memory-and-disk snapshot. If you make things worse,
brokenbox reset puts the box back to its freshly broken state instantly.
debian-12-genericcloud.qcow2 # downloaded once, checksum-verified
└─ brokenbox-golden.qcow2 # tools installed, services disabled
└─ brokenbox-<scenario>.qcow2 # copy-on-write overlay per scenario
You need Linux with hardware virtualisation (/dev/kvm) and Python 3.11 or newer.
brokenbox only uses the Python standard library.
$ sudo apt install qemu-kvm libvirt-daemon-system virtinst xorriso
You also need virsh, virt-install, ssh and curl.
libvirt should have its default storage pool and network.
$ sudo usermod -aG libvirt,kvm $USER
# log out and back in for this to take effect
$ git clone git@github.com:Pavithra-Rajan/brokenbox.git && cd brokenbox
$ ln -s "$PWD/brokenbox-cli" ~/.local/bin/brokenbox # run it as brokenbox from anywhere
The link points at your checkout, so changes apply immediately; re-create it if you move the repo.
Without it, use ./brokenbox-cli in place of brokenbox.
(pip install -e . also works, but Debian and Ubuntu block it for the system Python, so use
pipx install -e . or a virtualenv there.)
$ brokenbox doctor
$ brokenbox build-base
This downloads the Debian 12 cloud image and bakes a golden image with the tools pre-installed.
Disks go in libvirt's pool (/var/lib/libvirt/images), so this step doesn't need sudo.
$ brokenbox list
$ brokenbox start <id>
$ brokenbox ssh <id>
$ brokenbox check <id>
$ brokenbox destroy <id>
| Command | What it does |
|---|---|
doctor | Check host prerequisites |
build-base [--rebuild] | Build the golden image |
list / status | List scenarios (with best times) / running VMs |
progress [--clear] | Solved count, best times, attempts |
describe <id> | Print the problem statement |
start <id> [--force] | Create the VM, break it, snapshot it |
ssh <id> | Log in as admin |
check <id> | Run the checker |
reset <id> | Revert to the freshly broken snapshot |
stop / console <id> | Shut down (keep the disk) / attach the serial console |
destroy <id> | --all | Delete the VM and its disk |
Each scenario is based on a problem people keep running into on real servers. The forum questions that
inspired it are listed in its scenario.toml. Run brokenbox describe <id> for the full brief.
| ID | Challenge | Level | Area | Time |
|---|
scenarios/my-scenario/
scenario.toml # title, difficulty, kind, time_minutes, sudo, memory, description
setup.sh # runs as root; break things here
check.sh # runs as root; exit 0 = solved
setup.sh can call expect KEY value to save an answer on the host, which
check.sh then reads as $KEY. Inside check.sh, use
pass "msg" or fail "msg". Set sudo = false to drop the player's sudo rights after setup.