How to Install and Configure TigerVNC Server on CentOS 8 for Remote Desktop Access
Virtual Network Computing (VNC) is a powerful protocol that enables you to remotely access and control a server’s desktop environment through a graphical interface from any location. Using VNC, system administrators and users can manage servers, troubleshoot issues, or access applications as if they were physically present. In this tutorial, we will provide a detailed walkthrough on how to install, configure, and secure the TigerVNC Server on CentOS 8. You will learn how to set up user sessions, manage server permissions, and optimize VNC for reliable remote desktop access.
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.
Conclusion
In this tutorial, you learned how to install and configure TigerVNC Server on CentOS 8, enabling secure remote desktop access through the VNC protocol. By setting up a graphical desktop environment, creating dedicated users with unique ports, and configuring the VNC server properly, you can effectively manage your server’s GUI remotely. Remember to avoid using the root user for VNC connections and consider securing your VNC traffic with SSH tunneling to protect data privacy. With these steps, you can streamline remote server administration, troubleshoot issues graphically, and access applications from anywhere.
FAQ
- Q1: Can I use TigerVNC with other desktop environments besides GNOME?
Yes, TigerVNC supports various desktop environments such as KDE, XFCE, and MATE. You just need to adjust the session configuration accordingly. - Q2: Why shouldn’t I use the root user for VNC connections?
Using root directly poses security risks and may cause issues with some VNC functionalities. It’s safer to create a regular user with sudo privileges. - Q3: How do I connect to the TigerVNC server from my local machine?
Use any VNC client and connect to your server’s public IP address with the assigned port (e.g., 5902). Then enter the VNC password set during configuration. - Q4: How can I secure my VNC connection?
It’s recommended to tunnel your VNC connection through SSH to encrypt traffic and prevent eavesdropping. Check tutorials on establishing VNC over SSH tunnels. - Q5: Can I assign multiple users to the TigerVNC server?
Yes, each user can be assigned a unique port by adding entries to /etc/tigervnc/vncserver.users, allowing multiple simultaneous remote sessions. - Q6: How do I enable TigerVNC server to start automatically on boot?
Use the command systemctl enable --now vncserver@:X, replacing X with the user’s display number, to enable auto-start of the VNC service.