I use libvirt to manage my virtual machines on my systems and until recently I was overlaying it on my rpm-ostree systems by installing the virt-install
and virt-manager
packages which pull-in the libvirt daemon via dependencies.
Approximately a month ago, the zfs-fuse
package got “fixed” to depend on initscripts
(see: 2214965 – Do not require initscripts / use initscripts-service instead) and I did not want to get initscripts back on my system so I’ve looked at trimming the dependencies.
Unfortunately, virt-manager
pulls-in libvirt-daemon-kvm or libvirt-daemon-qemu
which both pull-in the zfs-fuse
package via dependencies.
So the first step was to move virt-manager
to a dedicated toolbox, copy the desktop entry to ~/.local/share/applications
and edit it to run it in the toolbox directly:
$ toolbox create virt-manager
$ toolbox enter virt-manager
$ sudo dnf update -y && sudo dnf install -y virt-manager virt-install
$ cp /usr/share/applications/virt-manager.desktop ~/.local/share/applications/
$ cat ~/.local/share/applications/virt-manager.desktop | grep Exec=
Exec=toolbox run --container virt-manager virt-manager
The second step was to figure out through trial and error the right sub-packages to install to get a working libvirt setup for the common KVM / QCOW2 / Linux only use cases. I landed on:
libvirt-daemon
libvirt-daemon-config-network
libvirt-daemon-driver-interface
libvirt-daemon-driver-network
libvirt-daemon-driver-nwfilter
libvirt-daemon-driver-qemu
libvirt-daemon-driver-secret
libvirt-daemon-driver-storage-core
qemu-kvm
Overall this is a very poor user experience for setting up libvirt on rpm-ostree based systems but I could not figure out a better option for now.
An alternative option for virt-manager
would be to use the Cockpit Flatpak to manage virtual machines but this is currently blocked on issue#30 for me on KDE. I’ve not yet checked if all the functionalities that I need have been implemented in the Cockpit UI but I hope that this will enable me to remove virt-manager
in the long term.
Suggestions to improve this setup or fix this in a better way are welcomed!