NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.39k stars 14.34k forks source link

gnome-boxes fails to connect to system VMs #76586

Open kamidon opened 4 years ago

kamidon commented 4 years ago

Describe the bug When gnome-boxes attempts to connect to a QEMU system VM after starting it, the connection fails. I can connect to the started VM using virt-viewer -c qemu:///system -a and selecting the started VM from the dialog that appears.

To Reproduce Steps to reproduce the behavior:

  1. Create a system VM (e.g. using virsh -c qemu:///system ...)
  2. Open gnome-boxes and click on the VM to start it and attempt to connect to the display using spice.
  3. Observe the error Connection to "<vm name>" failed.

NOTE: this only happens with system VMs. User VMs work fine.

Expected behavior The display of the VM is shown in the gnome-boxes window.

Additional context

Running gnome-boxes as gnome-boxes --spice-debug while following the reproduction procedure produces the following output:

(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.695: ../src/spice-session.c:288 New session (compiled from package spice-gtk 0.37)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.695: ../src/spice-session.c:292 Supported channels: main, display, inputs, cursor, playback, record, smartcard, usbredir, webdav
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.695: ../src/usb-device-manager.c:485 auto-connect filter set to 0x03,-1,-1,-1,0|-1,-1,-1,-1,1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.726: ../src/spice-session.c:1814 no migration in progress
Spice-INFO: 11:45:18.727: ../src/channel-main.c:334:spice_main_set_property: SpiceMainChannel::color-depth has been deprecated. Property is ignored
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.727: ../src/spice-channel.c:141 main-1:0: spice_channel_constructed
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.727: ../src/spice-session.c:2309 main-1:0: new main channel, switching
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.727: ../src/spice-gtk-session.c:1089 Changing main channel from (nil) to 0x1ebd4b0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 1d50:6028 (0x1c28280)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 1050:0407 (0x1c27240)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 056a:0020 (0x1c26120)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 0424:4064 (0x18dc8e0)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 046d:082d (0x1c246a0)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 17e9:4307 (0x18efdc0)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 8087:0a2b (0x18e6f20)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/usb-device-manager.c:953 device added 5986:1111 (0x1c3e2a0)
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2707 main-1:0: Open coroutine starting 0x1ebd4b0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2544 main-1:0: Started background coroutine 0x1ebcb30
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-session.c:2232 Missing port value, not attempting unencrypted connection.
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2570 main-1:0: trying with TLS port
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-session.c:2232 Missing port value, not attempting TLS connection.
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2574 main-1:0: Connect error
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2680 main-1:0: Coroutine exit main-1:0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2871 main-1:0: reset 
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/channel-main.c:1550 agent connected: no
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2819 main-1:0: channel reset
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-channel.c:2425 main-1:0: Delayed unref channel 0x1ebd4b0
Boxes-Message: 11:45:18.746: machine.vala:218: display Keith's Windows10 VM disconnected
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.747: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.747: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.747: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.747: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.747: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:356 0:0 keypress-delay is set to 100 ms
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:2546 0:0 mouse mode 0 (unknown)

(gnome-boxes:23267): GSpice-WARNING **: 11:45:18.748: (../src/spice-widget.c:2561):update_mouse_mode: code should not be reached
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:1300 0:0 recalc geom monitor: 0:0, guest +0+0:0x0, window 0x0, zoom 1
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-session.c:2006 session: disconnecting 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:445 0:0 spice display dispose
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.748: ../src/spice-widget.c:464 0:0 Finalize spice display
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-session.c:2349 main-1:0: the session lost the main channel
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-channel.c:2888 main-1:0: channel disconnect 0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-channel.c:159 main-1:0: spice_channel_dispose 0x1ebd4b0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-channel.c:2888 main-1:0: channel disconnect 12
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-channel.c:177 main-1:0: spice_channel_finalize 0x1ebd4b0
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-session.c:1814 no migration in progress
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-session.c:332 session dispose
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-session.c:1814 no migration in progress
(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.758: ../src/spice-gstaudio.c:77 spice_gstaudio_dispose

From this log, it appears that gnome-boxes is concluding that it must connect over an IP connection but that it does not have the required ports to connect to for either an unencrypted or encrypted connection.

When I start virt-viewer with virt-viewer --spice-debug -c qemu:///system -a the log looks the same up until the line:

(gnome-boxes:23267): GSpice-DEBUG: 11:45:18.746: ../src/spice-session.c:2232 Missing port value, not attempting unencrypted connection.

Neither that line nor the following one about not attempting an encrypted connection show up in the virt-viewer log and it seems to continue without a problem. It's as if gnome-boxes is failing to use a connection method that virt-viewer is able to use, but I'm not sure what that is or how to check if there is possibly a build problem with gnome-boxes that is causing that.

Metadata Output of nix run nixpkgs.nix-info -c nix-info -m:

 - system: `"x86_64-linux"`
 - host os: `Linux 5.4.6, NixOS, 20.03pre206438.a06925d8c60 (Markhor)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3`
 - channels(root): `"nixos-20.03pre206438.a06925d8c60, nixos-stable-19.09.1282.e6d584f6dd2, nixos-unstable-20.03pre201996.41d921292e9"`
 - channels(amidon): `"nixos-20.03pre203172.0ee0489d42e, nixos-stable-18.03.133079.5b8a24a40ce"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
stale[bot] commented 4 years ago

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
worldofpeace commented 4 years ago

Haven't looked into this but I now boxes isn't in a good shape on nixos

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info