I am running Gentoo Linux for AMD64 using kernel 3.12.21 AMD64 on an HP Pavilion Touch 14-N009LA with an AMD A8-4555M CPU. My desktop environment is KDE 4.12.5. I have installed KVM, libvirtd, polkit and virt-manager. However, when I open virt-manager, I get the following error and am unable to do anything with virtual machines:
Unable to connect to libvirt.
authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory
Detail output is here:
Unable to connect to libvirt.
authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory
Libvirt URI is: qemu:///system
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/connection.py", line 1002, in _open_thread
self.vmm = self._try_open()
File "/usr/share/virt-manager/virtManager/connection.py", line 984, in _try_open
flags)
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 105, in openAuth
if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory
Googling around I found the following tips to try and make it work, and here's how they went:
- Making sure that a polkit authentication agent is running. I checked and it is indeed running:
black@rockshooter ~ $ ps -ef | grep polkit black 5039 1 0 04:31 ? 00:00:00 /usr/lib64/kde4/libexec/polkit-kde-authentication-agent-1
- Creating a group called kvm, adding my user ID to it, and creating a polkit rule to authenticate users of group kvm who wish to manage VMs. I did it like this and it didn't work:
root@rockshooter /etc/polkit-1/rules.d # cat 50-default.rules polkit.addRule(function(action, subject) { if (action.id == "org.libvirt.unix.manage" && subject.isInGroup("kvm")) { return polkit.Result.YES; } }); root@rockshooter /etc/polkit-1/rules.d # grep kvm /etc/group kvm:x:78:qemu,black
- Connecting to the hypervisor from the command line (using
virsh
). I get the exact same error.
black@rockshooter ~ $ virsh --connect qemu:///system error: failed to connect to the hypervisor error: authentication failed: polkit: Error getting authority: Error initializing authority: Could not connect: No such file or directory
su
?$ virsh --connect qemu:///system
with$
and not#
thought maybe that could be the problem. ;-)su
. There's nothing wrong with that. ;-)