Installing virt-manager in debian
virt-manager is GUI for running virtual machines in qemu similar to virtual box and vmware. The virtual machines are independent of the virt-manager GUI, so closing the GUI leaves the VM running in background.
Install virt-manager with apt:
apt-get install virt-manager
# add user to libvirt group
usermod -aG libvirt USER
When the user is not added to the libvirt group, virt-manager starts with an error:
Unable to connect to libvirt qemu system
journalctl -u libvirtd.service
libvirtd authentication unavailable no polkit agent available to authenticate action org.libvirt.unix.manage
On some machines, the hw virtualization is disabled, it can be check with this command:
virt-host-validate
QEMU: Checking for hardware virtualization : FAIL (Only emulated CPUs are available, performance will be significantly limited)
Enable hw virtualization in bios.
Problem after reboot, can't start VM because of error: Network 'default' is not active
Run commands to activate the default network in libvirt:
> virsh net-list --all
Name State Autostart Persistent
----------------------------------------
# if the list is empty, define the default network
virsh net-define /usr/share/libvirt/networks/default.xml
virsh net-autostart default
# start the default network
sudo virsh net-start default