Description of problem: virt-manager cannot display console on remote ssh+qemu when spice is listening on 0.0.0.0 Version-Release number of selected component (if applicable): Local: virt-manager-1.0.1-3.fc20.noarch Remote: libvirt-daemon-1.1.3.5-2.fc20.x86_64 How reproducible: Always Steps to Reproduce: 1. Create guest on remote KVM; create remote user with polkit libvirt authorization. Local user can use password-less ssh to remote myuser@remote hypervisor. The remote user has polkit org.libvirt.unix.manage permissions. virsh -c qemu+ssh://myuser@remote/system list virsh -c qemu+ssh://myuser@remote/system edit myguest works 2. Connect by virt-manager/virt-viewer to qemu+ssh://myuser@remote/system myguest or virt-viewer Relevant XML: <graphics type='spice' autoport='yes' listen='0.0.0.0'> <listen type='address' address='0.0.0.0'/> </graphics> 3. Actual results: 1. Able to connect to remote hypervisor and configure guest. 2. However the console shows: Error: viewer connection to hypervisor host got refused on disconnected! Expected results: Guest console displayed in virt-manager console pane. Using virt-viewer: Unable to connect to the graphic server localhost 5900 (virt-viewer:26538): virt-viewer-DEBUG: Insert window 0 0x12e78c0 (virt-viewer:26538): virt-viewer-DEBUG: Insert window 1 0x12e7980 (virt-viewer:26538): virt-viewer-DEBUG: fullscreen display 0: 0 (virt-viewer:26538): virt-viewer-DEBUG: fullscreen display 1: 0 (virt-viewer:26538): virt-viewer-DEBUG: connecting ... (virt-viewer:26538): virt-viewer-DEBUG: Opening connection to libvirt with URI sleet (virt-viewer:26538): virt-viewer-DEBUG: Add handle 12 1 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: initial connect (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de200 (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de5c0 (virt-viewer:26538): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de200 (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de5c0 (virt-viewer:26538): virt-viewer-DEBUG: Guest myguest is running, determining display (virt-viewer:26538): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0 (virt-viewer:26538): virt-viewer-DEBUG: Guest myguest has a spice display (virt-viewer:26538): virt-viewer-DEBUG: Guest graphics address is 0.0.0.0:5900 (virt-viewer:26538): virt-viewer-DEBUG: Guest graphics listen '0.0.0.0' is NULL or a wildcard, replacing with 'localhost' (virt-viewer:26538): virt-viewer-DEBUG: Set connect info: remote,localhost,5900,-1,ssh,(null),myuser,0 (virt-viewer:26538): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26538): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26538): virt-viewer-DEBUG: Opening indirect TCP connection to display at localhost:5900 (virt-viewer:26538): virt-viewer-DEBUG: Setting up SSH tunnel via myuser@remote (virt-viewer:26538): virt-viewer-DEBUG: New spice channel 0x14ad7b0 SpiceMainChannel 0 (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de200 (virt-viewer:26538): virt-viewer-DEBUG: notebook show status 0x12de5c0 (virt-viewer:26538): virt-viewer-DEBUG: Add timeout 0x13e4070 -1 0x7f72a7814d00 0x119df90 1 Ncat: Connection refused. (virt-viewer:26538): GSpice-WARNING **: incomplete link header (0/16) (virt-viewer:26538): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26538): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26538): GSpice-WARNING **: incomplete link header (0/16) Ncat: Connection refused. (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 1 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 2 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 1 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 2 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 1 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 2 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 1 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Dispatch handler 12 2 0x10fbbb0 (virt-viewer:26538): virt-viewer-DEBUG: Remove timeout 0x13e4070 1 (virt-viewer:26538): virt-viewer-DEBUG: Remove handle 1 12 (virt-viewer:26538): virt-viewer-DEBUG: Disposing window 0x12e78c0 (virt-viewer:26538): virt-viewer-DEBUG: Disposing window 0x12e7980 (virt-viewer:26538): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0 Additional info: If listen="127.0.0.1", then virt-viewer succeeds but virt-manager fails. If listen="1.2.3.4", one of the IP addresses, (the remote KVM has two physical NICs/IP Addresses), then both virt-viewer and virt-manager succeed.
If listen=127.0.0.1 virt-viewer succeeds: [richard@amadeus ~]$ virt-viewer --debug -c sleet myguest (virt-viewer:26728): virt-viewer-DEBUG: Insert window 0 0x14078c0 (virt-viewer:26728): virt-viewer-DEBUG: Insert window 1 0x1407980 (virt-viewer:26728): virt-viewer-DEBUG: fullscreen display 0: 0 (virt-viewer:26728): virt-viewer-DEBUG: fullscreen display 1: 0 (virt-viewer:26728): virt-viewer-DEBUG: connecting ... (virt-viewer:26728): virt-viewer-DEBUG: Opening connection to libvirt with URI sleet (virt-viewer:26728): virt-viewer-DEBUG: Add handle 12 1 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: initial connect (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f25c0 (virt-viewer:26728): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f25c0 (virt-viewer:26728): virt-viewer-DEBUG: Guest myguest is running, determining display (virt-viewer:26728): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0 (virt-viewer:26728): virt-viewer-DEBUG: Guest myguest has a spice display (virt-viewer:26728): virt-viewer-DEBUG: Guest graphics address is 127.0.0.1:5900 (virt-viewer:26728): virt-viewer-DEBUG: Set connect info: remote,127.0.0.1,5900,-1,ssh,(null),myuser,0 (virt-viewer:26728): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26728): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26728): virt-viewer-DEBUG: Opening indirect TCP connection to display at 127.0.0.1:5900 (virt-viewer:26728): virt-viewer-DEBUG: Setting up SSH tunnel via myuser@remote (virt-viewer:26728): virt-viewer-DEBUG: New spice channel 0x15c17b0 SpiceMainChannel 0 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f25c0 (virt-viewer:26728): virt-viewer-DEBUG: Add timeout 0x15bbfc0 -1 0x7ff3c8d91d00 0x12b0590 1 (virt-viewer:26728): virt-viewer-DEBUG: main channel: opened (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f25c0 (virt-viewer:26728): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26728): virt-viewer-DEBUG: app is not in full screen (virt-viewer:26728): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26728): virt-viewer-DEBUG: app is not in full screen (virt-viewer:26728): virt-viewer-DEBUG: New spice channel 0x16375f0 SpiceCursorChannel 0 (virt-viewer:26728): virt-viewer-DEBUG: New spice channel 0x1665a50 SpiceDisplayChannel 0 (virt-viewer:26728): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26728): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26728): virt-viewer-DEBUG: New spice channel 0x165fa10 SpiceInputsChannel 0 (virt-viewer:26728): virt-viewer-DEBUG: new inputs channel (virt-viewer:26728): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26728): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26728): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26728): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26728): virt-viewer-DEBUG: creating spice display (#:0) (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: Preparing main window resize (virt-viewer:26728): virt-viewer-DEBUG: Decided todo 720x400 (desktop is 720x400, fullscreen is 1920x1080 (virt-viewer:26728): virt-viewer-DEBUG: notebook show display 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: Allocated 720x400 (virt-viewer:26728): virt-viewer-DEBUG: Child allocate 720x400 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show display 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: notebook show display 0x13f2200 (virt-viewer:26728): virt-viewer-DEBUG: Preparing main window resize (virt-viewer:26728): virt-viewer-DEBUG: Decided todo 1024x768 (desktop is 1024x768, fullscreen is 1920x1080 (virt-viewer:26728): virt-viewer-DEBUG: creating spice display (#:1) (virt-viewer:26728): virt-viewer-DEBUG: Allocated 228x100 (virt-viewer:26728): virt-viewer-DEBUG: Child allocate 100x100 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f25c0 (virt-viewer:26728): virt-viewer-DEBUG: creating spice display (#:2) (virt-viewer:26728): virt-viewer-DEBUG: Insert window 2 0x1407f80 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2980 (virt-viewer:26728): virt-viewer-DEBUG: creating spice display (#:3) (virt-viewer:26728): virt-viewer-DEBUG: Insert window 3 0x16ae8b0 (virt-viewer:26728): virt-viewer-DEBUG: notebook show status 0x13f2d40 (virt-viewer:26728): virt-viewer-DEBUG: Allocated 1024x768 (virt-viewer:26728): virt-viewer-DEBUG: Child allocate 1024x768 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 1 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 2 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 1 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 2 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 1 0x120fbb0 (virt-viewer:26728): virt-viewer-DEBUG: Dispatch handler 12 2 0x120fbb0
Using listen=<any_routable_ip_address_from_local> on the remote domain, means that both virt-manager and virt-viewer work. Remote KVM has two NICs. listen=192.168.1.6 OR listen=10.0.0.6 work from the virt client side (both virt-manager, virt-viewer)
virt-viewer when spice is listening on a physical nic ip address: virt-viewer --debug -c sleet sirius (virt-viewer:26962): virt-viewer-DEBUG: Insert window 0 0x10e50c0 (virt-viewer:26962): virt-viewer-DEBUG: Insert window 1 0x10e5180 (virt-viewer:26962): virt-viewer-DEBUG: fullscreen display 0: 0 (virt-viewer:26962): virt-viewer-DEBUG: fullscreen display 1: 0 (virt-viewer:26962): virt-viewer-DEBUG: connecting ... (virt-viewer:26962): virt-viewer-DEBUG: Opening connection to libvirt with URI sleet (virt-viewer:26962): virt-viewer-DEBUG: Add handle 12 1 0xed0bb0 (virt-viewer:26962): virt-viewer-DEBUG: initial connect (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b35c0 (virt-viewer:26962): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b35c0 (virt-viewer:26962): virt-viewer-DEBUG: Guest sirius is running, determining display (virt-viewer:26962): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0 (virt-viewer:26962): virt-viewer-DEBUG: Guest myguest has a spice display (virt-viewer:26962): virt-viewer-DEBUG: Guest graphics address is 10.0.0.6:5900 (virt-viewer:26962): virt-viewer-DEBUG: Set connect info: remote,10.0.0.6,5900,-1,ssh,(null),myuser,0 (virt-viewer:26962): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26962): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26962): virt-viewer-DEBUG: Opening indirect TCP connection to display at 10.0.0.6:5900 (virt-viewer:26962): virt-viewer-DEBUG: Setting up SSH tunnel via myuser@remote (virt-viewer:26962): virt-viewer-DEBUG: New spice channel 0x12823e0 SpiceMainChannel 0 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b35c0 (virt-viewer:26962): virt-viewer-DEBUG: Add timeout 0x11c5a10 -1 0x7fc111a73d00 0x1041870 1 (virt-viewer:26962): virt-viewer-DEBUG: main channel: opened (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b35c0 (virt-viewer:26962): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26962): virt-viewer-DEBUG: app is not in full screen (virt-viewer:26962): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:26962): virt-viewer-DEBUG: app is not in full screen (virt-viewer:26962): virt-viewer-DEBUG: New spice channel 0x1327ef0 SpiceCursorChannel 0 (virt-viewer:26962): virt-viewer-DEBUG: New spice channel 0x1324450 SpiceDisplayChannel 0 (virt-viewer:26962): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26962): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26962): virt-viewer-DEBUG: New spice channel 0x1324e90 SpiceInputsChannel 0 (virt-viewer:26962): virt-viewer-DEBUG: new inputs channel (virt-viewer:26962): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26962): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26962): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:26962): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:26962): virt-viewer-DEBUG: creating spice display (#:0) (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: creating spice display (#:1) (virt-viewer:26962): virt-viewer-DEBUG: Allocated 228x100 (virt-viewer:26962): virt-viewer-DEBUG: Child allocate 100x100 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b35c0 (virt-viewer:26962): virt-viewer-DEBUG: creating spice display (#:2) (virt-viewer:26962): virt-viewer-DEBUG: Insert window 2 0x10e56c0 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3980 (virt-viewer:26962): virt-viewer-DEBUG: creating spice display (#:3) (virt-viewer:26962): virt-viewer-DEBUG: Insert window 3 0x10e5780 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3d40 (virt-viewer:26962): virt-viewer-DEBUG: notebook show status 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: Preparing main window resize (virt-viewer:26962): virt-viewer-DEBUG: Decided todo 1024x768 (desktop is 1024x768, fullscreen is 1920x1080 (virt-viewer:26962): virt-viewer-DEBUG: notebook show display 0x10b3200 (virt-viewer:26962): virt-viewer-DEBUG: Allocated 1024x768 (virt-viewer:26962): virt-viewer-DEBUG: Child allocate 1024x768 (virt-viewer:26962): virt-viewer-DEBUG: Dispatch handler 12 1 0xed0bb0 (virt-viewer:26962): virt-viewer-DEBUG: Dispatch handler 12 2 0xed0bb0 (virt-viewer:26962): virt-viewer-DE
Please provide virt-manager --debug output when reproducing the connection failure
Unsuccessful virt-manager with listen=0.0.0.0: [Mon, 07 Jul 2014 20:11:05 virt-manager 30904] DEBUG (connection:891) Using domain events [Mon, 07 Jul 2014 20:11:05 virt-manager 30904] DEBUG (connection:925) Error registering network events: 'virConnect' object has no attribute 'networkEventRegisterAny' [Mon, 07 Jul 2014 20:11:06 virt-manager 30904] DEBUG (connection:218) Using libvirt API for netdev enumeration [Mon, 07 Jul 2014 20:11:06 virt-manager 30904] DEBUG (connection:240) Using libvirt API for mediadev enumeration [Mon, 07 Jul 2014 20:11:21 virt-manager 30904] DEBUG (details:718) Showing VM details: <vmmDomain object at 0x7f92cc04bf50 (virtManager+domain+vmmDomain at 0x2799fa0)> [Mon, 07 Jul 2014 20:11:21 virt-manager 30904] DEBUG (engine:358) window counter incremented to 2 [Mon, 07 Jul 2014 20:11:23 virt-manager 30904] DEBUG (engine:1041) Starting vm 'sirius' [Mon, 07 Jul 2014 20:11:23 virt-manager 30904] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x3777aa0> [Mon, 07 Jul 2014 20:11:24 virt-manager 30904] DEBUG (console:1494) Starting connect process for proto=spice trans=None connhost=127.0.0.1 connuser=None connport=None gaddr=0.0.0.0 gport=5900 gtlsport=None gsocket=None (virt-manager:30904): GSpice-WARNING **: Could not connect to 127.0.0.1: Connection refused [Mon, 07 Jul 2014 20:11:24 virt-manager 30904] DEBUG (console:658) Spice channel event error: <enum SPICE_CHANNEL_ERROR_CONNECT of type SpiceChannelEvent> [Mon, 07 Jul 2014 20:11:24 virt-manager 30904] DEBUG (console:1373) Viewer disconnected [Mon, 07 Jul 2014 20:12:28 virt-manager 30904] DEBUG (engine:1088) Shutting down vm 'sirius' [Mon, 07 Jul 2014 20:12:28 virt-manager 30904] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x3777aa0> [Mon, 07 Jul 2014 20:12:29 virt-manager 30904] DEBUG (console:1494) Starting connect process for proto=spice trans=None connhost=127.0.0.1 connuser=None connport=None gaddr=0.0.0.0 gport=5900 gtlsport=None gsocket=None (virt-manager:30904): GSpice-WARNING **: Could not connect to 127.0.0.1: Connection refused [Mon, 07 Jul 2014 20:12:30 virt-manager 30904] DEBUG (console:658) Spice channel event error: <enum SPICE_CHANNEL_ERROR_CONNECT of type SpiceChannelEvent> [Mon, 07 Jul 2014 20:12:30 virt-manager 30904] DEBUG (console:1373) Viewer disconnected ~ Successful virt-manager with listen=192.168.1.6: [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:891) Using domain events [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:925) Error registering network events: 'virConnect' object has no attribute 'networkEventRegisterAny' [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:218) Using libvirt API for netdev enumeration [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:240) Using libvirt API for mediadev enumeration [Mon, 07 Jul 2014 20:16:20 virt-manager 31030] DEBUG (details:718) Showing VM details: <vmmDomain object at 0x7fd2c8050f50 (virtManager+domain+vmmDomain at 0x1eedc60)> [Mon, 07 Jul 2014 20:16:20 virt-manager 31030] DEBUG (engine:358) window counter incremented to 2 [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (engine:1041) Starting vm 'sirius' [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x2eeaaa0> [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (console:1494) Starting connect process for proto=spice trans=None connhost=127.0.0.1 connuser=None connport=None gaddr=192.168.1.6 gport=5900 gtlsport=None gsocket=None [Mon, 07 Jul 2014 20:16:23 virt-manager 31030] DEBUG (console:1401) Viewer connected
Unsuccessful virt-manager with listen=0.0.0.0: [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:891) Using domain events [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:925) Error registering network events: 'virConnect' object has no attribute 'networkEventRegisterAny' [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:218) Using libvirt API for netdev enumeration [Mon, 07 Jul 2014 20:16:16 virt-manager 31030] DEBUG (connection:240) Using libvirt API for mediadev enumeration [Mon, 07 Jul 2014 20:16:20 virt-manager 31030] DEBUG (details:718) Showing VM details: <vmmDomain object at 0x7fd2c8050f50 (virtManager+domain+vmmDomain at 0x1eedc60)> [Mon, 07 Jul 2014 20:16:20 virt-manager 31030] DEBUG (engine:358) window counter incremented to 2 [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (engine:1041) Starting vm 'sirius' [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (asyncjob:194) Creating async job for function cb=<function tmpcb at 0x2eeaaa0> [Mon, 07 Jul 2014 20:16:22 virt-manager 31030] DEBUG (console:1494) Starting connect process for proto=spice trans=None connhost=127.0.0.1 connuser=None connport=None gaddr=192.168.1.6 gport=5900 gtlsport=None gsocket=None [Mon, 07 Jul 2014 20:16:23 virt-manager 31030] DEBUG (console:1401) Viewer connected [Mon, 07 Jul 2014 20:17:55 virt-manager 31030] DEBUG (console:1373) Viewer disconnected [Mon, 07 Jul 2014 20:18:23 virt-manager 31030] DEBUG (console:1494) Starting connect process for proto=spice trans=None connhost=127.0.0.1 connuser=None connport=None gaddr=127.0.0.1 gport=5900 gtlsport=None gsocket=None (virt-manager:31030): GSpice-WARNING **: Could not connect to 127.0.0.1: Connection refused [Mon, 07 Jul 2014 20:18:23 virt-manager 31030] DEBUG (console:658) Spice channel event error: <enum SPICE_CHANNEL_ERROR_CONNECT of type SpiceChannelEvent> [Mon, 07 Jul 2014 20:18:23 virt-manager 31030] DEBUG (console:1373) Viewer disconnected
Full --debug output is preferred, from starting the app to shutting down. what's the actual libvirt URI you are using? when virt-manager sees 0.0.0.0 in the XML, it tries to connect to the hostname/IP from the libvirt URI for connecting to VNC/spice. In that debug output, it's resolving the hostname as 127.0.0.1/localhost. However trying to connect to localhost fails. So I can't tell if it's virt-manager making a wrong assumption, or a confusing libvirt URI, or bad host network configuration.
My bad: virt-manager works: it was due to a firewalld misconfiguration. virt-manager -c qemu+ssh://virtuser.1.6/system --debug It is virt-viewer that is not working remotely. I have disabled firewalld between the two hosts. virt-viewer -c qemu+ssh://virtuser.1.6/system --debug sirius (virt-viewer:8199): virt-viewer-DEBUG: Insert window 0 0xefe0c0 (virt-viewer:8199): virt-viewer-DEBUG: Insert window 1 0xefe180 (virt-viewer:8199): virt-viewer-DEBUG: fullscreen display 0: 0 (virt-viewer:8199): virt-viewer-DEBUG: fullscreen display 1: 0 (virt-viewer:8199): virt-viewer-DEBUG: connecting ... (virt-viewer:8199): virt-viewer-DEBUG: Opening connection to libvirt with URI qemu+ssh://virtuser.1.6/system (virt-viewer:8199): virt-viewer-DEBUG: Add handle 12 1 0xcf0bb0 (virt-viewer:8199): virt-viewer-DEBUG: initial connect (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed3200 (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed35c0 (virt-viewer:8199): virt-viewer-DEBUG: virt_viewer_app_set_uuid_string: UUID changed to b895fe87-95ef-4d3c-8ba4-720a9ecf5bf6 (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed3200 (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed35c0 (virt-viewer:8199): virt-viewer-DEBUG: Guest sirius is running, determining display (virt-viewer:8199): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0 (virt-viewer:8199): virt-viewer-DEBUG: Guest sirius has a spice display (virt-viewer:8199): virt-viewer-DEBUG: Guest graphics address is 0.0.0.0:5900 (virt-viewer:8199): virt-viewer-DEBUG: Guest graphics listen '0.0.0.0' is NULL or a wildcard, replacing with 'localhost' (virt-viewer:8199): virt-viewer-DEBUG: Set connect info: 192.168.1.6,localhost,5900,-1,ssh,(null),virtuser,0 (virt-viewer:8199): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:8199): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:8199): virt-viewer-DEBUG: Opening indirect TCP connection to display at localhost:5900 (virt-viewer:8199): virt-viewer-DEBUG: Setting up SSH tunnel via virtuser.1.6 (virt-viewer:8199): virt-viewer-DEBUG: New spice channel 0x10a23b0 SpiceMainChannel 0 (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed3200 (virt-viewer:8199): virt-viewer-DEBUG: notebook show status 0xed35c0 (virt-viewer:8199): virt-viewer-DEBUG: Add timeout 0xe558c0 -1 0x7fa6a2972d00 0xfc72c0 1 Ncat: Connection refused. (virt-viewer:8199): GSpice-WARNING **: incomplete link header (0/16) (virt-viewer:8199): virt-viewer-DEBUG: Error operation virDomainOpenGraphics forbidden for read only access (virt-viewer:8199): virt-viewer-DEBUG: After open connection callback fd=-1 (virt-viewer:8199): GSpice-WARNING **: incomplete link header (0/16) Ncat: Connection refused. (virt-viewer:8199): virt-viewer-DEBUG: Remove timeout 0xe558c0 1 (virt-viewer:8199): virt-viewer-DEBUG: Remove handle 1 12 (virt-viewer:8199): virt-viewer-DEBUG: Disposing window 0xefe0c0 (virt-viewer:8199): virt-viewer-DEBUG: Disposing window 0xefe180 (virt-viewer:8199): virt-viewer-DEBUG: Set connect info: (null),(null),(null),-1,(null),(null),(null),0
Created attachment 916338 [details] Virt-manager log: successful connection (after firewall disabled) This is a *successful* remote connection. Forgot to disable firewalld.
Created attachment 916339 [details] virt-viewer log: unsuccessful connection Unsuccessful connection using virt-viewer. Firewalld disabled.
Oh cr*p. The localhost/IPv6 issue is the root cause. Either commenting out the line in /etc/hosts ##::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 or forcing ncat to use ipv4 works. mv /bin/ncat /bin/ncat.real cat > /bin/ncat <<EOF #! /bin/sh exec /bin/ncat.real -4 $* EOF Is there a recommended workaround for this behaviour?
As mentioned, in virt-manager we don't open an ssh tunnel if the guest is advertising a non-localhost listening address, we just try and connect directly to that. maybe virt-viewer should do the same. Moving to virt-viewer Not sure about the ipv6 localhost issue though
I've having the same issue connecting to both RHEL 6.5 and 6.6 guests from a Fedora 20 laptop. I tried commenting out ::1 in /etc/hosts, as per comment 11, but it didn't work for me. I restarted libvirtd on the host. For good measure, I did the same on my laptop as well.
I should mention that my VMs are using VNC, not spice.
I did some more digging and found that virt-manager can connect to the VM if it's listening on 127.0.0.1, but not 0.0.0.0. Same VM, change only this listen value, and I can reliably break/fix the problem. A very odd thing though is that, when virt-manager fails to connect, virt-viewer does connect fine. So this seems to be an issue inside virt-manager itself, so far as I can tell.
This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.