Create a reusable Ubuntu golden image and spin up development VMs quickly with QEMU.
- Builds a pre-provisioned Ubuntu cloud
golden.qcow2image (packages + your SSH key). - Lets you create ephemeral run overlays from that golden image and boot them with QEMU.
- Provides tiny helpers to start, stop, list and SSH into runs.
- The scripts use
./dev-vmunder the repo as the workspace (images,run,artifacts, …). - Default VM user:
tester. Default SSH port:2222. Default SSH key:~/.ssh/id_ed25519/.pub. - Designed for Debian/Ubuntu hosts — the scripts will try to install missing packages (sudo required).
- KVM is used if available; if not, QEMU will still run (slower).
- Keep a usable SSH keypair locally — the golden image is provisioned with your public key.
- (From repo root) create the golden image (uses your
~/.ssh/id_ed25519.pubby default):
./make-golden-vm.shIf you use a different public key or port:
./make-golden-vm.sh --ssh-key /path/to/key.pub --ssh-port 2223- Boot a run overlay (reuse latest run overlay by default):
./run-vm.shCreate a fresh overlay and run it:
./run-vm.sh --new- SSH into the running VM:
ssh -i ~/.ssh/id_ed25519 -p 2222 tester@127.0.0.1(Or use ./vmctl.sh ssh — see next section.)
./vmctl.sh wraps common tasks:
./vmctl.sh list— show run images, pids, and forwarded ports../vmctl.sh start [--new] [name]— start a run (delegates torun-vm.sh)../vmctl.sh stop [name]— stop a run (by name or latest)../vmctl.sh ssh [name]— SSH into a run (uses per-project known_hosts)../vmctl.sh info [name]— show pidfile and port for a run.
- If
/dev/kvmis missing, the scripts will try to load kernel modules; if it still isn't available your VM runs without KVM (slower). - If SSH doesn't come up during golden provisioning, check QEMU console or the printed guest-selfcheck output.
- Golden image path:
./dev-vm/images/golden.qcow2. Run overlays live under./dev-vm/run/. - To create a manual overlay:
qemu-img create -f qcow2 -b dev-vm/images/golden.qcow2 dev-vm/run/run-YYYYmmdd-HHMMSS.qcow2- Build once, branch many runs: keep a single pre-provisioned image and spawn disposable VMs quickly for testing, debugging, or development.