TigerVNC - RHEL 8.6 - vncserver@:3.service has successfully entered the 'dead' state
Hello,
I have recently installed RHEL 8.6 and setup TigerVNC.
I followed the following guide :
5.3 - Remotely accessing the desktop as multiple users >
Red Hat Customer Portal
My setup is:
[root@rh-806-img ~]# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.6 (Ootpa)
[root@rh-806-img ~]# uname -a
Linux rh-806-img 4.18.0-372.32.1.el8_6.x86_64 #1 SMP Fri Oct 7 12:35:10 EDT 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@rh-806-img ~]# rpm -qa | grep tigervnc
tigervnc-server-1.12.0-4.el8.x86_64
tigervnc-1.12.0-4.el8.x86_64
tigervnc-icons-1.12.0-4.el8.noarch
tigervnc-license-1.12.0-4.el8.noarch
tigervnc-selinux-1.12.0-4.el8.noarch
tigervnc-server-minimal-1.12.0-4.el8.x86_64
[root@rh-806-img ~]# cat /etc/tigervnc/vncserver-config-defaults
## Default settings for VNC servers started by the vncserver service
#
# Any settings given here will override the builtin defaults, but can
# also be overriden by ~/.vnc/config and vncserver-config-mandatory.
#
# See HOWTO.md and the following manpages for more details:
# vncsession(8) Xvnc(1)
#
# Several common settings are shown below. Uncomment and modify to your
# liking.
# session=gnome
# securitytypes=vncauth,tlsvnc
# geometry=2000x1200
# localhost
# alwaysshared
# Default to GNOME session
# Note: change this only when you know what are you doing
session=gnome
alwaysshared
[root@rh-806-img ~]# cat /etc/tigervnc/vncserver-config-mandatory
## Mandatory settings for VNC servers started by the vncserver service
#
# Any settings given here will override the builtin defaults and
# settings specified in ~/.vnc/config or vnc-config-defaults.
#
# See HOWTO.md and the following manpages for more details:
# vncsession(8) Xvnc(1)
#
# Several common settings are shown below. Uncomment and modify to your
# liking.
# session=gnome
# securitytypes=vncauth,tlsvnc
# geometry=2000x1200
# localhost
# alwaysshared
[root@rh-806-img ~]# cat /etc/tigervnc/vncserver.users
# TigerVNC User assignment
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:3=ops
:4=ops2
[root@rh-806-img ~]# cat /lib/systemd/system/vncserver@.service
# The vncserver service unit file
#
# Quick HowTo:
# 1. Add a user mapping to /etc/tigervnc/vncserver.users.
# 2. Adjust the global or user configuration. See the
# vncsession(8) manpage for details. (OPTIONAL)
# 3. Run `systemctl enable vncserver@:<display>.service`
# 4. Run `systemctl start vncserver@:<display>.service`
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted! For a secure way of using VNC, you should
# limit connections to the local host and then tunnel from
# the machine you want to view VNC on (host A) to the machine
# whose VNC output you want to view (host B)
#
# [user@hostA ~]$ ssh -v -C -L 590N:localhost:590M hostB
#
# this will open a connection on port 590N of your hostA to hostB's port 590M
# (in fact, it ssh-connects to hostB and then connects to localhost (on hostB).
# See the ssh man page for details on port forwarding)
#
# You can then point a VNC client on hostA at vncdisplay N of localhost and with
# the help of ssh, you end up seeing what hostB makes available on port 590M
#
# Use "nolisten=tcp" to prevent X connections to your VNC server via TCP.
#
# Use "localhost" to prevent remote VNC clients connecting except when
# doing so through a secure tunnel. See the "-via" option in the
# `man vncviewer' manual page.
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
ExecStartPre=+/usr/libexec/vncsession-restore %i
ExecStart=/usr/libexec/vncsession-start %i
PIDFile=/run/vncsession-%i.pid
SELinuxContext=system_u:system_r:vnc_session_t:s0
[Install]
WantedBy=multi-user.target
I start up the vncserver@:3 service successfully - I can then connect via VNC client from Windows OK.
[root@rh-806-img ~]# systemctl status vncserver@:3
● vncserver@:3.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2023-03-05 05:35:09 GMT; 35s ago
Process: 1471 ExecStart=/usr/libexec/vncsession-start :3 (code=exited, status=0/SUCCESS)
Process: 1425 ExecStartPre=/usr/libexec/vncsession-restore :3 (code=exited, status=0/SUCCESS)
Main PID: 1488 (vncsession)
Tasks: 0 (limit: 22609)
Memory: 2.1M
CGroup: /system.slice/system-vncserver.slice/vncserver@:3.service
‣ 1488 /usr/sbin/vncsession ops :3
However after logging of the VNC session, the vncserver@:3 service automatically goes into a ' inactive (dead) ' state :
[root@rh-806-img ~]# systemctl status vncserver@:3
● vncserver@:3.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
Active: inactive (dead) since Sun 2023-03-05 05:42:53 GMT; 12s ago
Process: 1471 ExecStart=/usr/libexec/vncsession-start :3 (code=exited, status=0/SUCCESS)
Process: 1425 ExecStartPre=/usr/libexec/vncsession-restore :3 (code=exited, status=0/SUCCESS)
Main PID: 1488 (code=exited, status=0/SUCCESS)
Mar 05 05:35:08 rh-806-img systemd[1]: Starting Remote desktop service (VNC)...
Mar 05 05:35:09 rh-806-img systemd[1]: Started Remote desktop service (VNC).
Mar 05 05:42:53 rh-806-img systemd[1]: vncserver@:3.service: Succeeded.
Journalctl shows the following:
[root@rh-806-img ~]# journalctl -xe | grep vnc
Mar 05 05:35:09 rh-806-img vncsession[1490]: pam_unix(tigervnc:session): session opened for user ops2 by (uid=0)
-- Subject: Unit vncserver@:4.service has finished start-up
-- Unit vncserver@:4.service has finished starting up.
Mar 05 05:35:09 rh-806-img vncsession[1488]: pam_unix(tigervnc:session): session opened for user ops by (uid=0)
-- Subject: Unit vncserver@:.service has finished start-up
-- Unit vncserver@:3.service has finished starting up.
Mar 05 05:42:53 rh-806-img vncsession[1488]: pam_unix(tigervnc:session): session closed for user ops
Mar 05 05:42:53 rh-806-img systemd[1]: vncserver@:3.service: Succeeded.
-- The unit vncserver@:3.service has successfully entered the 'dead' state.
Does anyone know why VNC is exibiting this behaviour ? Why does the session go into a ' inactive (dead) ' state ?
This is causing a lot of issues as the service needs to be started back up via ssh before the user can connect again.
Can anyone please point me in the right direction ?