Background
virt-manager
is a graphical interface for the libvirt
library, using qemu
for machine emulation and kvm
for hardware virtualization.
kvm
stands for “kernel-based virtual machine” and is a low level hypervisor.
Unlike the (especially on Windows) commonly used hypervisor in Oracle VirtualBox, KVM does not require external kernel modules, and runs on a vanilla Linux kernel.
This makes it less troublesome to use than VirtualBox for example, and also more performant.
Links:
- RedHat introduction of hypervisors
- virt-manager documentation
- Fedora Magazine on virt-manager
- Wikipedia on the term “hypervisor”
- ArchWiki on KVM
- Wikipedia on KVM
- ArchWiki on virt-manager
- ArchWiki on QEMU
- Fedora Docs on QEMU
- Fedora Docs on virtualization using libvirt
Libvirt privileges
By default, virt-manager offers a QEMU system session.
To use this, a user needs to be in the wheel
group (the “administrators”) and enter the user password every time.
Alternatively, they can be in the libvirt
group, where no password is needed.
The issue, is the broad access this requires. Access to the system libvirt socket is equal to root access on the host OS.
So if there is no other need, it is safer to use a QEMU user session.
QEMU user session
GNOME Boxes stands out, as it allows running virtual machines, while being a flatpak application.
It achieves this by running an unprivileged user session only.
Using the unprivileged user session prevents the use of a few advanced features, that may not be important for many users though.
GNOME Boxes also has fewer features, and the Flatpak has further restrictions.
So here is how to use the same mode in virt-manager:
Setup
Virt-manager also supports running an unprivileged QEMU user session:
- Open virt-manager, exit the password prompt with
Esc
- Right-click on the “QEMU system session” and delete it
- Under “File” add a new session, choose “QEMU user session”
- Now proceed to create your virtual machines as usual
Done! It is that easy.
You can also have a system and a user session at once, and just stop the system session from connecting.