Skip to content

Instantly share code, notes, and snippets.

@thebalaa
Last active February 12, 2025 23:07
Show Gist options
  • Save thebalaa/db63fa36b5306865c84abeac7dabbe81 to your computer and use it in GitHub Desktop.
Save thebalaa/db63fa36b5306865c84abeac7dabbe81 to your computer and use it in GitHub Desktop.

Creating Debian 13 VM from CLI with Ubuntu

Inspired by: https://gist.github.com/plembo/f592b80eade840a51c7c52d22b2c1b63

  1. Update osinfo definitions:
sudo apt install osinfo-db-tools
wget https://releases.pagure.org/libosinfo/osinfo-db-20250124.tar.xz
osinfo-db-import osinfo-db-20250124.tar.xz
  1. Create VM
sudo virt-install\
  --name debian-vm\
  --memory 8192\
  --vcpus 1\
  --os-type=linux\
  --os-variant=debian13\
  --graphics none\
  --network network=default,model=virtio\
  --disk path=/mnt/data/virtual-machines/debian-vm.img,size=20\
    --location "http://ftp.us.debian.org/debian/dists/stable/main/installer-amd64/"\
    --extra-args "console=ttyS0"

NOTE: Press Ctrl + ] to exit VM console session3.

Now you know what Escape is ^] means

Reconnect to the VM console

virsh --connect qemu:///system console debian-vm

Clone an existing VM

virt-clone --original debian-vm --name debian13-base --file /mnt/data/virtual-machines/debian13-base.img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment