KVM on Debian 12, tested on the N100 Mini PC.
Some of these tools will require an X11 server which can be VxSrv on Windows, for example.
apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system virt-viewer virtinst virt-manager qemu-utils
Add login to group(s).
Debian says add your login to group libvirt and other guides recommend group kvm as well. The latter group requirement is unknown.
adduser `login' libvirt adduser `login' kvm
Export the hostname of your X11 server and on that host allow access via xhost.
setenv DISPLAY excellent:0.0 virt-manager
VM storage
mkdir -p /opt/VM chown 0:0 /opt/VM chmod 1777 /opt/VM
ISO storage
mkdir -p /opt/ISO cd /opt/ISO wget https://cdimage.debian.org/debian-cd/current/amd64/iso-dvd/debian-12.4.0-amd64-DVD-1.iso sha256sum debian-12.4.0-amd64-DVD-1.iso 3a85e04f0bbdf7ba0cdd7537dd781c583f70754db67e5a757f113442cade56ea debian-12.4.0-amd64-DVD-1.iso
Interactive
This example uses a fixed MAC address.
#! /bin/sh export PATH=/bin:/sbin NAME="debian12" DVD="/opt/ISO/debian-12.4.0-amd64-DVD-1.iso" DISK="/opt/VM/${NAME}.qcow2,size=20,format=qcow2" virsh destroy ${NAME} virsh undefine ${NAME} rm -f ${DISK} virt-install \ --name "${NAME}" \ --ram 1024 \ --disk path="${DISK}" \ --vcpus 1 \ --os-variant debian11 \ --network bridge=br0,mac=02:00:c0:a8:00:6e \ --graphics none \ --console pty,target_type=serial \ --location "${DVD}" \ --extra-args 'console=ttyS0'
Non interactive
Append the following to the interactive script above
--initrd-inject preseed.cfg --noautoconsole --wait
This preseed file uses a fixed IP address.
virsh list --all
virsh start debian12
virsh autostart debian12
virsh autostart --disable debian12
virsh dominfo debian12
virsh console debian12
virsh shutdown debian12
NB there are optional modes
virsh destroy debian12
virsh undefine debian12
virsh dumpxml debian12 > debian12.xml
virsh define debian12.xml