Bug 1377100 - Virt-viewer can't connect to guest graphic with non-root user and vnc listening on unix socket
Summary: Virt-viewer can't connect to guest graphic with non-root user and vnc listeni...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-viewer
Version: 7.3
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Pavel Grunt
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1377214
TreeView+ depends on / blocked
 
Reported: 2016-09-18 12:18 UTC by Fangge Jin
Modified: 2017-08-01 15:04 UTC (History)
7 users (show)

Fixed In Version: virt-viewer-2.0-13.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1377214 (view as bug list)
Environment:
Last Closed: 2017-08-01 15:04:11 UTC
Target Upstream Version:


Attachments (Terms of Use)
virt-viewer log when connecting with non-root user (5.29 KB, text/plain)
2016-09-18 12:18 UTC, Fangge Jin
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:1849 0 normal SHIPPED_LIVE virt-viewer bug fix and enhancement update 2017-08-01 17:49:46 UTC

Description Fangge Jin 2016-09-18 12:18:56 UTC
Created attachment 1202193 [details]
virt-viewer log when connecting with non-root user

Description of problem:
Start a guest with vnc listens on a unix socket. In another terminal, login as non-root user, and use virt-viewer to connect to guest, it displays "Checking guest domain status" forever.

$ virt-viewer -c qemu:///system rhel7.3-0817 --debug 

......
(virt-viewer:7348): virt-viewer-DEBUG: After open connection callback fd=-1
(virt-viewer:7348): virt-viewer-DEBUG: Opening direct UNIX connection to display at /var/lib/libvirt/qemu/domain-91-rhel7.3-0817/vnc.sock
(virt-viewer:7348): virt-viewer-DEBUG: Guest rhel7.3-0817 has not activated its display yet, waiting for it to start


Version-Release number of selected component (if applicable):
libvirt-2.0.0-9.el7.x86_64
virt-viewer-2.0-12.el7.x86_64
qemu-kvm-rhev-2.6.0-25.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Start a guest with vnc listens on unix socket:
  # virsh dumpxml rhel7.3-0817
      <graphics type='vnc' socket='/var/lib/libvirt/qemu/domain-91-rhel7.3-0817/vnc.sock'>
      <listen type='socket' socket='/var/lib/libvirt/qemu/domain-91-rhel7.3-0817/vnc.sock'/>
    </graphics>

  Qemu command line:
 ...-vnc unix:/var/lib/libvirt/qemu/domain-91-rhel7.3-0817/vnc.sock...

2.Switch to non-root user, and use virt-viewer to connect guest:
  $ virt-viewer -c qemu:///system rhel7.3-0817 --debug


Actual results:
Virt-viewer can't connect to guest graphic with non-root user and vnc listening on unix socket

Expected results:
Virt-viewer can connect to guest graphic with non-root user and vnc listening on unix socket


Additional info:
1. Swith to root user, and use virt-viewer to connect guest, it can open guest graphic successfully:
  # virt-viewer -c qemu:///system rhel7.3-0817

2. Change the vnc listen type to address, virt-viewer can open guest graphic correctly with non-root user

Comment 2 Pavel Grunt 2016-10-05 07:08:21 UTC
The socket is created with the root user, the "normal" user doesn't have permissions to it:

(virt-viewer:6196): virt-viewer-DEBUG: Error operation forbidden: read only access prevents virDomainOpenGraphicsFD

The only thing which can be considered as a bug is a not clear message to the user

Comment 3 Pavel Grunt 2016-10-05 09:31:39 UTC
Posted patch to show a dialog with the reason of the failure:
https://www.redhat.com/archives/virt-tools-list/2016-October/msg00003.html

Comment 5 Xiaodai Wang 2017-03-20 08:35:17 UTC
I verified with virt-viewer-5.0-2.el7.x86_64.

when connect to a guest which listen a socket in qemu:///system by normal user,

"Failed to connect: Connecting to unix socket failed: Permission denied" error pops up.

So move the bug from ON_QA to VERIFIED.

Comment 6 errata-xmlrpc 2017-08-01 15:04:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1849


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