VNC or Virtual Network Computing is a computer technology that allows you to share your desktop remotely. VNC technology works as a client/server model and uses the RFP (Remote FrameBuffer) protocol to transmit keyboard and mouse events from the VNC client to the VNC server.
In this tutorial we will show you how to install the VNC server on CentOS 8 Server. We use TigerVNC as the VNC server and Gnome Desktop for the graphical user interface.
You can use different applications for the client depending on the operating system. You can use Remmina, RealVNC, TigerVNC, etc.
Requirements
What we will do:
First we install the "Gnome Desktop" on the CentOS 8 server. The "Gnome Desktop" is available under CentOS 8 as part of the "Server with GUI" package.
Install "Gnome Desktop" with the dnf command below.
dnf group install "Server with GUI"
We will then configure the server to start the graphical environment automatically at every startup.
systemctl set-default graphical
Next, edit the gdm configuration "/etc/gdm/custom.conf" with the editor vim.
vim /etc/gdm/custom.conf
Remove the comment character from the "WaylanEnable" option and leave the value at "false".
WaylandEnable=false
Save and close.
Now restart the server.
sudo reboot
After restarting the server, you will receive the "Gnome Desktop" as the default graphical environment.
After we have installed the "Gnome Desktop", we install TigerVNC and add a new user.
Install the TigerVNC server with the dnf command below.
dnf install tigervnc-server tigervnc-server-module -y
After installation, create a new user "hakase" and assign a password for it.
useradd -m -s /bin/bash hakase passwd hakase
Next, log in as user "hakase" and create a new VNC password.
su - hakase vncpasswd
Enter the secure password VNC Login for the user "hakase" and repeat it.
Now we have installed the TigerVNC server and created a new user for VNC access.
In this step we will configure TigerVNC as a systemd service. To do this, we need to create a new service file for TigerVNC.
Go to the directory "/etc/systemd/system" and create a new service file "vncserver@.service" with the editor vim.
cd /etc/systemd/system/ vim vncserver@.service
Change the user and the home directory with your own and add the following configuration.
[Unit] Description=Remote Desktop VNC Service After=syslog.target network.target [Service] Type=forking WorkingDirectory=/home/hakase User=hakase Group=hakase ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :' ExecStart=/usr/bin/vncserver -autokill %i ExecStop=/usr/bin/vncserver -kill %i [Install] WantedBy=multi-user.target
Save and close.
Now reload the systemd Daemon Manager.
systemctl daemon-reload
Start the VNC service and add that it is started automatically on boot.
systemctl start vncserver@:1.service systemctl enable vncserver@:1.service
Then check the VNC service.
systemctl status vncserver@:1.service
The VNC service is set up and running on the CentOS 8 server.
In this step we add the port of the VNC server to the firewall.
Execute the command firewall-cmd to add the port of the VNC server.
firewall-cmd --add-service=vnc-server --permanent
Now reload the firewalld and check all available services.
firewall-cmd --reload firewall-cmd --list-all
You will find the VNC server port in the list.
Make sure you have installed the VNC client for your own operating system.
For this guide we will use the Reminna Remote Desktop Client.
Open the Reminna application and add a new connection.
Now enter the IP address of the server, the port and the user and password.
Click on the"Save and connect" button.
As soon as you have established the connection, you will see the following screen.
Below you can see a screenshot of Nautilus on the CentOS 8 server.
Below you can see the terminal information about the server.
You have now installed the VNC server with the "Gnome Desktop" on the CentOS 8 server.
Magento is a free and open-source e-commerce platform written in PHP. It is simple, easy…
ISPConfig is an open-source control panel that allows users to manage multiple servers from a…
As a Linux administrator, you may find it necessary to troubleshoot or test your Simple…
Ubuntu 24.04, like many modern Linux distributions, relies on the NetworkManager for managing network connections.…
Restic is a modern, open-source backup program designed for efficiency, security, and simplicity. It enables…
phpMyAdmin is a popular free tool written in PHP intended to administer MySQL and MariaDB…