Show Table of Contents
B.2.2. Failed to connect socket ... : Permission denied
- Symptom
- When running a
virshcommand, 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
- Investigation
- Without any host name specified, the connection to QEMU uses UNIX sockets by default. If there is no error running this command as root, the UNIX socket options in
/etc/libvirt/libvirtd.confare likely misconfigured. - Solution
- To connect as a non-root user using UNIX sockets, configure the following options in
/etc/libvirt/libvirtd.conf:unix_sock_group =
<group>unix_sock_ro_perms = <perms> unix_sock_rw_perms = <perms>Note
The user runningvirshmust be a member of thegroupspecified in theunix_sock_groupoption.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.