When starting virt-manager in a ssh -X session as a wheel user I get: Unable to connect to libvirt. authentication failed: 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: Authorization requires authentication but no agent is available. When starting it on the X console as the same user it works fine and prompts for password for connecting locally. I would not expect such a difference in behaviour ... and if the difference is intended then I would expect a more helpful error message. virt-manager-0.9.4-2.fc17.noarch
I've sent a patch to libvirt to preface the error with 'polkit:' which hopefully gives a bit more of a hint about what's going on: https://www.redhat.com/archives/libvir-list/2012-December/msg00976.html That error is coming straight from pkcheck though. The error means that polkit needs a password, but there is no polkit agent registered in your session. Polkit agents are the bit of UI that pop up and actually ask for your password. When you log in over ssh -X, nothing is autolaunching an agent like gnome-session does for example. virt-manager could probably check to see if an agent is registered and if not register its own simple one, but this problem affects any polkit using app that is run over ssh -X. However I doubt the polkit devs will be interested in making this work since the main usecase is for people sitting at the physical machine. I know quite a few people try to use virt-manager over ssh, probably more than any other polkit using app. I'll use this bug to track the virt-manager specific fix.
*** Bug 1004775 has been marked as a duplicate of this bug. ***
Note, here's a libvirt bug tracking roughly the same thing for virsh: https://bugzilla.redhat.com/show_bug.cgi?id=872166 And a closed virt-manager bug that's kinda related: https://bugzilla.redhat.com/show_bug.cgi?id=984092
Libvirt fixed this with patches here: https://www.redhat.com/archives/libvir-list/2016-February/msg00657.html Which could be inspiration for virt-manager support
Modern libvirt ships with a simple way to skip polkit password prompts: add your user to the 'libvirt' group. See: http://blog.wikichoon.com/2016/01/polkit-password-less-access-for-libvirt.html So that gives a supported way to avoid polkit handling. I'm fine pointing users to that option if they hit the root issue here, and saves us some virt-manager code that will only be used very rarely