Bug 711476

Summary: PolicyKit or Virt-Manager weird behavior when the current user is in wheel group
Product: [Fedora] Fedora Reporter: Othman Madjoudj <athmanem>
Component: virt-managerAssignee: Cole Robinson <crobinso>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: berrange, crobinso, davidz, hbrock, jforbes, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-06-26 16:03:46 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Othman Madjoudj 2011-06-07 15:22:13 UTC
Description of problem:
virt-manager worked fine until I add myself into wheel group (for sudo), 
now it complain about libvirtd not running because it can't authenticate, but 'Authentication dialog' never shown.

Version-Release number of selected component (if applicable):
polkit-0.101-6.fc15.x86_64
polkit-desktop-policy-0.101-6.fc15.noarch
polkit-gnome-0.101-1.fc15.x86_64


How reproducible:
100%

Steps to Reproduce:
1. Add the current user to wheel group
2. Run virt-manager.

Details:

$ virt-manager  --debug
[...SNIP...]
2011-06-06 12:54:54,429 (error:66): dialog message: Unable to open a 
connection to the libvirt management daemon.

Libvirt URI is: qemu:///system

Verify that:
  - The 'libvirtd' daemon has been started
  : authentication failed

Traceback (most recent call last):
   File "/usr/share/virt-manager/virtManager/connection.py", line 1055, 
in _try_open
     None], flags)
   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 107, in 
openAuth
     if ret is None:raise libvirtError('virConnectOpenAuth() failed')
libvirtError: authentication failed

2011-06-06 12:54:57,619 (engine:477): Exiting app normally.

$ virsh -c qemu:///system
error: authentication failed
error: failed to connect to the hypervisor

$ sudo virsh -c qemu:///system
[sudo] password for athmane:
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
        'quit' to quit

virsh #

$ sudo systemctl status libvirtd.service
libvirtd.service - LSB: daemon for libvirt virtualization API
	  Loaded: loaded (/etc/rc.d/init.d/libvirtd)
	  Active: active (running) since Mon, 06 Jun 2011 12:50:40 -0100; 12min ago
	 Process: 3452 ExecStop=/etc/rc.d/init.d/libvirtd stop (code=exited, 
status=0/SUCCESS)
	 Process: 3460 ExecStart=/etc/rc.d/init.d/libvirtd start (code=exited, 
status=0/SUCCESS)
	Main PID: 3468 (libvirtd)
	  CGroup: name=systemd:/system/libvirtd.service
		  ├ 1320 /usr/sbin/dnsmasq --strict-order --bind-interfaces...
		  └ 3468 libvirtd --daemon

Comment 1 Othman Madjoudj 2011-06-15 13:48:46 UTC
Sorry for wrong component, but it was suggested by Cole Robinson

http://lists.fedoraproject.org/pipermail/virt/2011-June/002701.html

Also this only does not happen with Gnome shell (I was using Fallback mode), I get a clutter-based authentication box for the current user with seems the expected behavior.

Comment 2 Othman Madjoudj 2011-06-18 22:47:35 UTC
The issue happen with PackageKit:

When a I try to apply new updates, an authentication failure message appear.

Note that this does not happen with Gnome shell.

NB.
I guess virt-manager is not the right component.

Comment 3 David Zeuthen 2011-06-20 15:16:48 UTC
(In reply to comment #2)
> The issue happen with PackageKit:
> 
> When a I try to apply new updates, an authentication failure message appear.
> 
> Note that this does not happen with Gnome shell.
> 
> NB.
> I guess virt-manager is not the right component.

The problem is probably that your desktop environment isn't starting a polkit authentication agent or the one that it is starting is buggy.

Comment 4 Othman Madjoudj 2011-06-20 22:42:48 UTC
polkit agent for gnome fallback 'polkit-gnome-authentication-agent-1' seems running and if I remove myself from 'wheel' group polkit-aware applications work as expected ie: authentication window appears and root privileges granted correctly.

ps aux | grep polkit
root      1026  0.0  0.1 186804  5884 ?        Sl   23:21   0:00 /usr/libexec/polkit-1/polkitd
athmane   2293  0.0  0.1 287152  4684 ?        Sl   23:25   0:00 /usr/libexec/polkit-gnome-authentication-agent-1
athmane   2766  0.0  0.0 108612   840 pts/0    S+   23:36   0:00 grep --color=auto polkit

Comment 5 Othman Madjoudj 2011-06-26 16:03:46 UTC
Fixed after yum reinstalled polkit* , so it seems to be an f14->f15 update regression