Bug 1442235 - Auto-start guest uses port 5900, blocking vino-server
Summary: Auto-start guest uses port 5900, blocking vino-server
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 25
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-04-13 20:11 UTC by Christophe de Dinechin
Modified: 2017-04-19 14:14 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-04-13 22:14:58 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed patch (1.99 KB, application/mbox)
2017-04-14 10:37 UTC, Christophe de Dinechin
no flags Details

Description Christophe de Dinechin 2017-04-13 20:11:26 UTC
Description of problem:

On a host that has vino-server configured (using the Gnome Settings application to set Screen Sharing), I configured some guests to auto-start. The result is that I can't connect remotely to my host anymore, because by default guests are configured with ports set to "auto", and one of them can grab 5900 at start before vino-server has a chance to launch.

Version-Release number of selected component (if applicable):

libvirt.x86_64                                             2.2.0-2.fc25                                              updates


How reproducible: Often (the more I wait to login, the better the chances)


Steps to Reproduce:
1. Enable vino-server with Settings application, Sharing tab, "Screen Sharing"
2. Verify that you can connect to the host.
3. Create a virtual machine with virt-manager, default settings. The OS does not matter.
4. Configure this VM for remote display access (in VM settings, Display Spice, select Listen Type to "Address", leave port selection to the default "auto")
5. Configure this VM to auto-boot (VM "Boot options" then "Start virtual machine on host boot up")
6. Reboot the system
7. Wait a little bit to login
8. Login
9. Attempt to remote- connect to your desktop

Actual results:

Unable to connect. The vino-server is actually listening, but it could not get port 5900 because that was already taken by the VM.

Expected results:

VM should take port 5901 in that case, leaving 5900 for vino-server.


Additional info:

There are possible workarounds, e.g. editing /etc/libvirt/qemu.conf to limit which ports the VMs can use. But I think the default setup should limit VMs to ports 5901 and above to avoid this kind of issue.

The issue would also happen with a different server than vino-server, AFAICT.

In theory, if you configured more than 100 VMs to auto-start, one of them would use port 6000, and then you'd have the same problem with X11. I don't have a host large enough to try that.

Comment 1 Cole Robinson 2017-04-13 22:14:58 UTC
Thanks for the report, but this has been covered before:

https://bugzilla.redhat.com/show_bug.cgi?id=782814

The recommended workaround is to change the remote_display_port_min setting in /etc/libvirt/qemu.conf to start port assignment at something other than 5900

Comment 2 Christophe de Dinechin 2017-04-14 08:20:02 UTC
(In reply to Cole Robinson from comment #1)
> Thanks for the report, but this has been covered before:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=782814

Different suggestion. That other bug suggest to move to a different range. I suggest keeping the same range, just avoiding 5900 by default. Therefore, the objection that changing the range would cause complaints does not apply to my suggestion.


> 
> The recommended workaround is to change the remote_display_port_min setting
> in /etc/libvirt/qemu.conf to start port assignment at something other than
> 5900

I am aware of the workaround, since I mention it in "Additional info". In my opinion, those who need to edit qemu.conf should be those with 100 VMs, not regular Joe User who does not understand why the remote desktop is running and listening but he can't connect to it every other boot.

Comment 3 Christophe de Dinechin 2017-04-14 10:37:09 UTC
Created attachment 1271649 [details]
Proposed patch

Comment 4 Cole Robinson 2017-04-19 14:14:27 UTC
Sorry for not reading closely. I suggest sending your patch to libvir-list for further discussion


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