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 mean 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?

1 Answer 1


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.

  • So if I connect to display :0 I'll se what's being displayed on my monitor versus :1 and up being a completely different x session?
    – rubixibuc
    Feb 19, 2012 at 4:38
  • 1
    if you set the vnc server to connect to display :0 on port 5900, then yes. You can however set the port to be anything at all, or connect to any arbitrary display on an arbitrary port
    – Journeyman Geek
    Feb 19, 2012 at 5:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.