[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

vncserver, display numbers and port numbers

  (i can see that i'm going to have to update my recipe for VNC real
soon now.)

  playing around with invoking multiple instances of vncserver, and
i'm starting to see the relationship between port numbers and display
numbers, and how vncviewer connects.

  if you start invoking multiple instances of vncserver, you'll get
the predictable sequence of display numbers and respective port

  :1		5901
  :2		5902

now, say you try to start on a new display number, such as:

  $ vncserver :4

what you get is the association:

  :4		5904

as in, vncserver clearly tries to match the display number with the
corresponding port number, if it's still available:  so let's push it
a bit further:

  $ vncserver :5 -rfbport 5906      (:5 -> port 5906)

and then:

  $ vncserver :6
  A VNC server is already running as :6

hmmmm ... not really, but you can see how vncserver thinks.  port 5906
is currently listening; therefore, display :6 is assumed to be
running, even though you *clearly* specified display :5 above.

  finally, you can use vncviewer to connect to a particular vncserver
by either display number or port number, as in, both of the following
have the same effect based on the above (even though it's not
documented that way):

  $ vncviewer <remote>:2
  $ vncviewer <remote>:5902

however, if the display number doesn't "match" the port number, the
display number will always be mapped to the corresponding port number
automatically.  so, based on the above:

  $ vncviewer <remote>:5	[connection refused]
  $ vncviewer <remote>:6	[good since it maps to port 5906]

i guess it all makes sense once you see it happening.


Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

Home page:                                         http://crashcourse.ca
Fedora Cookbook:    http://crashcourse.ca/wiki/index.php/Fedora_Cookbook

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]