VNC port numbers

According to Wikipedia:

VNC by default uses TCP port 5900+N,[5][6] where N is the display number (usually :0 for a physical display). Several implementations also start a basic HTTP server on port 5800+N to provide a VNC viewer as a Java applet, allowing easy connection through any Java-enabled web browser. Different port assignments can be used as long as both client and server are configured accordingly.

My book says when you start vncserver for the first time (versus starting multiple instances) you use vncviewer host-ip:1

It refers to connecting to display number 1 and port 5901.

What happens if you connect to 5900 (Physical display), does this cause problems? When they say physical display, do they main your monitor? If so what happens if you connect to it? I realize you can change these ports anyway, but in the context of Wikipedia with default configuration, let's say you connect to vncviewer host-ip:0?


In general that simply means that it shows the display as it is - most Windows VNC implementations seem to use port 5900, and the port can be an arbitrary number - you just have to match up the port that the VNC server is set to to the client.

There's a bit more to it though - Linux allows you to have virtual displays, and you can connect a separate X session via VNC. Since each VNC session has to have its own session, it's a convention to simplify things - you can connect port 5900 to a virtual display and it will work. It's just simpler to remember the default port + display number.