You are not logged in.

#1 2019-03-12 18:48:18

Swiggles
Member
Registered: 2014-08-02
Posts: 266

[Solved] libvirt - virsh and virt-manager stuck on connecting

Hello everyone,

I have an annoying issue since a few days. Whenever I try to connect to libvirt via virsh or virt-manager the process gets stuck on connecting and never finishes, even after hours of waiting.
It started with the recent libvirt-5.1.0-1 and downgrading to libvirt-5.0.0-1 fixes the issue for me, but of course this is no solution. Instead of doing that I can just restart the daemon:

systemctl restart libvirtd.service

and it starts working without any further issues until I reboot. Of course the service is enabled and starts successful.

The total lack of usable log files (or you might have to point me in the right direction) leaves me stumped at what to do. Has anyone seen the same issue or does know a possible solution? Any help is appreciated and thank you for reading.

journalctl -u libvirtd.service #version 5.1

Mar 12 15:58:26 moebius systemd[1]: Started Virtualization daemon.
Mar 12 19:17:36 moebius systemd[1]: Stopping Virtualization daemon...
Mar 12 19:17:36 moebius systemd[1]: libvirtd.service: Succeeded.
Mar 12 19:17:36 moebius systemd[1]: Stopped Virtualization daemon.

journalctl -u libvirtd.service #version 5.1 with service restart

Mar 12 19:30:30 moebius systemd[1]: Started Virtualization daemon.
Mar 12 19:35:43 moebius systemd[1]: Stopping Virtualization daemon...
Mar 12 19:35:43 moebius systemd[1]: libvirtd.service: Succeeded.
Mar 12 19:35:43 moebius systemd[1]: Stopped Virtualization daemon.
Mar 12 19:35:43 moebius systemd[1]: Started Virtualization daemon.
Mar 12 19:35:43 moebius dnsmasq[6307]: started, version 2.80 cachesize 150
Mar 12 19:35:43 moebius dnsmasq[6307]: compile time options: IPv6 GNU-getopt DBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Mar 12 19:35:43 moebius dnsmasq-dhcp[6307]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Mar 12 19:35:43 moebius dnsmasq-dhcp[6307]: DHCP, sockets bound exclusively to interface virbr0
Mar 12 19:35:43 moebius dnsmasq[6307]: reading /etc/resolv.conf
Mar 12 19:35:43 moebius dnsmasq[6307]: using nameserver 192.168.0.9#53
Mar 12 19:35:43 moebius dnsmasq[6307]: read /etc/hosts - 0 addresses
Mar 12 19:35:43 moebius dnsmasq[6307]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Mar 12 19:35:43 moebius dnsmasq-dhcp[6307]: read /var/lib/libvirt/dnsmasq/default.hostsfile

journalctl -u libvirtd.service #version 5.0

Mar 12 19:18:38 moebius systemd[1]: Started Virtualization daemon.
Mar 12 19:18:39 moebius libvirtd[2074]: libvirt version: 5.0.0
Mar 12 19:18:39 moebius libvirtd[2074]: hostname: moebius
Mar 12 19:18:39 moebius libvirtd[2074]: Ung<C3><BC>ltiges Argument: could not find capabilities for arch=x86_64 domaintype=kvm 
Mar 12 19:18:39 moebius dnsmasq[2245]: started, version 2.80 cachesize 150
Mar 12 19:18:39 moebius dnsmasq[2245]: compile time options: IPv6 GNU-getopt DBus i18n IDN2 DHCP DHCPv6 no-Lua TFTP conntrack ipset auth DNSSEC loop-detect inotify dumpfile
Mar 12 19:18:39 moebius dnsmasq-dhcp[2245]: DHCP, IP range 192.168.122.2 -- 192.168.122.254, lease time 1h
Mar 12 19:18:39 moebius dnsmasq-dhcp[2245]: DHCP, sockets bound exclusively to interface virbr0
Mar 12 19:18:39 moebius dnsmasq[2245]: reading /etc/resolv.conf
Mar 12 19:18:39 moebius dnsmasq[2245]: using nameserver 192.168.0.9#53
Mar 12 19:18:39 moebius dnsmasq[2245]: using nameserver fd00::7eff:4dff:fe95:6edc#53
Mar 12 19:18:39 moebius dnsmasq[2245]: read /etc/hosts - 0 addresses
Mar 12 19:18:39 moebius dnsmasq[2245]: read /var/lib/libvirt/dnsmasq/default.addnhosts - 0 addresses
Mar 12 19:18:39 moebius dnsmasq-dhcp[2245]: read /var/lib/libvirt/dnsmasq/default.hostsfile
Mar 12 19:18:58 moebius dnsmasq[2245]: reading /etc/resolv.conf
Mar 12 19:18:58 moebius dnsmasq[2245]: using nameserver 192.168.0.9#53
Mar 12 19:19:05 moebius dnsmasq[2245]: reading /etc/resolv.conf
Mar 12 19:19:05 moebius dnsmasq[2245]: using nameserver 192.168.0.9#53
Mar 12 19:20:19 moebius dnsmasq[2245]: reading /etc/resolv.conf
Mar 12 19:20:19 moebius dnsmasq[2245]: using nameserver 192.168.0.9#53
Mar 12 19:20:19 moebius dnsmasq[2245]: using nameserver fd00::7eff:4dff:fe95:6edc#53
Mar 12 19:20:21 moebius dnsmasq[2245]: reading /etc/resolv.conf
Mar 12 19:20:21 moebius dnsmasq[2245]: using nameserver 192.168.0.9#53
Mar 12 19:20:21 moebius dnsmasq[2245]: using nameserver fd00::7eff:4dff:fe95:6edc#53
Mar 12 19:29:56 moebius systemd[1]: Stopping Virtualization daemon...
Mar 12 19:29:56 moebius systemd[1]: libvirtd.service: Succeeded.
Mar 12 19:29:56 moebius systemd[1]: Stopped Virtualization daemon.

#Some random info

➜ uname -a     
Linux moebius 5.0.0-arch1-1-ARCH #1 SMP PREEMPT Mon Mar 4 14:11:43 UTC 2019 x86_64 GNU/Linux

➜ LC_ALL=C sudo virsh net-list --table
 Name      State    Autostart   Persistent
--------------------------------------------
 default   active   yes         yes
 
➜ LC_ALL=C sudo virsh net-info default
Name:           default
UUID:           f5cd2a87-7916-40ad-a0df-436e1620055b
Active:         yes
Persistent:     yes
Autostart:      yes
Bridge:         virbr0

Last edited by Swiggles (2019-03-13 21:02:46)

Offline

#2 2019-03-13 21:02:36

Swiggles
Member
Registered: 2014-08-02
Posts: 266

Re: [Solved] libvirt - virsh and virt-manager stuck on connecting

I was ready to file a bug report on the tracker, but I accidentally solved it when I tried to properly document this issue.

Solution:

systemctl disable virtlogd.socket
systemctl disable virtlockd.socket
systemctl disable libvirtd.service

#Most likely not necessary, consider stopping all related services instead
reboot

#use --now if you do not want to reboot after for validation
systemctl enable libvirtd.service

#to test
reboot
#confirm dnsmasq etc. has been properly loaded with libvirt
systemctl status libvirtd.service

So I think there was some issue with systemd and the order/dependencies of services being loaded by the system. For whatever reason the previous version of libvirt is not affected and worked just by downgrading. If I am the only one with this problem this it is most likely just some freak coincidence otherwise feel free to contact me so we can properly report the error.
If anyone else runs into this problem please try the described steps first.

Thanks for reading my posts and have a great day! :-)

Edit: It looks like my assumption is wrong. This behavior is an issue with lvmetad. Once you disable it it works normally. My testing method was based on wrong assumptions, sorry for the confusion. Anyway it is really, really strange, but there are already a few open tickets so I leave it closed/solved.

Last edited by Swiggles (2019-03-15 12:58:25)

Offline

Board footer

Powered by FluxBB