How can I solve graphical system lock issue while connecting to VNC Server?

Latest response

While connecting to a VNC server the graphical system is locked up while I try to connect via VNC-viewer. I can initiate a connection but the auth screen shows 'Authentication Error' and does not allow to type the password.
The error I am getting:
Aug 05 20:03:18 ldo gnome-shell[4750]: JS ERROR: Failed to open reauthentication channel: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDe>
_reauthenticationChannelOpened@resource:///org/gnome/shell/gdm/util.js:355:34
Aug 05 20:03:19 ldo gdm[2342]: GdmManager: trying to open reauthentication channel for user jhu
Aug 05 20:03:19 ldo gdm[2342]: GdmManager: Error while retrieving session id for sender: Error getting session id from systemd: No data available
Aug 05 20:03:19 ldo gnome-shell[4750]: JS ERROR: Failed to open reauthentication channel: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDe>
_reauthenticationChannelOpened@resource:///org/gnome/shell/gdm/util.js:355:34
Aug 05 20:03:20 ldo gdm[2342]: GdmManager: trying to open reauthentication channel for user jhu
Aug 05 20:03:20 ldo gdm[2342]: GdmManager: Error while retrieving session id for sender: Error getting session id from systemd: No data available
Aug 05 20:03:20 ldo gnome-shell[4750]: JS ERROR: Failed to open reauthentication channel: Gio.DBusError: GDBus.Error:org.freedesktop.DBus.Error.AccessDe>
_reauthenticationChannelOpened@resource:///org/gnome/shell/gdm/util.js:355:34

My service file is as follows:

Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l USER -c "/usr/bin/vncserver %i -geometry 1024x768 -depth 24"
PIDFile=/home/USER/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'

[Install]
WantedBy=multi-user.target

Here USER is an actual user.

xstartup file looks like:

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &

I am using RHEL 8.2. Can anybody help me how to resolve this issue?

Thanks in advance!

Responses

are you using tigervnc?

Yes, tigervnc