RHEL 8.3 Vncserver and Vncviewer

Latest response

Installed new laptop with RHEL 8.3 we would like to use vncserver on the laptop in order for our customers to see demo's. No matter how I configure it, it isn't working. Please help with steps to get vncserver to work on RHEL 8.3.


I've had a lot of issues with tigervnc (assuming that's what you're using) ever since they added systemctl support. I just switched to rdp.

$ sudo dnf install xrdp

then start / enable.

for client side i use microsoft remote desktop on my macbook, and remmina on my ubuntu laptop

Open the GNOME Display Manager (GDM) configuration file using your favorite command line editor.

vi /etc/gdm/custom.conf

Then uncomment this line to force the login screen to use Xorg. WaylandEnable=false

Install VNC

dnf install tigervnc-server tigervnc-server-module

Next, switch to the user you want to run and use the VNC program by setting the user’s VNC server password (which should be at least six characters)

su - vncuser

$ vncpasswd

In this step, you have to configure the TigerVNC server to start a display for the above user on the system. Start by creating a configuration file named /etc/systemd/system/vncserver@.service as follows.

vi /etc/systemd/system/vncserver@.service

Add the following configuration in it (remember to replace tecmint with your actual username).

[Unit] Description=Remote desktop service (VNC) After=syslog.target network.target

[Service] Type=forking WorkingDirectory=/home/vncuser User=vncuser Group=vncuser


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 the file and close it.

Before we move any further, let’s briefly understand how the VNC server listens to requests. By default, VNC uses TCP port 5900+N, where N is the display number. If the display number is 1, then the VNC server will run on display port number 5901. This is the port you have to use while connecting to the server, from the client.

Normally selinux can cause issues to make simple just disable selinux

setenforce 0 sed -i 's/enforcing/disabled/g' /etc/selinux/config

Now reload the systemd manager configuration to apply the recent changes and then start the VNC service, enable it to auto-start at system boot time and check if it is up and running using the following systemctl commands, rembeber the number specify is the display could be 1 or 0 or 2 depending of the display you are using

systemctl daemon-reload systemctl start vncserver@:1 systemctl status vncserver@:1 systemctl enable vncserver@:1

Next, open the port 5901 in my case because i'm using display 1 in your case you need to looking with port is using

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

Now you are able to connect to the server via vnc

Just in case you want to do locally and no put remote the connection

Create a ssh-key


Copy the ssh-key to the server with vnc

ssh-copy-id vncuser@server

Now make a tunnel between you local machine and the remote server

ssh -i ~/.ssh/id_rsa -L 5901: -N -f -l vncuser

This one create a ssh tunnel

Install the client in you local machine

dnf install tigervnc-viewer

Connect to the server using vncviewer localhost:5901 or vncviewer

New instruction posted on Apr. 26, 2021, for how-to setup tigervnc server in RHEL 8.3. https://access.redhat.com/solutions/5544351 It works.