Unable to connect to libvirt (authentication failed: polkit)
If you don't use gnome as your window manager and starts virt-manager, you might get the error bellow:
Unable to connect to libvirt. authentication failed: polkit: polkit\56retains_authorization_after_challenge=1 Authorization requires authentication but no agent is available. Libvirt URI is: qemu:///system Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/connection.py", line 1027, in _open_thread self.vmm = self._try_open() File "/usr/share/virt-manager/virtManager/connection.py", line 1009, in _try_open flags) File "/usr/lib64/python2.7/site-packages/libvirt.py", line 102, in openAuth if ret is None:raise libvirtError('virConnectOpenAuth() failed') libvirtError: authentication failed: polkit: polkit\56retains_authorization_after_challenge=1 Authorization requires authentication but no agent is available.
As the error says, this happens because the authentication agent is not available. You have two options: run the agent or disable the check.
In fedora the agent is in the /usr/libexec/, just run it. You can put this in yours window manager file in order to run everytime you start a session:
/usr/libexec/polkit-gnome-authentication-agent-1 &
Done! Now when you run virt-manager again, a box asking for the password will be shown.
Option 2: Disable the check
Edit the file /usr/share/polkit-1/actions/org.libvirt.unix.policy file and change the lines with the values bellow:
<allow_any>auth_admin</allow_any> <allow_inactive>auth_admin</allow_inactive> <allow_active>auth_admin_keep</allow_active>
<allow_any>yes</allow_any> <allow_inactive>yes</allow_inactive> <allow_active>yes</allow_active>
Done! The error disappears!