Hide Forgot
+++ This bug was initially created as a clone of Bug #999291 +++ Can reproduce this on RHEL6.5 with: # rpm -qa libvirt virt-viewerlibvirt-0.10.2-22.el6.x86_64 virt-viewer-0.5.6-7.el6.x86_64 So clone the bug. Description of problem: Parameter "--attach", the results are the same whether I add it or not. And the man page makes me confused. Version-Release number of selected component (if applicable): # rpm -qa libvirt virt-viewer virt-viewer-0.5.7-1.el7.x86_64 libvirt-1.1.1-2.el7.x86_64 How reproducible: 100% Steps to Reproduce: 1. Check the man page : # man virt-viewer 2. Prepare a server with a running guest, configure tcp for libvirt authentication Server : 1)add configurations in /etc/libvirt/libvirtd.conf listen_tls = 0 listen_tcp = 1 auth_tcp = "sasl" 2) add sasl user # saslpasswd2 -a libvirt test (input your passwd) # sasldblistusers2 -f /etc/libvirt/passwd.db test.nay.redhat.com: userPassword 3) uncomment LIBVIRTD_ARGS="--listen" in /etc/sysconfig/libvirtd 4) restart libvirtd 3. On client: # virt-viewer -a -c qemu+tcp://$ip/system $vm # virt-viewer -c qemu+tcp://$ip/system $vm Actual results: 1. -a, --attach Use libvirt to directly attach to a local display, instead of making a TCP/UNIX socket connection. This avoids the need to authentication with the remote display, if authentication with libvirt is already allowed. This option does not work with remote displays. As the man pange says: This option does not work with remote displays. But if the option can only be used to the local guest, I think it's same with "virt-viewer $vm". And it's better to add an example here. 3. The results of two commands are same. An authentication required dialog will popup. Expected results: 1. The man page should be understand more easily. 2. virt-viewer can connect the guest directly with option '-a'. The authentication required dialog shouldn't popup Additional info:
(In reply to CongDong from comment #0) > 3. On client: > # virt-viewer -a -c qemu+tcp://$ip/system $vm Per the manpage --attach only works when using a local connection. ie you must be using qemu:///system or qemu:///session. Any use of +tcp or +tls or +ssh APIs will not work
(In reply to Daniel Berrange from comment #2) > (In reply to CongDong from comment #0) > Per the manpage --attach only works when using a local connection. ie you > must be using qemu:///system or qemu:///session. Any use of +tcp or +tls > or +ssh APIs will not work Hi, thanks for reply, but still have two problems: 1. I tried with local connection and remote guest both. virt-viewer -a -c qemu+tcp://$localip/system $vm virt-viewer -c qemu+tcp://$localip/system $vm Both of the two commands have same effect virt-viewer -a $guest virt-viewer $guest Both of the two commands have same effect too. As the result, I think the option is unless, so can you give me an example? I think should add one in man doc too. 2. In the manpage about "--attach": 1) This avoids the need to authentication with the remote display, if authentication with libvirt is already allowed. 2) This option does not work with remote displays. From the description in "1)", I think virt-viewer can connect the remote guest without authentication through "-a". But as the "2)" says, it can't be used with remote displays. It's conflict.
Can you run LIBVIRT_LOG_FILTERS=1:libvirt virt-viewer -c qemu:///system --attach --debug $guest and attach the output to this bug.
I expect when you run that command you'll see an error in the logs (virt-viewer:11573): virt-viewer-DEBUG: Error internal error: unable to execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS And if you do 'setenforce 0', then the error will go away & virt-viewer will do what it is supposed to do.
Created attachment 789402 [details] The virt-viewer log file (In reply to Daniel Berrange from comment #5) > I expect when you run that command you'll see an error in the logs > > (virt-viewer:11573): virt-viewer-DEBUG: Error internal error: unable to > execute QEMU command 'getfd': No file descriptor supplied via SCM_RIGHTS > > > And if you do 'setenforce 0', then the error will go away & virt-viewer > will do what it is supposed to do. Yes, I run the command and there is an error message like you said in the log file, and I run it again after "steenforce 0", the error message didn't appear. But virt-viewer can always connect the guest just like without "--attach".
The KVM in RHEL-6 does not provide the functionality required for the --attach argument to work.
(In reply to Daniel Berrange from comment #7) > The KVM in RHEL-6 does not provide the functionality required for the > --attach argument to work. If kvm in RHEL6 does not provide the function, I think should remove the options in virt-viewer.