Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1441127 - Virt-manager can't connect to guest spice unix socket.
Virt-manager can't connect to guest spice unix socket.
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: virt-manager (Show other bugs)
7.4
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Pavel Hrdina
Virtualization Bugs
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-04-11 05:35 EDT by Fangge Jin
Modified: 2018-04-10 07:42 EDT (History)
6 users (show)

See Also:
Fixed In Version: virt-manager-1.4.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 07:40:46 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0726 None None None 2018-04-10 07:42 EDT

  None (edit)
Description Fangge Jin 2017-04-11 05:35:12 EDT
Description of problem:
Virt-manager can't connect to guest spice unix socket.

Version-Release number of selected component:
virt-manager-1.4.1-1.el7.noarch
libvirt-3.2.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
0. Set spice listen type='socket':
  # virsh edit rhel7.4
...
    <graphics type='spice'>
      <listen type='socket'/>
    </graphics>
...

1. Start guest
  # virsh start rhel7.4

2. Launch virt-manager on the same host and open guest window.
  # virt-manager

3. Launch virt-manager on a remote host and try to open guest window.

4.Check virt-manager.log
  # cat /root/.cache/virt-manager/virt-manager.log

Actual results:
1) virt-manager can connect to guest graphic on the same host, but I found "gsocket=None" in the log:

[Tue, 11 Apr 2017 16:42:05 virt-manager 10055] DEBUG (console:718) Starting connect process for proto=spice trans= connhost=127.0.0.1 connuser= connport= gaddr=127.0.0.1 gport=None gtlsport=None gsocket=None

2) If launch virt-manager on a remote host, it will fail to open guest window and reports:

"Error connecting to graphical console:
Guest is on a remote host, but is only configured to allow local file descriptor connections."

Expected results:
virt-manager can connect to guest spice unix socket.
Comment 2 zhoujunqin 2017-04-26 07:06:29 EDT
I can also reproduce this error when i connect to a spice guest which listen type equals none on a remote connection.

package version:
virt-manager-1.4.1-2.el7.noarch
libvirt-3.2.0-3.virtcov.el7.x86_64
qemu-kvm-rhev-2.9.0-1.el7.x86_64

Steps:
Need 2 hosts: HostA and HostB.

1. Prepare a spice guest with listen type equals none on HostA.
# virsh dumpxml esx6.0-rhel6.7-x86_64 --security-info
...
    <graphics type='spice'>
      <listen type='none'/>
    </graphics>
    <video>

2. Launch virt-manager on HostB, File->Add connection->Hypervisor choosing 'QEMU/KVM'->Tick 'Connect to remote host'->Method 'SSH'->Username: root ->Hostname: $host A ->Connect.

3. Open guest console 'esx6.0-rhel6.7-x86_64' on hostA.

Result after step3:
It will fail to open guest window and reports:

"Error connecting to graphical console:
Guest is on a remote host, but is only configured to allow local file
descriptor connections."
Comment 3 Fangge Jin 2017-04-26 07:18:23 EDT
(In reply to zhoujunqin from comment #2)
> I can also reproduce this error when i connect to a spice guest which listen
> type equals none on a remote connection.
> 
When listen type=none, graphic can't be opened on remote host, this is expected
Comment 4 zhoujunqin 2017-04-26 07:27:53 EDT
(In reply to JinFangge from comment #3)
> (In reply to zhoujunqin from comment #2)
> > I can also reproduce this error when i connect to a spice guest which listen
> > type equals none on a remote connection.
> > 
> When listen type=none, graphic can't be opened on remote host, this is
> expected

Yes, fjin, thanks for pointing out.
So please ignore Comment 2, thanks.
Comment 5 Pavel Hrdina 2017-09-06 04:37:36 EDT
Upstream patch posted:

https://www.redhat.com/archives/virt-tools-list/2017-September/msg00039.html
Comment 6 Pavel Hrdina 2017-09-11 03:38:33 EDT
Upstream commits:

commit ccaef8c16a89ad4ca64b07fd5f6cc6e91de3a15e
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Wed Sep 6 10:14:35 2017 +0200

    graphics: set default port only for correct listen types

commit fe6c5067c0d1fea786bb5255043a19d25249b65b
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Wed Sep 6 10:17:43 2017 +0200

    graphics: introduce listens.{type|address|network} parameters

commit d718f1a516757606093207190de6b10a40a47d1c
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Wed Sep 6 10:26:33 2017 +0200

    graphics: introduce listens.socket parameter

commit f1976155cd1711f5009d38b10bcf4bd511927608
Author: Pavel Hrdina <phrdina@redhat.com>
Date:   Wed Sep 6 09:24:53 2017 +0200

    sshtunnels: use <listen> element to get UNIX socket for graphics
Comment 8 zhoujunqin 2017-09-26 06:27:17 EDT
I can reproduce this issue with package:
virt-install-1.4.1-7.el7.noarch
virt-manager-1.4.1-7.el7.noarch
virt-manager-common-1.4.1-7.el7.noarch

Then try to verify this bug with new build:
virt-install-1.4.3-1.el7.noarch
virt-manager-1.4.3-1.el7.noarch
virt-manager-common-1.4.3-1.el7.noarch

Steps:
Need 2 hosts: HostA and HostB.


0. Set spice listen type='socket' to guest on HostA.
# virsh edit rhel7.4
...
    <graphics type='spice'>
      <listen type='socket'/>
    </graphics>
...

1. Start guest
# virsh start rhel7.4
 
# virsh dumpxml rhel7.4
...
    <graphics type='spice'>
      <listen type='socket' socket='/var/lib/libvirt/qemu/domain-30-rhel7.4/spice.sock'/>
    </graphics>
...

2. Launch virt-manager on HostA and open guest window.
# virt-manager

3. Launch virt-manager on HostB and try to open guest window.
File->Add connection->Hypervisor choosing 'QEMU/KVM'->Tick 'Connect to remote host'->Method 'SSH'->Username: root ->Hostname: $HostA ->Connect.

4. Open guest console 'rhel7.4' on HostA.

Result:
After step2, virt-manager can open guest console on HostA.
After step4, virt-manager can also open guest console on remote HostB.

Since we can connect to SPICE graphics on remote host using SSH tunnel, move this bug from ON_QA to VERIFIED, thanks.
Comment 11 errata-xmlrpc 2018-04-10 07:40:46 EDT
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/RHEA-2018:0726

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