How to Install and Configure TigerVNC Server on CentOS 8 for Secure Remote Desktop Access
Virtual Network Computing (VNC) is a remote desktop technology that enables users to access and control a server or computer through a graphical user interface (GUI) over the network. This is especially useful for system administrators and users who prefer managing servers through a desktop environment instead of the command line.
In this tutorial, we’ll guide you step-by-step through the installation and configuration of TigerVNC Server on CentOS 8—a fast and lightweight VNC implementation. You’ll learn how to set up user sessions, configure access securely, and start remote desktop services for easier server management and productivity.
Installing a graphical desktop environment
At this stage, it is assumed to work under the root user.
By default, CentOS 8 does not have a graphical user interface, and it is required to connect to the server via VNC. So let's install Gnome.
Installing TigerVNC
Now let's install the TigerVNC server.
To connect to the server via VNC, it is better not to use the root user, because it is not safe. In addition, some functions may not work correctly. Therefore, we will create a regular user for connection, set a password for it and add it to the wheel group. This will give him sudo authority.
passwd username
usermod -aG wheel username
TigerVNC configuration
Now we need to assign each user an individual port for connection. To do this, open the file:
Add the following line to the end. You can put as many users with ports there as you need. The last digit of the port is shown here. The first part will always be 590x. In this case, we will set port 5902 for the user username. The port for each user must be unique.
Now open the default config file.
Add the default configuration here:
Now you need to log in with the newly created user.
Set a password for this TigerVNC server user. If you choose a view-only password, you won't be able to control your computer, only watch.
Now start the TigerVNC service and add it to autostart.
Remote Desktop Connection via VNC
Any VNC client application can be used to connect. Enter your server's public IP address and port 5902 as the VNC server.
Enter your VNC password and you will see your server's remote desktop.
To secure the connection - see How to Establish VNC Connection Over SSH tunnel in CentOS 8</a
Conclusion
TigerVNC Server is a reliable and lightweight solution for enabling remote desktop access on CentOS 8 servers. By installing a graphical desktop environment like GNOME and properly configuring TigerVNC, you can manage your server remotely with ease and enhanced productivity. Assigning unique ports to users and securing connections via SSH tunnels further improves security and usability. Following this step-by-step guide, even beginners can set up secure, multi-user VNC sessions for efficient CentOS 8 server management.
FAQ
- Q1: Can I use TigerVNC Server on CentOS 7 or other Linux distributions?
A: Yes, TigerVNC is compatible with many Linux distributions including CentOS 7, Fedora, and Ubuntu. Installation steps may slightly differ depending on the distro. - Q2: How do I secure my VNC connection to prevent unauthorized access?
A: It is recommended to tunnel your VNC connection over SSH to encrypt traffic. Avoid using the root user for VNC sessions and always set strong passwords for each user. - Q3: Can multiple users connect to TigerVNC Server simultaneously?
A: Yes, by assigning different display ports (like :1, :2, etc.) to each user, multiple simultaneous VNC sessions can run independently. - Q4: What desktop environments can I use with TigerVNC on CentOS 8?
A: GNOME is commonly used, but you can also configure TigerVNC to work with KDE, XFCE, or other desktop environments by modifying the session settings. - Q5: How do I start or stop the TigerVNC server?
A: Use systemctl start vncserver@:display and systemctl stop vncserver@:display commands, where display corresponds to the user’s VNC port (e.g., :2).