Debian Sid Sandbox — instant QEMU/KVM VM from cloud images
Project description
debsb
Debian Sid sandbox in one command. Downloads a Debian cloud image, boots it in QEMU/KVM, and gives you an isolated VM with auto-login, SSH, and shared filesystem. No kernel building, no complex setup.
Install
pip install debsb
Dependencies
qemu-system-x86_64(with KVM support)cloud-image-utils(cloud-localds)whois(mkpasswd)wgetssh
On Debian/Ubuntu:
sudo apt install qemu-system-x86 cloud-image-utils whois wget openssh-client
For --debian kernel builds, additionally:
sudo apt install python3-dacite python3-debian python3-jinja2 debhelper quilt rsync devscripts dh-python
Usage
Build the sandbox (one-time)
debsb build --size 20G
This downloads the Debian Sid cloud image, configures SSH keys and auto-login, and runs first boot. All artifacts are stored in ~/.debsb/.
Use --reset to skip the prompt and rebuild from scratch:
debsb build --size 20G --reset
Build with a custom kernel (upstream)
debsb build ~/linux --configitem CONFIG_KASAN=y --configitem CONFIG_KCOV=y
This:
- Sets up the cloud image (if not already done)
- Generates a default kernel config (
make defconfig) with VM-essential options - Applies
--configitementries - Runs
make olddefconfigandmake bindeb-pkg - Installs the resulting
.debinto the VM via GRUB
Build with Debian kernel (salsa)
# Default branch (debian/latest)
debsb build --debian --configitem CONFIG_KASAN=y --configitem CONFIG_KCOV=y
# Specific branch
debsb build --debian --branch debian/sid
This clones the Debian kernel from salsa.debian.org/kernel-team/linux.git, applies config items to debian/config/config, and builds the amd64 kernel package using the Debian packaging rules. The resulting kernel is installed into the VM via GRUB.
Run the sandbox
# Serial console (auto-login as debian, Ctrl-A X to quit)
debsb run
# SSH session (as debian)
debsb run --ssh
# SSH as root
debsb run --ssh --root
# Run a command and auto-shutdown (requires --ssh)
debsb run --ssh --root --exec "apt update && apt upgrade -y"
# Graphical QEMU window
debsb run --graphics
# With sound
debsb run --sound
# Extra QEMU options
debsb run --qemu-opts='-m 8192'
Execute a command
--exec runs a command via SSH and shuts down automatically. Requires --ssh:
debsb run --ssh --exec "uname -a"
debsb run --ssh --root --exec "ls -ahl .debsb"
debsb run --ssh --exec "./my-script.sh"
This is useful for CI/automation. The exit code of the command is propagated.
Verbose mode
Show kernel boot messages:
debsb run --verbose
Shared filesystem
Your host ~/.debsb/ directory is mounted inside the VM at:
/root/.debsb(symlink to/mnt/debsb)/home/debian/.debsb(symlink to/mnt/debsb)
This is automatic — no manual mounting needed.
How it works
- Downloads
debian-sid-generic-amd64-daily.qcow2from cloud.debian.org - Creates a cloud-init ISO with SSH keys, user config, and auto-login
- Boots the VM with QEMU/KVM and waits for cloud-init to finish
- On subsequent
debsb run, boots the prepared image directly
When building with a kernel (debsb build <path> or debsb build --debian):
- The kernel
.debis installed into the VM - GRUB is updated to boot the new kernel by default
- No
-kernelor-initrdflags needed — GRUB handles boot
Accounts
| User | Access |
|---|---|
debian |
Serial auto-login, SSH with key, sudo NOPASSWD |
root |
SSH with key (--root flag) |
SSH key: ~/.debsb/id_ed25519 (auto-generated on first build)
License
GPL-2.0-only
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file debsb-0.2.0.tar.gz.
File metadata
- Download URL: debsb-0.2.0.tar.gz
- Upload date:
- Size: 24.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6af0eb13d0b8f975a7f4881cbd2f9fca7cb99145ec73d49a2ca5f37d7e35bbbb
|
|
| MD5 |
c45fba6ee8887bbbd9e5970c2876669b
|
|
| BLAKE2b-256 |
804cc619c4956f297764b652d37ed31cb37522f465b640acf44d7cc3ac247e39
|
File details
Details for the file debsb-0.2.0-py3-none-any.whl.
File metadata
- Download URL: debsb-0.2.0-py3-none-any.whl
- Upload date:
- Size: 23.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c2a71700a953952ff18b306044cdf1bcb636132a1bc4779366e82017c6a72f73
|
|
| MD5 |
d5be011921d44d423904e002e21ce888
|
|
| BLAKE2b-256 |
25cc79c66063949155eb4b6d3416a516e7ed3c8751edcf3db332f41df76e6cea
|