Run VNC session coincident with GUI login on Rocky 8

I’m new to Rocky linux, and also returning to linux system administration after many years. My goal is to allow a user to be logged in locally (and leave their session logged in locally) to the console gnome desktop and also have a VNC session (separate desktop) that they can use (and leave active) for when they are at home or on the road. In the past on other machines I have never had an issue with this. Console is logged in at :0, and any number of VNC sessions could be started on :1, :2, etc. There is really only one user for this machine, and they would like to easily access it from home and office and leave their sessions logged in to be able to return to work in progress.

On this Rocky 8 box (running 8.9), I do not seem to be able to do that, and in some other threads I have read that this is not even supported (which seems odd to me since I have been using VNC sessions like this for years on other linux boxes).

The other sysadmin installed the Nvidia drivers because Wayland was causing hiccups, but I don’t believe that is related to the VNC issue, as I could not get the VNC to work as I wanted to before that switch. Everything works fine on the machine, but if logged in to the console, a VNC session cannot be started for the same user. If logged out of the console, a VNC session can be started and works fine, but then the user cannot log in at the console while the VNC session is active.

The VNC server installed is TigerVNC. I start a VNC session using this command: “sudo systemctl start vncserver@:1”. The vncserver.users file looks like this (comment lines removed):

:1=actualusername

Based on some advice I found elsewhere, I’ve tried adding (or uncommenting) the following to /etc/gdm/custom.conf file:
WaylandEnable=false
DefaultSession=gnome-xorg.desktop

And I’ve tried commenting/uncommenting the following lines in the vnc config (and mandatory config) files
alwaysshared
localhost

But none of this has had any affect. I would appreciate any advice on how to have a VNC session and a desktop session (different desktops) for the same user simultaneously. Thanks.

-J

I think this is either related to systemd, dbus, or both. (I remember this not presenting a problem under CentOS 6.)

You may have some luck if you use different desktop environments on the different displays or if you use a bare window manager (e.g. openbox, icewm, etc.) instead of a full desktop environment.

However, if you’re not married to the idea of separate desktops for the local and VNC connection, x11vnc may get you what you need. (I personally find this much more convenient anyway – connecting back to my main desktop on :0.)

Thanks. I will examine the option of using a different window manager for the VNC session.

Does x11vnc allow you to open a VNC session that connects directly to the desktop that is active on the console then?

Thanks

-J

Does x11vnc allow you to open a VNC session that connects directly to the desktop that is active on the console then?

Yes, exactly. (Assuming the console display is :0 and you also start x11vnc with -display :0.)