RealVNC Not Connecting

Posted January 11, 2017 14.3k views
FirewallConfiguration ManagementVPNUbuntu 16.04

I have been having some problems connecting to my Droplet with RealVNC, I used the guide below to set it up. My Droplet is a (2GB) Ubuntu x64. I have added an exception in my Windows 10 Firewall as well and the TP-Link Ports were forwarded as well.

Below are the errors I’m getting if I try either of these ways -> Timed out waiting for a response from the computer
localhost:5901 -> The connection was refused by the computer

Xtightvnc 1860 root 3u IPv4 18916 0t0 TCP *:5901 (LISTEN)

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

You can try restarting the VNC service with the command:

sudo service vncserver restart

As the messages you are seeing do indicate that it may not be running.

An alternative that might make things easier would be to set up xfce and x2go instead of VNC. x2go runs over SSH by default making it secure and easier to configure. To create a droplet with an xfce desktop and x2go you can

1.) Go the the droplet creation page and select Ubuntu 14.04 or Ubuntu 16.04
2.) Choose a size for your droplet (This may work on 512MB but I would strongly recommend at least a 1GB)
3.) Select a region for your droplet
4.) Check the “user-data” box. A text field will be displayed. Paste the following into that text field:

export DEBIAN_FRONTEND=noninteractive;
apt-get update;
apt-get -y install software-properties-common xubuntu-desktop;
add-apt-repository -y ppa:x2go/stable;
apt-get update;
apt-get -y install x2goserver x2goserver-xsession;

5.) Give your droplet a name and select any other options you want and then click Create.

When your droplet has finished creating it will kick off running the script we pasted into the create page. This may take up to 10-12 minutes to complete it’s process of downloading and installing additional software. After that time, you can connect to your desktop with the free x2go client for Windows, Mac or Linux.