Search

B.16. Unable to connect to server at 'host:16509': Connection refused ... error: failed to connect to the hypervisor

download PDF
Symptom
While libvirtd should listen on TCP ports for connections, the connections fail:
# virsh -c qemu+tcp://host/system
error: unable to connect to server at 'host:16509': Connection refused
error: failed to connect to the hypervisor
The libvirt daemon is not listening on TCP ports even after changing configuration in /etc/libvirt/libvirtd.conf:
# grep listen_ /etc/libvirt/libvirtd.conf
listen_tls = 1
listen_tcp = 1
listen_addr = "0.0.0.0"
However, the TCP ports for libvirt are still not open after changing configuration:
# netstat -lntp | grep libvirtd
#
Investigation
The libvirt daemon was started without the --listen option. Verify this by running this command:
# ps aux | grep libvirtd
root     27314  0.0  0.0 1000920 18304 ?       Sl   Feb16   1:19 libvirtd --daemon
The output does not contain the --listen option.
Solution
Start the daemon with the --listen option.
To do this, modify the /etc/sysconfig/libvirtd file and uncomment the following line:
#LIBVIRTD_ARGS="--listen"
Then restart the libvirtd service with this command:
# /etc/init.d/libvirtd restart
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.