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
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
vncserver
Step 4: Stop TightVNC
vncserver -kill :1
Step 5: Open Configuration File
nano ~/.vnc/xstartup
Step 6: Add Following Line To End
startxfce4
Step 7: Start TightVNC
vncserver
Step 8: Setup Autorun
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
systemctl daemon-reload
Final: Enable Autorun and start
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!!!