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.
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
(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.
Created attachment 1271649 [details] Proposed patch
Sorry for not reading closely. I suggest sending your patch to libvir-list for further discussion