Minimal virt-manager install?

On Fedora Kinoite I want to use virt-manager, to run x86_64 VMs, nothing more.

Previously I used

rpm-ostree install virt-manager qemu qemu-kvm

Which installed a ton of packages to my system. I could narrow them a lot by using

rpm-ostree install virt-manager qemu-system-x86

But still I have the qemu-user-static variants for tons of architectures regular users dont need:

qemu-user-static-aarch64-8.2.2-1.fc40.x86_64
qemu-user-static-arm-8.2.2-1.fc40.x86_64
qemu-user-static-x86-8.2.2-1.fc40.x86_64
qemu-user-static-alpha-8.2.2-1.fc40.x86_64
qemu-user-static-cris-8.2.2-1.fc40.x86_64
qemu-user-static-hexagon-8.2.2-1.fc40.x86_64
qemu-user-static-hppa-8.2.2-1.fc40.x86_64
qemu-user-static-loongarch64-8.2.2-1.fc40.x86_64
qemu-user-static-m68k-8.2.2-1.fc40.x86_64
qemu-user-static-microblaze-8.2.2-1.fc40.x86_64
qemu-user-static-mips-8.2.2-1.fc40.x86_64
qemu-user-static-nios2-8.2.2-1.fc40.x86_64
qemu-user-static-or1k-8.2.2-1.fc40.x86_64
qemu-user-static-ppc-8.2.2-1.fc40.x86_64
qemu-user-static-riscv-8.2.2-1.fc40.x86_64
qemu-user-static-s390x-8.2.2-1.fc40.x86_64
qemu-user-static-sh4-8.2.2-1.fc40.x86_64
qemu-user-static-sparc-8.2.2-1.fc40.x86_64
qemu-user-static-xtensa-8.2.2-1.fc40.x86_64

# along with

libvirt-daemon-driver-qemu-10.1.0-2.fc40.x86_64
qemu-system-x86-core-8.2.2-1.fc40.x86_64
qemu-system-x86-8.2.2-1.fc40.x86_64
qemu-kvm-8.2.2-1.fc40.x86_64
qemu-user-8.2.2-1.fc40.x86_64

strangely, trying to uninstall them, this happens

>> rpm-ostree uninstall qemu-user-static-arm
error: Package/capability 'qemu-user-static-arm' is not currently requested
1 Like

Added atomic-desktops

How about Boxes is this overloaded too?

Unfortunately we do have this with other packages that you get a ton of data you never will use… as an example are the language files. If you install a other Language than English you get all languages available. On the other hand I do understand that the dev’s save work to make just one package.

Note that virt-manager is essentially a libvirt client.
The server and client can run on different hosts.


I install libvirt from scratch like this:

sudo dnf install \
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 \
qemu-system-x86-core
sudo systemctl --now enable virtnetworkd.service
sudo systemctl --now enable virtqemud.service

That should be the bare minimum you need.

3 Likes

:rotating_light: Linux Chad Sighting :rotating_light: :laughing: j/k

I was looking into just this the other day for a future project, I went as far as to look into the possibility of running systemd-vmspawn but have not looked into it further due to time constraints. From The Man pages :

**NAME**         

       systemd-vmspawn - Spawn an OS in a virtual machine.

**SYNOPSIS**         


       systemd-vmspawn [OPTIONS...] [ARGS...]

**DESCRIPTION**         

       systemd-vmspawn may be used to start a virtual machine from an OS
       image. In many ways it is similar to systemd-nspawn(1), but it
       launches a full virtual machine instead of using namespaces.


In hopes of having a minimal build as well.

2 Likes

so this gets you KVM and qemu, but without the client? I wondered because KVM is not mentioned here.

I wonder if qemu-kvm or virt-manager cause all the apps being installed.

rpm-ostree install virt-manager qemu-system-x86 qemu-user-static-x86

Still installs all the qemu bloat that is not needed.

interesting. Other interesting things:

  • kata containers
  • krun (Asahi Linux people seem to maintain it for x86 WINE stuff, COPR: teohhanhui/asahi-krun)

That’s a redundant package:

> dnf -q repoquery -l qemu-kvm
Package qemu-kvm-2:8.2.2-1.fc40.x86_64 contains no files

Here it is:

> dnf -q repoquery --whatprovides \*/qemu-kvm
qemu-system-x86-core-2:8.2.2-1.fc40.x86_64

> rpm -q -f $(modinfo -n kvm)
kernel-modules-core-6.8.11-300.fc40.x86_64

That package requires too many unnecessary dependencies:

> dnf -q repoquery --requires qemu-system-x86 | wc -l
43
1 Like

Oh, thanks?!

I don’t think those are pulled in via any of those packages.

I took a fresh Fedora 40 container and did dnf install virt-manager qemu-system-x86 qemu-kvm

Afterwards, if I search for qemu-user-static in the list of RPMs, it comes up empty:

[root@639362b466a7 /]# dnf install virt-manager qemu-system-x86 qemu-kvm
Fedora 40 - x86_64                              717 kB/s |  20 MB     00:28    
Fedora 40 openh264 (From Cisco) - x86_64        2.3 kB/s | 1.4 kB     00:00    
Fedora 40 - x86_64 - Updates                    5.5 MB/s | 7.2 MB     00:01    
Dependencies resolved.
================================================================================
 Package                               Arch   Version             Repo     Size
================================================================================
Installing:
 qemu-kvm                              x86_64 2:8.2.2-1.fc40      fedora   12 k
 qemu-system-x86                       x86_64 2:8.2.2-1.fc40      fedora   14 k
 virt-manager                          noarch 4.1.0-5.fc40        fedora  703 k
Installing dependencies:
 ModemManager-glib                     x86_64 1.22.0-3.fc40       fedora  322 k
 NetworkManager-libnm                  x86_64 1:1.46.0-2.fc40     fedora  1.8 M
 SDL2                                  x86_64 2.30.3-1.fc40       updates 699 k
 SDL2_image                            x86_64 2.8.2-4.fc40        fedora  110 k
...
...
  xml-common-0.6.3-63.fc40.noarch                                               
  xorriso-1.5.6-5.fc40.x86_64                                                   
  xprop-1.2.7-1.fc40.x86_64                                                     
  yajl-2.1.0-23.fc40.x86_64                                                     
  zfs-fuse-0.7.2.2-30.fc40.x86_64                                               
  zlib-ng-2.1.6-2.fc40.x86_64                                                   

Complete!
[root@639362b466a7 /]# rpm -qa | grep qemu-user-static
[root@639362b466a7 /]# 

Looking on my Silverblue system, it doesn’t appear that any RPMs require the qemu-user-static package, but containers-common-extra recommends the package:

$ rpm -q --whatrequires qemu-user-static
no package requires qemu-user-static
$ rpm -q --whatrecommends qemu-user-static
containers-common-extra-0.59.1-1.fc40.noarch

And containers-common-extra is pulled in as a requirement for podman and buildah:

$ rpm -q --whatrequires containers-common-extra
podman-5.1.0-1.fc40.x86_64
buildah-1.35.4-1.fc40.x86_64

So what I think is happening is that during the compose process of Silverblue/Kinoite, rpm-ostree is pulling in the packages according to the Recommends: directive (see: handling recommends 🗣 · Issue #718 · coreos/rpm-ostree · GitHub for more details).

I think there are a couple of options here:

  • ask the question of the containers-common maintainers why they are requiring the inclusion of qemu-user-static (hint: 2061584 – qemu-user-static needs to be broken into separate package per arch.)
  • propose disabling the Recommends: packages during the compose of Kinoite/Silverblue
  • do nothing and live with the extra 158 MB on your system ($ rpm -qa | grep qemu-user-static | xargs rpm -q --queryformat "%{SIZE}\n" | paste -sd+ - | bc | numfmt --to=iec-i --suffix=B --format="%9.2f"…cobbled that together after a couple of searches :smile: )

This is because you didn’t explicitly “request” the install of qemu-user-static-arm like rpm-ostree install qemu-user-static-arm.

You could try rpm-ostree override remove qemu-user-static-arm, but that is going to end up in a frustrating game of chasing down more requirements and trying to remove them. Additionally, that doesn’t actually remove the data from disk, just hides it from the output of rpm -qa and the like.

3 Likes

Today suddenly virt-manager tells me there is no service running.

sudo systemctl --now enable virtnetworkd.service
sudo systemctl --now enable virtqemud.service

Failed to enable unit: Unit file virtnetworkd.service does not exist.
Failed to enable unit: Unit file virtqemud.service does not exist.

rpm-ostree layered:

virt-manager qemu-system-x86

I suppose there is some package missing, anyone know which exactly?

I will try @vgaetera 's list of packages

> rpm -q -f /usr/lib/systemd/system/{virtnetworkd,virtqemud}.service
libvirt-daemon-driver-network-10.1.0-4.fc40.x86_64
libvirt-daemon-driver-qemu-10.1.0-4.fc40.x86_64