Ubuntu

How to Install VNC Server on Ubuntu 20.04

How to Install VNC Server on Ubuntu 20.04

Introduction:

Virtual Network Computing (VNC) is a visual screen-sharing solution that lets you operate another device remotely using your touchpad. It is a fair and democratic replacement to Microsoft’s RDP (remote access protocol). TigerVNC, TightVNC, Vino, vnc4server, and far more applications are existing to remotely control Linux-based desktops. TigerVNC is a high-performance VNC server that may be used to remotely manage or view Linux-based desktops. It is fair and democratic. It is indeed a client/server program that lets you communicate with graphical programs on other computers. In this tutorial, we will guide you to install and configure the TigerVNC server on your Ubuntu 20.04.

Update Ubuntu 20.04:

To get started with VNC Server, we need to first update our system and apt package. Open the terminal suing Ctrl+Alt+T, and write the below query in it for the update. It requires a sudo password to execute. Add root account password and tap Enter. It takes a little while to get completed.

$ sudo apt update && sudo apt upgrade

Configure Desktop Environment:

Let’s start by installing a Desktop Environment on our Linux platform, which isn’t included by default. There are several options, including GNOME, MATE, XFCE, and others. In this lesson, we’ll use the XFCE desktop environment. It is indeed a minimalistic desktop environment that aids in maintaining a reliable and seamless VNC connection. Try the stated query:

$ sudo apt install xfce4 xfce4-goodies

Tap “y” to affirm the process of installation. Otherwise, press “n” to stop it.

Select Package configuration and hit the OK button.

Install TightVNC Server:

Configure the TightVNC server modules after finishing the XFCE workspace deployment. Additional prominent VNC servers include TigerVNC as well as x11vnc. Use the apt query to install the packages listed underneath. Add the sudo password to continue the process.

$ sudo apt install tightvncserver

Launch VNC Server:

To enable or launch the VNC server we need a very simple below command to be executed in the shell as follows:

$ vncserver

As we haven’t given any password to our server, hence we need to the add-up password for our server. In this case, add the below password command in the shell to do so. It will ask you to enter the password and verify it by adding it again. After that, it will ask you if you want to add some view-only passwords. Press “Y” to affirm, otherwise hit “n” to quit. You can see, as we have added “y”. Hence it asked for the password. Enter the password and then verify it by adding it again.

$ vncpasswd

Configure VNC Server:

Upon starting the server, it created a configuration file. It’s important to set up the VNC server to begin at the same time as the Ubuntu server. Furthermore, you must specify which User Interface the VNC server would join. Let’s start by terminating the existing VNC server instance at TCP port 5901:

$ vncserver –kill :1

Now we need to create a backup of a configuration file i.e. xstartup. Hence try out the below “cp” query in the shell for backup.

$ cp ~/.vnc/xstartup ~/.vnc/xstartup.bak

Now open the configuration file by any of your favorite editors. We have been using the GNU nano editor in our case to open it as below.

$ nano ~/.vnc/xstartup 

Now the file has been opened, update it with the below-presented code in the image. Save the file with Ctrl+S, and quit it via the Ctrl+X shortcut.

Restart your VNC Server once again using the query below.

$ vncserver -localhost

Connect Server:

The last but most important part is to connect with the server. Make sure you have the “SSH” package installed. Let’s first check the local servers.

$ ss -ltn

Navigate towards the system folder via the below “cd” command. After that, use any of the editor to create and open the [email protected] file.

$ cd /etc/system/system
$ vim [email protected]

Update the file with the below code and quit.

Now add the below command to connect with the SSH tunnel locally. You can see that the process is successful after adding answers to some affirmations.

Conclusion:

We have seen how to install and configure VNC Server on Ubuntu 20.04. Along with that we have also seen, how to create a password on the server as well as how to connect with it.

Similar Posts