Skip to content

Instantly share code, notes, and snippets.

@aaronedev
Created May 5, 2025 21:13
Show Gist options
  • Save aaronedev/07ca5419b850b4f7f6431b618100defe to your computer and use it in GitHub Desktop.
Save aaronedev/07ca5419b850b4f7f6431b618100defe to your computer and use it in GitHub Desktop.
qemu run debian + use venus kvm libguestfs video accelaration
#!/bin/bash
# Current Debian stable is 12 (bookworm)
ISO=debian-12.4.0-amd64-netinst.iso
IMG=debian-12.qcow2
if [ ! -f "$ISO" ]; then
wget https://deb.debian.org/debian/dists/stable/main/installer-amd64/current/images/netboot/mini.iso -O $ISO
# Alternative full netinst image if mini.iso is too minimal
# wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.4.0-amd64-netinst.iso
fi
if [ ! -f "$IMG" ]; then
qemu-img create -f qcow2 $IMG 16G
fi
qemu-system-x86_64 \
-enable-kvm \
-M q35 \
-smp 4 \
-m 4G \
-cpu host \
-net nic,model=virtio \
-net user,hostfwd=tcp::2222-:22 \
-device virtio-vga-gl,hostmem=4G,blob=true,venus=true \
-vga none \
-display gtk,gl=on,show-cursor=on \
-usb -device usb-tablet \
-object memory-backend-memfd,id=mem1,size=4G \
-machine memory-backend=mem1 \
-hda $IMG \
-cdrom $ISO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment