Bug 186808 - emulators/virtualbox-ose VNC option doesn't support port ranges for "Remote Desktop Server Port" in Display, Remote Display
Summary: emulators/virtualbox-ose VNC option doesn't support port ranges for "Remote D...
Status: Closed Not A Bug
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-16 01:50 UTC by Derek Schrock
Modified: 2017-02-05 00:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2014-02-16 01:50:00 UTC
Base off the documentation at http://www.virtualbox.org/manual/ch07.html
supported virtualbox platforms allow you to run RDP/VRDP on a port range
(search for "list of ports").  It would be nice if the www/virtualbox-ose VNC
extension would support a range of ports for the "Remote Desktop Server Port"
in Display, Remote Display. 

Currently if you try to use a range the inital number is used.  ex: two VM
configured with 5900-5999 range in "Remote Desktop Server Port" both still try
to start a VNC server on port 5900 (one fails to enable VNC)

Fix: 

Add support to the VNC extension to read the range and start VNC on the first
open VNC port.

5900-5999

If 5900 is in use 5901.
How-To-Repeat: start two VMs with the a range instead of a single port number for "Remote 
Desktop Server Port"
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-16 23:33:37 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vbox

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Dominic Fandrey freebsd_committer freebsd_triage 2017-02-04 14:33:49 UTC
Is this still an issue?
Comment 3 Derek Schrock 2017-02-04 18:06:57 UTC
Yes, setting VRDE property: TCP/Ports  = "5990-5999" the VRDE extension that implements VNC access always picks 5990 even if 5990 is in use.
Comment 4 Derek Schrock 2017-02-04 20:26:07 UTC
This appears to be an upstream bug.

https://www.virtualbox.org/browser/vbox/trunk/src/VBox/ExtPacks/VNC/VBoxVNC.cpp#L306

This should be using RDE_QP_NETWORK_PORT_RANGE

https://www.virtualbox.org/browser/vbox/trunk/include/VBox/RemoteDesktop/VRDE.h#L1130

and 

https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp#L570

Otherwise using RDE_QP_NETWORK_PORT a value like 5990-6000 would always be converted to 5990?

https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-client/ConsoleVRDPServer.cpp#L568

If you agree with this I can file a bug with virtualbox.org's public bug tracker.
Comment 5 Derek Schrock 2017-02-04 21:37:43 UTC
Seems like it's a little more than Comment #4.  Rebuilding emulators/virtualbox-ose patching that to be the RANGE macro still doesn't work. 

net/libvncserver _rfbScreenInfo struct either accepts an number or the setting of autoport.

Still an upstream bug however src/VBox/ExtPacks/VNC/ should understand the range value string and choose the proper value passed to _rfbScreenInfo struct or net/libvncserver should accept a range like string and act on that as if it was autoport and work thru that range finding the first unused port.
Comment 6 Dominic Fandrey freebsd_committer freebsd_triage 2017-02-04 22:20:56 UTC
Upstream is the right place to fix this. Please, go ahead with filing a bug.