VNC Server only listening for connections from localhost

The problem seems to be just a default argument on VNCServer with the improper (for your case) option.

From vncserver command line help:

[-localhost yes|no]    Only accept VNC connections from localhost

This should solve your problem:

vncserver -localhost no

Interpreting the same last example in the original question, note the 0.0.0.0:5900 meaning "listening connections from anywhere at 5900 TCP":

luis@Frambuesio:~$ netstat -ano | grep 5900
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      off (0.00/0/0)
tcp6       0      0 :::5900                 :::*                    LISTEN      off (0.00/0/0)

Meanwhile, note the 127.0.0.1:5901 meaning "listening connections from localhost at 5901 TCP"

luis@Frambuesio:~$ netstat -ano | grep 5901
tcp        0      0 127.0.0.1:5901          0.0.0.0:*               LISTEN      off (0.00/0/0)
tcp6       0      0 ::1:5901                :::*                    LISTEN      off (0.00/0/0)

I ran into the same problem and figured it out. From the command line run:

tigervncserver -localhost no :1

Make it permanent by adding into the file /etc/vnc.conf the option:

$localhost = "no"

Even though the file reads that the default is localhost=no that is not the case.

Tags:

Vnc