Necessary Packages and System Requirements
This section gives an overview of the packages required for using virtual machines in Fedora. It also discusses the software and hardware prerequisites needed to ensure that virtualization works as expected.
Most standard computers produced since the 2010s should meet these requirements. If you are already familiar with the basics or are only interested in getting virtual machines to run, you can skip this section and proceed directly to the installation.
Purposes of the Required Packages
QEMU is an application that accesses KVM to virtualize guest machines (virtualizer). In order for this to work, the installed CPU must meet certain requirements. Otherwise, virtualization will fall back to the emulation of guest machines.
We need software packages that run as background processes to be accessed by other applications. The primary focus will be on libvirt
. When managing virtual machines – in this context also known as Libvirt clients – we have several options. Generally, we distinguish between graphical frontends and command-line frontends. In Part 3, a typical workflow will be described for both approaches. This also includes creating so-called snapshots of the current system state.
Additional tools simplify the process. Libvirt defines a standard for describing virtual machines, typically specified in XML and registered with Libvirt in this form. Using virt-install
, this process can be streamlined. You’ll need an ISO image of the desired distribution and a disk image (Virtual Disk Image), which is a file that the virtual machine can use as a virtual hard drive. To manually create such an image, you can use qemu-img
.
If you prefer to use a graphical frontend, you don’t need to deal with these command-line tools directly. However, these tools will still be used in the background when creating virtual machines through the graphical interface. That’s why the packages are generally required.
In either case, an application is required to present the graphical output of the running virtual machines to the user. This is what virt-viewer
is for.
A Word of Caution
Today Fedora recommends other GUI tools for managing virtual machines than it did in the past. Many articles, guides, and wikis available for virtualization in Fedora are therefore somewhat outdated – not least those that appear in the top results of common search queries.
Some older articles point to the DNF Virtualization
group, which would install all required packages in one step. The problem is that this group includes packages that are no longer recommended. Specifically, this affects Virt-Manager, about which Fedora Magazine wrote back in 2019:
With virt-manager being deprecated, users are encouraged to use Cockpit instead, which is meant to replace it.
Virt-Manager is not a bad tool in itself – it’s easy to use and should meet the expectations of many users. However, its support won’t continue in the long run, and its lack of native Wayland support is likely to be a dealbreaker for Fedora users. More importantly, with Cockpit there is a better alternative.
Cockpit is primarily an administration tool that provides system information through a browser interface. With the cockpit-machines
extension, virtual machines can also be created and managed. If virt-install
is installed, new virtual machines can be set up directly within Cockpit – often even without a local ISO image, as a handy downloader is available for many distributions.
System Requirements
Most modern computers should meet the requirements for hardware-assisted virtualization, but it won’t hurt to make sure. So, let’s check whether the installed CPU supports virtualization and whether the KVM kernel module has been loaded:
lsmod | grep kvm
grep -E '^flags.*(vmx|svm)' /proc/cpuinfo
If the first command returns kvm_amd
or kvm_intel
and the second command produces output, then the CPU has the necessary extension (AMD-V or Intel VT-x), and KVM is also available. If the output of either command is empty, QEMU will fall back to the slower software-based virtualization (emulation).
For KVM to be used for virtualization, an additional requirement must be met: In KVM-based virtual machines, QEMU delegates the processing of CPU instructions to the actual hardware. It follows that the underlying processor architecture must match that of the guest system. Specifically, this means that only an x64 processor can assist the virtualization of an x64 machine.