Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

VNC Server port is closed

Writer Sophia Terry

I installed TigerVNC server on my Ubuntu server but I can't connect to it. The server is running but when I try to scan for open ports (in LAN) using my phone, 5901 is closed.

Output of nmap localhost:

Starting Nmap 7.80 ( ) at 2020-06-25 08:02 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00026s latency).
Not shown: 995 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
631/tcp open ipp
5901/tcp open vnc-1
Nmap done: 1 IP address (1 host up) scanned in 0.13 seconds

I think the problem is here. Output of nmap 192.168.0.101:

Starting Nmap 7.80 ( ) at 2020-06-25 08:05 UTC
Nmap scan report for cloud.local (192.168.0.101)
Host is up (0.00039s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 0.58 seconds

What I've already tried:

  • Allow port 5901/tcp in firewall
  • Disable firewall and reboot

EDIT:Output of nmap 192.168.0.101 -p 5900-5901:

Starting Nmap 7.80 ( ) at 2020-06-25 09:50 UTC
Nmap scan report for cloud.local (192.168.0.101)
Host is up (0.00032s latency).
PORT STATE SERVICE
5900/tcp closed vnc
5901/tcp closed vnc-1
Nmap done: 1 IP address (1 host up) scanned in 0.12 seconds
13

2 Answers

I asked another question and this is specific to TigerVNC Server.

From :

TigerVNC by default listens only on the loopback network interface. This is good for security, so that only you on the very same computer can connect.

Of course, if you want to connect remotely, you need to specifically specify it as follows:

  1. When you start the server from the command line, add -localhost no to the command line.

    tigervncserver -localhost no :1

  2. Configure TigerVNC to permanently listen to all network interfaces in /etc/vnc.conf. Add the following. Note that the configuration file gives the impression that no is the default. They do not follow the convention that if a configuration is commented out in the config file, it should have the default value (and not the other value you would normally change to).

    $localhost = "no";

1

Did you first started a session with the user you wish to login? I suggest you to follow some tutorial on how to run tigervnc server. VNC servers are by default not daemons like apache2, mysql for example. It means that you must start first the server manually. But some tutorials will show you also how to "daemonize" them.

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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