Bug 873799 - RFE: Have virt-manager register a simple polkit agent if none is detected at runtime
Summary: RFE: Have virt-manager register a simple polkit agent if none is detected at ...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Virtualization Tools
Classification: Community
Component: virt-manager
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Cole Robinson
QA Contact:
URL:
Whiteboard:
: 1004775 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-06 18:24 UTC by Mads Kiilerich
Modified: 2017-03-29 17:33 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-03-29 17:33:38 UTC
Embargoed:


Attachments (Terms of Use)

Description Mads Kiilerich 2012-11-06 18:24:13 UTC
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

Comment 1 Cole Robinson 2012-12-16 23:21:31 UTC
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.

Comment 2 Cole Robinson 2013-09-05 14:53:41 UTC
*** Bug 1004775 has been marked as a duplicate of this bug. ***

Comment 3 Cole Robinson 2015-11-02 01:21:40 UTC
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

Comment 4 Cole Robinson 2016-04-26 21:47:11 UTC
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

Comment 5 Cole Robinson 2017-03-29 17:33:38 UTC
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


Note You need to log in before you can comment on or make changes to this bug.