Installation guide

When running a command, the following error (or similar) appears:
$ virsh -c name_of_uri list
error: Cannot read CA certificate '/etc/pki/CA/cacert.pem': No
such file or directory
error: failed to connect to the hypervisor
In vest ig at io n
The error message is misleading about the actual cause. This error can be caused by a
variety of factors, such as an incorrectly specified URI, or a connection that is not
configured.
So lu t io n
In co rrect ly sp ecif ied UR I
When specifying qemu://system or qemu://session as a connection URI,
vi rsh attempts to connect to hostnames system or session respectively. This is
because vi rsh recognizes the text after the second forward slash as the host.
Use three forward slashes to connect to the local host. For example, specifying
qemu:///system instructs vi rsh connect to the system instance of lib virt d on
the local host.
When a hostname is specified, the Q EMU transport defaults to T LS. This results
in certificates.
Co n n ect io n is n o t co n f ig u red
The URI is correct (for example, qemu[+tls]://server/system) but the
certificates are not set up properly on your machine. For information on
configuring TLS, see Setting up lib virt for TLS available from the lib virt website.
B.2.2. Failed t o connect socket ... : Permission denied
Symp t o m
When running a vi rsh command, the following error (or similar) appears:
$ virsh -c qemu:///system list
error: Failed to connect socket to '/var/run/libvirt/libvirt-
sock': Permission denied
error: failed to connect to the hypervisor
In vest ig at io n
Without any hostname specified, the connection to Q EMU uses UNIX sockets by default. If
there is no error running this command as root, the UNIX socket options in
/etc/l i bvi rt/l i bvi rtd . co nf are likely misconfigured.
So lu t io n
To connect as a non-root user using UNIX sockets, configure the following options in
/etc/l i bvi rt/l i bvi rtd . co nf:
Common libvirt errors and t roublesh oot ing
131