Virtual Machine Manager showing QEMU/KVM - Connecting

Since few days whenever I open Virtual Machine Manager or run “virt-manager” it keeps showing “QEMU/KVM - Connecting…” and doesn’t move on from that. A reboot fixes the problem for a while. Then if I close the application and try to open it again sometime after then same issue.

I haven’t touch the configuration files. Done nothing to mess the qemu/kvm. I usually update the system from the “Software” . I read similar type of issue in here and tried following:

  1. I noticed “groups” command didn’t list kvm and libvirt (even though i am sure I added my user to those groups during installation) - added my users to those groups - didn’t work
  2. Tried reinstalling virt-manager - didn’t work
  3. Tried reinstalling “Virtualization” group - didn’t work
  4. Tried restarting libvirtd - now this is a strange part. The service status is inactive(dead) and restarting it gives “job for libvirtd.service canceled” but it solves the problem (again for a while only)

This is annoying in the long run. What should I do?

1 Like

Just out of curiosity, do you have hardware virtualisation enabled in your BIOS?

Check the output:

sudo virt-host-validate
groups; gsettings get org.virt-manager.virt-manager.connections uris

See also: Qemu reinstall aftter 'dnf remove' - #9 by vgaetera

Yes, I do have it enabled

sudo virt-host-validate

QEMU: Checking for hardware virtualization                                 : PASS
  QEMU: Checking if device /dev/kvm exists                                   : PASS
  QEMU: Checking if device /dev/kvm is accessible                            : PASS
  QEMU: Checking if device /dev/vhost-net exists                             : PASS
  QEMU: Checking if device /dev/net/tun exists                               : PASS
  QEMU: Checking for cgroup 'cpu' controller support                         : PASS
  QEMU: Checking for cgroup 'cpuacct' controller support                     : PASS
  QEMU: Checking for cgroup 'cpuset' controller support                      : PASS
  QEMU: Checking for cgroup 'memory' controller support                      : PASS
  QEMU: Checking for cgroup 'devices' controller support                     : PASS
  QEMU: Checking for cgroup 'blkio' controller support                       : PASS
  QEMU: Checking for device assignment IOMMU support                         : PASS
  QEMU: Checking if IOMMU is enabled by kernel                               : WARN (IOMMU appears to be disabled in kernel. Add intel_iommu=on to kernel cmdline arguments)
  QEMU: Checking for secure guest support                                    : WARN (Unknown if this platform has Secure Guest support)
   LXC: Checking for Linux >= 2.6.26                                         : PASS
   LXC: Checking for namespace ipc                                           : PASS
   LXC: Checking for namespace mnt                                           : PASS
   LXC: Checking for namespace pid                                           : PASS
   LXC: Checking for namespace uts                                           : PASS
   LXC: Checking for namespace net                                           : PASS
   LXC: Checking for namespace user                                          : PASS
   LXC: Checking for cgroup 'cpu' controller support                         : PASS
   LXC: Checking for cgroup 'cpuacct' controller support                     : PASS
   LXC: Checking for cgroup 'cpuset' controller support                      : PASS
   LXC: Checking for cgroup 'memory' controller support                      : PASS
   LXC: Checking for cgroup 'devices' controller support                     : PASS
   LXC: Checking for cgroup 'freezer' controller support                     : FAIL (Enable 'freezer' in kernel Kconfig file or mount/enable cgroup controller in your system)
   LXC: Checking for cgroup 'blkio' controller support                       : PASS
   LXC: Checking if device /sys/fs/fuse/connections exists                   : PASS

groups; gsettings get org.virt-manager.virt-manager.connections uris

svayam wheel kvm libvirt
['qemu:///system']

I read the thread you mentioned and tried your solution but no luck. Someone has reported this as bug https://bugzilla.redhat.com/show_bug.cgi?id=2213398 and it matches with my issue. It started showing after the upgrade of systemd.

Looks like a bug between systemd and libvirt (see: libvirtd socket activation not working since 253.5 · Issue #27953 · systemd/systemd · GitHub), downgrading systemd helps:

sudo dnf downgrade systemd-253.2-1.fc38

Not ideal though.

Continue troubleshooting:

systemctl status virtqemud.service virtqemud.socket
virsh -d 0 connect qemu:///session
virsh -d 0 connect qemu:///system
journalctl -b -g avc

systemctl status virtqemud.service virtqemud.socket

● virtqemud.service - Virtualization qemu daemon
     Loaded: loaded (/usr/lib/systemd/system/virtqemud.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: active (running) since Thu 2023-06-08 23:00:45 +0545; 2min 1s ago
TriggeredBy: ● virtqemud.socket
             ● virtqemud-ro.socket
             ● virtqemud-admin.socket
       Docs: man:virtqemud(8)
             https://libvirt.org
   Main PID: 10511 (virtqemud)
      Tasks: 19 (limit: 32768)
     Memory: 10.9M
        CPU: 316ms
     CGroup: /system.slice/virtqemud.service
             └─10511 /usr/sbin/virtqemud --timeout 120

Jun 08 23:00:45 fedora systemd[1]: Starting virtqemud.service - Virtualization qemu daemon...
Jun 08 23:00:45 fedora systemd[1]: Started virtqemud.service - Virtualization qemu daemon.
Jun 08 23:02:43 fedora virtqemud[10511]: libvirt version: 9.0.0, package: 3.fc38 (Fedora Project, 2023-05-07-17:31:32, )
Jun 08 23:02:43 fedora virtqemud[10511]: hostname: fedora
Jun 08 23:02:43 fedora virtqemud[10511]: End of file while reading data: Input/output error

● virtqemud.socket - Libvirt qemu local socket
     Loaded: loaded (/usr/lib/systemd/system/virtqemud.socket; enabled; preset: disabled)
     Active: active (running) since Thu 2023-06-08 15:55:40 +0545; 7h ago
   Triggers: ● virtqemud.service
     Listen: /run/libvirt/virtqemud-sock (Stream)
     CGroup: /system.slice/virtqemud.socket

Jun 08 15:55:40 fedora systemd[1]: Listening on virtqemud.socket - Libvirt qemu local socket.

virsh -d 0 connect qemu:///session

connect: name(optdata): qemu:///session

virsh -d 0 connect qemu:///system

connect: name(optdata): qemu:///session

journalctl -b -g avc

Jun 08 15:55:37 fedora kernel: audit: type=1400 audit(1686219037.889:4): avc:  denied  { audit_control } for  pid=1 comm="systemd" capability=30  scontext=system_u:system_r:init_t:s0 tcontext=system_u:system_r:init_t:s0 tclass=capability permissive=0

It maybe target some kind of hardware only. I am on Dell inspiron 3467.

Will try this too. I guess another option is to wait for the next systemd release. For now even if it is not ideal, workable is fine

Libvirtd stop responding after some time - #3 by vgaetera

4 Likes