Install and Configure TigerVNC server on RHEL

Install and Configure TigerVNC server on RHEL 

TigerVNC service enables user to connect Graphical User Interface of Linux machine from another remote machine. To use TigerVNC we need to install TigerVNC Server on the target Linux machine and from the source we can use any compatible vnc client to connect to the remote target Linux machine.
Install and Configure tigervnc server on RHEL
Below are the steps to install and configure the VNC Server and Client

Step 1: Install GNOME and TigerVNC Server

As a root user install the GNOME (Open Source Desktop Software for Linux machines).

# yes | yum groupinstall "workstation" --skip-broken
# yes | yum install tigervnc-server tigervnc-server-module

Step 2: Configuring the VNC Server
Copy the configuration file and change the <USER> field to any user name (here we use root user). If we are trying another user then root username should be replaced by that username.

# cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver_root@:1.service
# sed -i 's/<USER>/root/g' /etc/systemd/system/vncserver_root@:1.service

Step 3: Run the VNC Server

# vncserver
New '9.x.x.x:1 (root)' desktop is 9.x.x.x:1 
# ps -ef | grep vnc 
root       38472       1  0 12:35 hvc0     00:00:00 /usr/bin/Xvnc :1 -auth /root/.Xauthority -desktop 9.x.x.x:1 (root) -fp catalogue:/etc/X11/fontpath.d -geometry 1024x768 -pn -rfbauth /root/.vnc/passwd -rfbport 5901 -rfbwait 30000

Upon running the vncserver command it prompts for password (provide the password if required else ignore). Once the service is started check the rfbport by running "ps -ef | grep vnc". Note down the port number and enable the firewall incoming via the port number.

Step 4: Enable the Port

In above example 5901 is the port that VNC Server is accepting the requests so enabling the 5901 port.

# firewall-cmd --permanent --add-port=5901/tcp
# firewall-cmd --reload

Step 5: Connect using VNC Client

Open vnc client software and enter the machine ip address or fully qualified domain name followed by colon and followed by port number (9.x.x.x:5901 from the above example). It will prompt for password entry if password for the account is set, else it will ask you to continue the login.

Post a Comment