retspen / webvirtmgr

WebVirtMgr panel for manage virtual machine
http://retspen.github.io
2.04k stars 536 forks source link

After login: "authentication failed: no agent is available to authenticate" #635

Open brianbauer42 opened 7 years ago

brianbauer42 commented 7 years ago

I've tried this a few times and keep running into an issue where I can log in to the webvirtmgr page, but it once I've added a local socket connection and attempted to enter, it displays this message: "authentication failed: no agent is available to authenticate". If I try to create a tcp connection to 127.0.0.1, the message is "authentication failed: authentication failed".

As shown in the snippet below, I can't connect from the terminal, either. EDIT: I can connect from the terminal (originally I forgot to include the domain on my username)

I am hosting webvirtmgr on the same machine I am using for virtualization. I have reproduced the issue several times, tried with nginx and apache, but I can't think of further ways to troubleshoot. I've seen references to polkit through googling error messages and so I tried adding rules, but I am not familiar with polkit and have not noticed any effects at all from those attempts.

It seems to be fully functional when using the command ./manage.py runserver 0.0.0.0:8181

[bbauer@webvirtmgr]:(0b)~$ sudo sasldblistusers2 -f /etc/libvirt/passwd.db
bbauer@webvirtmgr: userPassword

[bbauer@webvirtmgr]:(0b)~$ sudo virsh -c qemu+tcp://172.16.145.137/system nodeinfo
Please enter your authentication name: bbauer@webvirtmgr
Please enter your password:
CPU model:           x86_64
CPU(s):              2
CPU frequency:       3191 MHz
CPU socket(s):       2
Core(s) per socket:  1
Thread(s) per core:  1
NUMA cell(s):        1
Memory size:         2044856 KiB

[bbauer@webvirtmgr]:(0b)~$ sudo systemctl status libvirtd
● libvirtd.service - Virtualization daemon
   Loaded: loaded (/lib/systemd/system/libvirtd.service; enabled)
   Active: active (running) since Fri 2017-03-17 12:35:04 PDT; 5min ago
     Docs: man:libvirtd(8)
           http://libvirt.org
 Main PID: 551 (libvirtd)
   CGroup: /system.slice/libvirtd.service
           ├─551 /usr/sbin/libvirtd -l
           ├─743 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default_replacement.conf --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper
           └─744 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default_replacement.conf --dhcp-script=/usr/lib/libvirt/libvirt_leaseshelper

Mar 17 12:40:05 webvirtmgr libvirtd[551]: End of file while reading data: Input/output error
Mar 17 12:40:13 webvirtmgr libvirtd[551]: authentication failed: no agent is available to authenticate
Mar 17 12:40:13 webvirtmgr libvirtd[551]: End of file while reading data: Input/output error
Mar 17 12:40:14 webvirtmgr libvirtd[551]: authentication failed: Failed to start SASL negotiation: -20 (SASL(-13): user not found: unable to canonify user and get auxprops)
Mar 17 12:40:14 webvirtmgr libvirtd[551]: authentication failed: authentication failed
Mar 17 12:40:14 webvirtmgr libvirtd[551]: End of file while reading data: Input/output error
Mar 17 12:40:22 webvirtmgr libvirtd[551]: authentication failed: no agent is available to authenticate
Mar 17 12:40:22 webvirtmgr libvirtd[551]: End of file while reading data: Input/output error
Mar 17 12:40:29 webvirtmgr libvirtd[551]: authentication failed: no agent is available to authenticate
Mar 17 12:40:29 webvirtmgr libvirtd[551]: End of file while reading data: Input/output error
brianbauer42 commented 7 years ago

In /etc/libvirt/libvirtd.conf I can uncomment auth_unix_rw = 'none' to get around polkit and everything seems to work.auth_tcp is still set to "sasl". Is the system considered relatively safe to use at this point? My permissions are based entirely on my linux user and the socket permissions? Is anything going over the network in plaintext that I need to worry about? If not I think I'm fine with this.