Page MenuHomeSolus

virt-manager unable to connect to libvirt
Closed, ResolvedPublic

Description

I haven't used virt-manager for a while, so I don't know if this is something to do with me or the last update, but on trying to manually connect (a surprise because I had set it to connect automatically) I got the following error:

virt-manager unable to connect to libvirt qemu:///system
authentication unavailable: no polkit agent available to authenticate action 'org.libvirt,unix,mangage'
Details:

Unable to connect to libvirt qemu:///system.

authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'

Libvirt URI is: qemu:///system

Traceback (most recent call last):

File "/usr/share/virt-manager/virtManager/connection.py", line 956, in _do_open
  self._backend.open(connectauth.creds_dialog, self)
File "/usr/share/virt-manager/virtinst/connection.py", line 174, in open
  open_flags)
File "/usr/lib/python3.7/site-packages/libvirt.py", line 104, in openAuth
  if ret is None:raise libvirtError('virConnectOpenAuth() failed')

libvirt.libvirtError: authentication unavailable: no polkit agent available to authenticate action 'org.libvirt.unix.manage'

Having a look around /usr/share/polkit-1/ I have:

 ~  ls /usr/share/polkit-1/actions/*libvirt*
/usr/share/polkit-1/actions/org.libvirt.api.policy  /usr/share/polkit-1/actions/org.libvirt.unix.policy
 ~  1  sudo cat /usr/share/polkit-1/rules.d/50-libvirt.keyrules
[Policy]
Rules=libvirt.rules

[libvirt.rules]
Actions=org.libvirt.unix.manage
InUnixGroups=libvirt
Result=yes
~  sudo cat /usr/share/polkit-1/rules.d/50-libvirt.rules
// Allow any user in the 'libvirt' group to connect to system libvirtd
// without entering a password.

polkit.addRule(function(action, subject) {
    if (action.id == "org.libvirt.unix.manage" &&
        subject.isInGroup("libvirt")) {
        return polkit.Result.YES;
    }
});

Event Timeline

You may have removed polkit-gnome or switch to another windows manager like i3.
In the later case, you need to start the polkit agent on login in i3config

https://askubuntu.com/questions/799125/authentication-agent-and-i3wm

Schteve claimed this task.

Thanks. I hadn't realised I'd need to add that to the startup configuration.