Why virt
Recently I am working on packaging rasdaemon for Debian11 Bullseye. My package work is now works properly running on Ubuntu, and it's time for me to test it on Debian. However, I don't have a Debian machine, so I try to think about the possible solutions:
- multipass - only able to launch Ubuntu by default
- uvtool - only able to launch Ubuntu by default
- lxc - able to launch Debian, but I need to test features of kernelspace
- virt - an interface to manipulate KVM, which is bit more general purpose solution for me.
Steps
- Install virt on Ubuntu Jammy by
sudo apt install qemu-system libvirt-daemon-system
. sudo adduser ubuntu libvirt
- Download Bullseye iso
- Install the VM
virt-install --virt-type kvm --name bullseye-amd64 --cdrom /tmp/debian-11.3.0-amd64-netinst.iso --os-variant debian11 --disk size=50 --memory 8000
- put the iso in
/tmp
is a must for qemu access permision of directory
- put the iso in
- Manually complete the installer process
virt-viewer --connect qemu+ssh://ubuntu@<guest IP>/system bullseye-amd64
- Backup the VM for future reuse after completing the installation
virt-clone --original bullseye-amd64 --name debian-bullseye-just-installed-220609 --auto-clone
Some Misc Tips
If you need grant the normal user with sudo
permission, login as root by su - root
and then usermod -aG sudo <the account of normal user>
. -
is important for root to find out the command usermod
.