30.8. Missing localhost entry in /etc/hosts causing virt-manager to fail

30.8. Missing localhost entry in /etc/hosts causing virt-manager to fail

The virt-manager application may fail to launch and display an error such as “Unable to open a connection to the Xen hypervisor/daemon”. This is usually caused by a missing localhost entry in the /etc/hosts file. Verify that you indeed have a localhost entry and if it is missing from /etc/hosts and insert a new entry for localhost if it is not present. An incorrect /etc/hosts may resemble the following:

# Do not remove the following line, or various programs
# that require network functionality will fail.
localhost.localdomain localhost

The correct entry should look similar to the following:

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
localhost.localdomain localhost


Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.