KVM documentation and simplest/right way to install?

Hi,

I have installed Fedora 41 Server for virtualization.

In the server documentation there’s a lot of steps for installing virtualization:

I did a test yesterday where I jumped all about storage and just did the installation:
[…]# dnf install qemu-kvm-core libvirt virt-install cockpit-machines guestfs-tools

and the systemd startup:
[…]# for drv in qemu interface network nodedev nwfilter secret storage ;
do systemctl start virt${drv}d{,-ro,-admin}.socket ; done

I was then able to install and play around with a Fedora Virtual Machine using Cockpit.

The Quick Docs

Is a lot simpler and doesn’t say anything about storage setup and starting anything other than libvirtd.
It also uses the @group in the installation which the server documentation doesn’t recommend.

So, to do this “the right way”, or simplest/cleanest possible way, what documentation should I follow?

The server documentation seems a bit messy, and it isn’t quite clear to me, what the minimum steps for a simple setup is.
It also misses some information like when asked to “Next check the SELinux labels”; ok, what is it supposed to be? How do I know if I need to “Otherwise, set them manually”?

Can anyone explain me the simplest/right way to do it?

For me the simplest seems to be to install virt-manager then open that and create my vm there. The VMM allows creating, managing, altering of VMs as well as performing an installation into the new VM being created.

VMM is a gui interface to all the config needs for me. If you are using server and do not have a gui desktop that route may not be appropriate.

That is probably not recommended because it includes the virt-manager gui package and server is not using gui desktop by default. The virt-viewer package which I do not have installed may also be gui.

# dnf install @virtualization
Updating and loading repositories:
 Fedora 41 - x86_64 - Updates Archive                                                                  100% |  26.1 KiB/s |   3.4 KiB |  00m00s
 Fedora 41 - x86_64 - Updates                                                                          100% | 135.8 KiB/s |  29.5 KiB |  00m00s
 RPM Fusion for Fedora 41 - Free tainted                                                               100% |   3.7 KiB/s |   3.3 KiB |  00m01s
 Fedora 41 - x86_64 - Updates Archive                                                                  100% |   3.1 MiB/s |   2.4 MiB |  00m01s
 Fedora 41 - x86_64 - Updates                                                                          100% |   3.1 MiB/s |   4.0 MiB |  00m01s
Repositories loaded.
Package "virt-install-5.0.0-1.fc41.noarch" is already installed.
Package "libvirt-daemon-config-network-10.6.0-6.fc41.x86_64" is already installed.
Package "libvirt-daemon-kvm-10.6.0-6.fc41.x86_64" is already installed.
Package "qemu-kvm-2:9.1.2-2.fc41.x86_64" is already installed.
Package "virt-manager-5.0.0-1.fc41.noarch" is already installed.

Package                                        Arch         Version                                         Repository                     Size
Installing group/module packages:
 virt-viewer                                   x86_64       11.0-10.fc41                                    fedora                      1.2 MiB
Installing groups:
 Virtualization                                                                                                                                

Transaction Summary:
 Installing:         1 package

Total size of inbound packages is 301 KiB. Need to download 301 KiB.
After this operation, 1 MiB extra will be used (install 1 MiB, remove 0 B).
Is this ok [y/N]: 

Hi Jeff,

Yes, it’s a server, so I don’t have a GUI.

I’m also curious after why the storage parts is described if it’s not necessary, and if I don’t do the storage parts etc. will I then get problems down the road with like upgrades, backup, export/import or other things?

Unfortunately, documentation is not the strongest side of Fedora, as it is often out of date, sometimes to the point that it does more harm than good.

Do not enable or start the legacy monolithic libvirtd.service since it conflicts with modern modular services and can lead to race conditions:
Changes/LibvirtModularDaemons - Fedora Project Wiki

Do not confuse the easiest and cleanest ways, as the first one will install a lot of dependencies that you may not necessarily need.

See also: Minimal virt-manager install? - #4 by vgaetera

1 Like

Hi again,

Thanks Vladislav for pointing me to the two pages.

When I say simple/easy I just mean least amount of complicated, but necessary, work to get a bare minimum solution up and running. All the storage, that some guides/docs explains, seems not to be relevant.

I ended up doing some trial and error, and did:

dnf install \
qemu-system-x86-core \
libvirt \
libvirt-daemon-driver-network \
libvirt-daemon-driver-nodedev \
libvirt-daemon-driver-qemu \
libvirt-daemon-driver-storage-core \
qemu-audio-spice \
qemu-char-spice \
qemu-device-display-qxl \
qemu-device-display-virtio-gpu \
qemu-device-display-virtio-vga \
qemu-device-usb-redirect \
virt-install \
virt-top

Which is almost like the solution from #4 vgaetera.
My virt-top doesn’t work though? Shows nothing.

I also read the RedHat docs and this https://sysguides.com/install-kvm-on-linux
as well as other sources.

But the solution from #4 vgaetera seemed to be the bare-bone that works.

I’ve read about some of the packages, and I can’t quite figure out what qemu-kvm does.
It’s described as a meta-package (qemu-kvm - Fedora Packages), so I guess it’s installing all architectures and not just the package qemu-system-x86-core which is specifically installed in the #4 vgaetera solution???

Almost all guides/docs says to execute something like this:

$ for drv in qemu interface network nodedev nwfilter secret storage; do \
    sudo systemctl enable virt${drv}d.service; \
    sudo systemctl enable virt${drv}d{,-ro,-admin}.socket; \
  done

My system works after the installation and a reboot, so why is this done?

This ensures all the necessary services are enabled and will be started with each boot. It may or may not be required but is good insurance.

It depends on the client as some clients can automatically build the storage pool.

Make sure you are not using a root shell to list VMs set up in session mode.

That is also a meta-package.

This should be redundant in Fedora since the relevant services support socket-based activation and the sockets are enabled by default:
Tree - rpms/fedora-release - src.fedoraproject.org

Installing packages generally does not start systemd units.