In this tutorial we will show you how to install VNC Server on CentOS 8. For those of you who didn’t know, Virtual Network Computing (VNC) is a graphical desktop sharing system that allows you to use your keyboard and mouse to remotely control another computer. VNC servers are not installed by default and need to be installed manually.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation VNC on a CentOS 8 server.
Install VNC Server on CentOS 8
Step 1. First, let’s start by ensuring your system is up-to-date.
Step 2. Installing Desktop Environment.
Run the following command to install Gnome desktop environment;
sudodnfgroupinstall"Server with GUI"
We will install the TigerVNC server, It is available in the default CentOS repositories, to install it type:
Once installed, run the vncserver command to create the initial configuration and set up the password:
Before continuing with the next step, first stop the VNC instance using the vncserver command with a -kill option and the server number as an argument:
The next step is to configure TigerVNC to use Gnome. The VNC server uses the ~/.vnc/xstartup file to launch applications when creating a new desktop:
Edit it as follows:
Now will creating a Systemd unit file:
Next, copy the default vncserver unit file:
Notify systemd that a new user unit file exist:
Now you can able to connect VNC server using IP and Port ( Example : 192.168.2.109:5 ) and you will be asked to enter the password, enter the password that you have created earlier.
If you run Linux, macOS, or any other Unix-based operating system on your machine, you can easily create a tunnel using the following ssh command:
Congratulation’s! You have successfully installed VNC Server. Thanks for using this tutorial for installing VNC on CentOS 8 system. For additional help or useful information, we recommend you to check the official VNC website.