How to Install VNC Server on Rocky Linux 9
If you’re looking to remotely access your Rocky Linux 9 server, setting up a VNC (Virtual Network Computing) server is a great option. VNC allows you to connect to your server’s graphical user interface (GUI) from another computer, giving you full control over your system.
In this tutorial, we’ll walk you through the steps to install and configure a VNC server on a Rocky Linux 9 machine.
Step 1: Update System Packages
Before installing any new software, it’s essential to ensure that your system packages are up to date. You can do this by running the following commands in your terminal:
sudo dnf update
Step 2: Install the TigerVNC Server
Next, we need to install the TigerVNC server, which is a popular implementation of the VNC protocol. You can install it by running the following command:
sudo dnf install tigervnc-server
Once the installation is complete, we need to configure the VNC server to create a new VNC session.
Step 3: Configure the VNC Server
To configure the VNC server, run the following command to create a new configuration file:
sudo cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
Now, open the newly created configuration file in a text editor:
sudo nano /etc/systemd/system/vncserver@:1.service
Find the following lines in the file:
- User=yourusername
- …
Replace yourusername
with your actual username and save the file.
Step 4: Start and Enable the VNC Server
To start and enable the VNC server, run the following commands:
sudo systemctl daemon-reload
sudo systemctl start vncserver@:1
sudo systemctl enable vncserver@:1
Your VNC server should now be up and running on port 5901. You can connect to it using a VNC client on another computer by entering yourserverip:5901
.
That’s it! You’ve successfully installed and configured a VNC server on your Rocky Linux 9 machine. Enjoy remote access to your server’s GUI with ease.
For more information and advanced configurations, refer to the official TigerVNC documentation.