Why virsh commands are failing with error "Failed to connect socket to libvirt-sock No such file or directory"

Solution Verified - Updated -


  • All virsh commands executed by the user other than root is failing with the error below.
error: failed to connect to the hypervisor
error: Failed to connect socket to '/home/test_user/.cache/libvirt/libvirt-sock': No such file or directory
  • The same virsh command will work if the user runs the command again within 30 seconds.


  • Red Hat Enterprise Linux 7.7.

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In