Skip to content
kargogitPublic

About

Create a reusable Ubuntu image and quickly run development VMs with QEMU

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

vm-bakery

Create a reusable Ubuntu golden image and spin up development VMs quickly with QEMU.

What it does

  • Builds a pre-provisioned Ubuntu cloud golden.qcow2 image (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.

Must-knows

  • The scripts use ./dev-vm under 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.

Quickstart (the commands you actually need)

  1. (From repo root) create the golden image (uses your ~/.ssh/id_ed25519.pub by default):
./make-golden-vm.sh

If you use a different public key or port:

./make-golden-vm.sh --ssh-key /path/to/key.pub --ssh-port 2223
  1. Boot a run overlay (reuse latest run overlay by default):
./run-vm.sh

Create a fresh overlay and run it:

./run-vm.sh --new
  1. 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.)

Handy commands (vmctl)

./vmctl.sh wraps common tasks:

  • ./vmctl.sh list — show run images, pids, and forwarded ports.
  • ./vmctl.sh start [--new] [name] — start a run (delegates to run-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.

Tips & troubleshooting

  • If /dev/kvm is 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

Why this is useful

  • Build once, branch many runs: keep a single pre-provisioned image and spawn disposable VMs quickly for testing, debugging, or development.

About

Create a reusable Ubuntu image and quickly run development VMs with QEMU

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages