Skip to main content

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)
  • wget
  • ssh

On Debian/Ubuntu:

sudo apt install qemu-system-x86 cloud-image-utils whois wget openssh-client

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

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

  1. Downloads debian-sid-generic-amd64-daily.qcow2 from cloud.debian.org
  2. Creates a cloud-init ISO with SSH keys, user config, and auto-login
  3. Boots the VM with QEMU/KVM and waits for cloud-init to finish
  4. On subsequent debsb run, boots the prepared image directly

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

debsb-0.1.1.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

debsb-0.1.1-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file debsb-0.1.1.tar.gz.

File metadata

  • Download URL: debsb-0.1.1.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for debsb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6aa1d3a1430d35cde9896d66c7b7cb14c10fb13a04a3e8274a3ac6a307044048
MD5 746e7cd997968ac88d8d4e1586273e90
BLAKE2b-256 948e8c96bff6db01b76b4d727d34bf6bfd81194cd0db4ec7a2d2c43079210e21

See more details on using hashes here.

File details

Details for the file debsb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: debsb-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for debsb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6ac843c6fed79ce815377fa65f3ae587c52b1eb1dcc7770f1f3757ec74031c11
MD5 b51b63cee755a5788a5998fdf9a8fc1f
BLAKE2b-256 0f2a1aaca6b18b91e201a6425038d83e897f39a0ad394553f238b403c465c341

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page