When you’ve a remote PC with SSH access to it, you must should be using VNC to connect and view your server’s desktop version same as with Remote Desktop Connection on Windows.

Using VNC, you can view files of your software same as you do on Windows, access terminal, transfer & delete files and install software. It’s easy and safe to use VNC software.

You can use yum for Cent OS and apt for rest OS while running commands.

We’ll be installing TightVNC on Ubuntu server and connect it using TightVNC‘s VNC Viewer software to make a connection. Make sure to install complete TightVNC software on your Windows PC so, later we can make connection.

If you want to watch Video Tutorial, here you go:

How To Install TightVNC On Linux

Step 1: Allow Required Ports

I’ve opened just 5901 port, you can open 5902 and 5902 too to make better connection.
sudo ufw allow 5901/tcp ; sudo iptables -A INPUT -p tcp --dport 5901 -j ACCEPT ; sudo netfilter-persistent save ; sudo netfilter-persistent reload

Step 2: Run Installation Script

apt-get install xfce4 xfce4-goodies tightvncserver -y

Step 3: Run TightVNC

Let it get ready and allow us to create new password.
vncserver

Step 4: Stop TightVNC

We’ll now stop the software in order to manage and complete rest of the required settings to make it run smoother in the future.
vncserver -kill :1

Step 5: Open Configuration File

We’ll open configuration file in order to setup auto run for a required environment “XFCE4”.
nano ~/.vnc/xstartup

Step 6: Add Following Line To End

startxfce4

Step 7: Start TightVNC

We’re going to start the VNC again so we can adjust auto run for the software.
vncserver

Step 8: Setup Autorun

This will open up a file editor within your terminal so, we can add script which will make it auto start in the future.
nano /etc/systemd/system/vncserver.service

Now add following script to the file

[Unit]
Description=TightVNC server
After=syslog.target network.target

[Service]
Type=forking
User=root
PAMName=login
PIDFile=/root/.vnc/%H:1.pid
ExecStartPre=-/usr/bin/vncserver -kill :1 > /dev/null 2>&1
ExecStart=/usr/bin/vncserver
ExecStop=/usr/bin/vncserver -kill :1

[Install]
WantedBy=multi-user.target

Save it, if you don’t know how to Press CTRL+X Y Enter on PuTTY.

Step 9: Reload systemd

We’ll reload systemd to allow it to update new data added for the VNC.
systemctl daemon-reload

Final: Enable Autorun and start

This command will enable autorun for next time and start the VNC right away.
systemctl enable --now vncserver

And It’s done!

So, now time to connect to your Ubuntu using VNC Viewer on your Windows PC. As you’ve already installed TightVNC software on your Windows PC, now search for “VNC Viewer” and it will open up a field asking for server address.

Add it like this and hit enter:

YOURIP:5901

Enter the password we created while installing the VNC and you’re in. Enjoy your newly setup Remote Desktop software for your Linux machine.

Conclusion

This is a perfect and secure software to connect to your remote hosting computers as dedicated servers or VPS away from your location. You can completely manage the desktop version of your next OS with this software.

 

And make SURE to subscribe to my YouTube channel too 🙂 It really helps!!!