[VNC Desktop / XFCE4] "Failed to connect to proxy" Issue

I’m working on getting OnDemand fully set up on a new cluster. Right now, we have everything installed as per usual on the login node and I’m finalizing the TurboVNC integration. However, we’re getting an issue when launching XFCE4 (I haven’t tried the other desktops yet, though I’ll probably try MATE soon).

Everything in the usual logs looks fine, except the output.log file:

Setting VNC password...
Starting VNC server...

Desktop 'TurboVNC: hcocs001:1 (jpg00017)' started on display hcocs001:1

Log file is vnc.log
Successfully started VNC server on hcocs001:5901...
Script starting...
Starting websocket server...
Launching desktop 'xfce'...
[websockify]: pid: 123972 (proxying 46779 ==> localhost:5901)
[websockify]: log file: ./websockify.log
[websockify]: waiting ...
grep: ./websockify.log: No such file or directory
_IceTransmkdir: Owner of /tmp/.ICE-unix should be set to root
/usr/bin/iceauth:  creating new authority file /run/user/560378/ICEauthority

(xfwm4:124003): xfwm4-WARNING **: 20:07:41.159: Unsupported GL renderer (llvmpipe (LLVM 20.1.8, 256 bits)).
[websockify]: started successfully (proxying 46779 ==> localhost:5901)
Scanning VNC log file for user authentications...
Generating connection YAML file...

** (wrapper-2.0:124039): WARNING **: 20:07:42.493: No outputs have backlight property

(wrapper-2.0:124039): Gtk-CRITICAL **: 20:07:42.537: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:124039): Gtk-CRITICAL **: 20:07:42.562: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:124039): Gtk-CRITICAL **: 20:07:42.562: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:124036): libnotify-WARNING **: 20:07:42.568: Failed to connect to proxy

(wrapper-2.0:124039): Gtk-CRITICAL **: 20:07:42.618: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:124036): pulseaudio-plugin-WARNING **: 20:07:49.247: Disconnected from the PulseAudio server. Attempting to reconnect in 5 seconds...

(xfdesktop:124029): GVFS-RemoteVolumeMonitor-WARNING **: 20:07:49.251: Owner of volume monitor org.gtk.vfs.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts

(tracker-miner-fs-3:124531): GVFS-RemoteVolumeMonitor-WARNING **: 20:07:49.252: Owner of volume monitor org.gtk.vfs.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
xfsettingsd: Another instance took over. Leaving...

(Thunar:124024): thunar-WARNING **: 20:07:49.268: Name 'org.xfce.FileManager' lost on the message dbus.

(Thunar:124024): thunar-WARNING **: 20:07:49.268: Name 'org.freedesktop.FileManager1' lost on the message dbus.

(xfce4-panel:124020): xfce4-panel-CRITICAL **: 20:07:49.269: Name org.xfce.Panel lost on the message dbus, exiting.
/usr/bin/iceauth:  error in locking authority file /run/user/560378/ICEauthority

(xfce4-session:123987): xfce4-session-WARNING **: 20:07:49.319: Failed to execute "/usr/bin/iceauth source /tmp/.xfsm-ICE-X1KTS3"
Terminated
Desktop 'xfce' ended with 143 status...
Cleaning up...
Killing Xvnc process ID 123939

OK

Any thoughts on this?

So, the error is here of course

/usr/bin/iceauth: error in locking authority file /run/user/560378/ICEauthority

Not clear why iceauth fails on this. If I just run it normally on my rocky 9 hosts, i get the expected

$ iceauth
iceauth: creating new authority file /run/user/156653/ICEauthority
Using authority file /run/user/156653/ICEauthority
iceauth>

This is your starting point, you need to be able to use iceauth on your host.

Yea we have to change our XDG_RUNTIME_DIR at OSC for a similar reason.

@micket iceauth is on both the host machine for OOD and the compute node, its weird that its trying to use /tmp/ instead of /run/user, which is what I see in my other system like you.

Mimic-ing your set-up @jeff.ohrstrom , I cannot get the before_script to run more than just the first line of exporting the modules (which is something we want to do as well). Adding the submit: submit/harpers.yml.erb to the bc_desktop app and then adding said file with the following:

batch_connect:
  before_script: |
    # Export the module function if it exists
    [[ $(type -t module) == "function"  ]] && export -f module
    # MATE acts strange in pitzer-exp and doesn't like /var/run/$(id -u)
    export XDG_RUNTIME_DIR="$TMPDIR/xdg_runtime"
    # reset SLURM_EXPORT_ENV so that things like srun & sbatch work out of the box
    export SLURM_EXPORT_ENV=ALL

my before.sh only shows:

# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module

Odd, that appears to be the default, so your config must not be picked up.

Can you share the entire file? I wonder if it’s a YML formatting issue.

The ../apps/bc_desktop/harpers.yml is:

title: "Virtual Desktop"
description: "This launches a XFCE desktop on the Korok compute nodes."
cluster: "harpersferry"
attributes:
  desktop: "xfce"
  bc_vnc_resolution:
    required: true
  bc_num_slots: 1
  bc_vnc_idle: 0
form:
  - bc_num_hours
  - desktop
  - bc_num_slots
  - bc_vnc_idle
  - bc_account
  - bc_queue
  - bc_vnc_resolution
submit: submit/harpers.yml.erb

With submit/harpers.yml.erb simply being (with the plan to add the extra slurm stuff before the --- later):

---
batch_connect:
  before_script: |
    # Export the module function if it exists
    [[ $(type -t module) == "function"  ]] && export -f module
    # MATE acts strange in pitzer-exp and doesn't like /var/run/$(id -u)
    export XDG_RUNTIME_DIR="$TMPDIR/xdg_runtime"
    # reset SLURM_EXPORT_ENV so that things like srun & sbatch work out of the box
    export SLURM_EXPORT_ENV=ALL

YML looks good, I wonder if it’s a more simple issue like the file/directory isn’t readable or the relative location of submit/ is not exactly right? (i.e., can’t find the file)

Yeah it’s pretty puzzling. I am also running the /opt/ood/nginx_stage/sbin/update_nginx_stage and /opt/ood/ood-portal-generator/sbin/update_ood_portal just to be on the safe side.

Here is the directory info:

[root@hrcis002 bc_desktop]# pwd
/etc/ood/config/apps/bc_desktop
[root@hrcis002 bc_desktop]# ls -lah *
-rw-r--r--. 1 root root 375 Jul 14 10:57 harpers.yml

submit:
total 4.0K
drwxr-xr-x. 2 root root  29 Jul 14 10:57 .
drwxr-xr-x. 3 root root  39 Jul 14 10:55 ..
-rw-r--r--. 1 root root 384 Jul 14 10:59 harpers.yml.erb

:man_facepalming: try restarting your webserver in the help menu. The app has likely been cached without the submit config update.

Nope; tried that. Also tried a new Incognito session. Changed the app’s name to “Harpers Desktop” to confirm its running a new app. Updated nginx, restarted httpd, and removed my AD user’s ~/ondemand/ to really make sure. Still not seeing the before script getting updated. I’m also not seeing really anything in the /var/log/ondemand-nginx/jpg00017/error.log to indicate anything is failing (like permission issues).

There is no error, it’ll just skip it and use default if it doesn’t exist.

There must be something obvious that we’re missing…

So I went into /var/www/ood/apps/sys/bc_desktop/template/before.sh.erb and edited it to be:

# Export the module function if it exists
[[ $(type -t module) == "function" ]] && export -f module
# MATE acts strange in pitzer-exp and doesn't like /var/run/$(id -u)
export XDG_RUNTIME_DIR="$TMPDIR/xdg_runtime"

Doing so correctly shows the before.sh matching this (so its definitely not setting the override correctly).

However, I am still getting the error. I jumped on the node and noticed that /tmp/.ICE-unix was owned by jpg00017:its-rc-harpers. Changed that to root:root. Now we are getting:

/usr/bin/iceauth:  error in locking authority file /tmp/xdg_runtime/ICEauthority

I’ll note that on this is what things look like on the node:

[root@hcocs001 .ICE-unix]# ls -lah .*
.:
total 0
drwxrwxrwt 2 root     root           240 Jul 14 16:43 .
drwxrwxrwt 9 root     root           180 Jul 14 16:52 ..
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 10 19:58 122844
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 10 20:07 123987
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 14:45 168457
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 14:57 169587
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 15:00 169826
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 16:11 170620
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 16:14 170861
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 16:18 171127
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 16:41 171569
srwxrwxrwx 1 jpg00017 its-rc-harpers   0 Jul 14 16:43 171879

..:
total 0
drwxrwxrwt  9 root root 180 Jul 14 16:52 .
drwxr-xr-x 19 root root 580 Jun 27 04:54 ..
drwxrwxrwt  2 root root 240 Jul 14 16:43 .ICE-unix
drwxrwxrwt  2 root root  60 Jul 14 16:43 .X11-unix
drwx------  3 root root  60 Jun 27 04:54 systemd-private-3cce8ba931094999bc05d5635b5eb9b9-dbus-broker.service-GMbGXu
drwx------  3 root root  60 Jun 27 04:54 systemd-private-3cce8ba931094999bc05d5635b5eb9b9-rtkit-daemon.service-jEUYW8
drwx------  3 root root  60 Jun 27 04:54 systemd-private-3cce8ba931094999bc05d5635b5eb9b9-switcheroo-control.service-jW35uI
drwx------  3 root root  60 Jun 27 04:54 systemd-private-3cce8ba931094999bc05d5635b5eb9b9-systemd-logind.service-xPnQ4h
drwx------  3 root root  60 Jun 27 04:54 systemd-private-3cce8ba931094999bc05d5635b5eb9b9-upower.service-HYHE8f

Following up here @jeff.ohrstrom ,

I set up /tmp/xdg_runtime/ on a node with the 1777 permissions. Doing so, results in the following output.log

Setting VNC password...
Starting VNC server...

Desktop 'TurboVNC: hcocx001:1 (jpg00017)' started on display hcocx001:1

Log file is vnc.log
Successfully started VNC server on hcocx001:5901...
Script starting...
Starting websocket server...
Launching desktop 'xfce'...
[websockify]: pid: 163605 (proxying 51146 ==> localhost:5901)
[websockify]: log file: ./websockify.log
[websockify]: waiting ...
grep: ./websockify.log: No such file or directory
/usr/bin/iceauth:  unable to link authority file /tmp/xdg_runtime/ICEauthority, use /tmp/xdg_runtime/ICEauthority-n

(xfwm4:163636): xfwm4-WARNING **: 17:25:29.591: Unsupported GL renderer (llvmpipe (LLVM 20.1.8, 256 bits)).

(xfce4-session:163620): xfce4-session-WARNING **: 17:25:29.595: ICE connection 0x55e8c06a4f20 rejected

(xfwm4:163636): xfwm4-WARNING **: 17:25:29.595: Failed to connect to session manager: Failed to connect to the session manager: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
[websockify]: started successfully (proxying 51146 ==> localhost:5901)
Scanning VNC log file for user authentications...
Generating connection YAML file...
Failed to connect to session manager: Failed to connect to the session manager: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed

(xfce4-session:163620): xfce4-session-WARNING **: 17:25:37.551: ICE connection 0x55e8c06ce800 rejected
xfsettingsd: Another instance took over. Leaving...
Terminated
Desktop 'xfce' ended with 143 status...
Cleaning up...
Killing Xvnc process ID 163572

So this is quite confusing. Is there an authentication app that needs to be installed? For reference, this is stock Rocky 9.7 5.14.0-611.55.1.el9_7.x86_64 on the compute node with only the following installs done on the warewulf image:

ID     | Command line                                                                                                                            | Date and time    | Action(s)      | Altered
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    21 | install lshw                                                                                                                            | 2026-07-01 01:51 | Install        |    1   
    20 | install ignition gdisk                                                                                                                  | 2026-06-27 04:07 | Install        |    4   
    19 | install -y apptainer                                                                                                                    | 2026-06-27 03:41 | Install        |    5   
    18 | install turbovnc                                                                                                                        | 2026-06-27 03:30 | Install        |   10 E<
    17 | install python3-websockify                                                                                                              | 2026-06-27 03:28 | Install        |   23 > 
    16 | install nmap-ncat                                                                                                                       | 2026-06-27 03:27 | Install        |    2   
    15 | install lightdm                                                                                                                         | 2026-06-27 03:26 | Install        |    5 EE
    14 | groupinstall Xfce                                                                                                                       | 2026-06-27 03:25 | Install        |  216 EE
    13 | install environment-modules                                                                                                             | 2026-06-27 03:23 | Install        |    5   
    12 | install nano                                                                                                                            | 2026-06-27 01:11 | Install        |    1   
    11 | install slurm slurm-slurmd                                                                                                              | 2026-06-25 19:47 | Install        |   17  <
    10 | install epel-release                                                                                                                    | 2026-06-25 19:46 | Install        |    6 >E
     9 | install opensm                                                                                                                          | 2026-06-25 19:46 | Install        |    2   
     8 | install oddjob oddjob-mkhomedir samba-common-tools sssd-ad sssd-tools sssd-krb5 sssd                                                    | 2026-06-25 19:45 | Install        |   48 EE
     7 | install lustre-client-2.17.0-1.el9.x86_64.rpm lustre-client-devel-2.17.0-1.el9.x86_64.rpm lustre-client-iokit-2.17.0-1.el9.x86_64.rpm   | 2026-06-25 19:38 | Install        |  167   
     6 | install kmod-lustre-client-2.17.0-1.el9.x86_64.rpm kmod-lustre-client-devel-2.17.0-1.el9.x86_64.rpm                                     | 2026-06-25 19:37 | Install        |    2 EE
     5 | groupinstall -y Development Tools                                                                                                       | 2026-06-25 18:58 | Install        |  330 EE
     4 | groupinstall -y InfiniBand Support 

I don’t think you need additional packages, but I would maybe try XDG_RUNTIME_DIR="$(mktemp -d)/xdg_runtime" instead just to avoid more issues with that directory creation.

A quick google search of the error seems to suggest it’s trying to do things as a different user, root maybe?

I just tried on my systems and this file should be owned by you, not root:root. That chown could be causing more issues.

Still looking like its having an issue with authenicating things:

Setting VNC password...
Starting VNC server...

Desktop 'TurboVNC: hcocx001:1 (jpg00017)' started on display hcocx001:1

Log file is vnc.log
Successfully started VNC server on hcocx001:5901...
Script starting...
Starting websocket server...
Launching desktop 'xfce'...
[websockify]: pid: 165029 (proxying 52573 ==> localhost:5901)
[websockify]: log file: ./websockify.log
[websockify]: waiting ...
grep: ./websockify.log: No such file or directory
/usr/bin/iceauth:  error in locking authority file /tmp/tmp.8HXlKLZ4gu/xdg_runtime/ICEauthority

(xfce4-session:165044): xfce4-session-WARNING **: 17:49:20.649: Failed to setup the ICE authentication data, session management might not work properly.

(xfwm4:165060): xfwm4-WARNING **: 17:49:20.808: Unsupported GL renderer (llvmpipe (LLVM 20.1.8, 256 bits)).

(xfce4-session:165044): xfce4-session-WARNING **: 17:49:20.812: ICE connection 0x557592f1f0f0 rejected

(xfwm4:165060): xfwm4-WARNING **: 17:49:20.812: Failed to connect to session manager: Failed to connect to the session manager: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
[websockify]: started successfully (proxying 52573 ==> localhost:5901)
Scanning VNC log file for user authentications...
Generating connection YAML file...
/usr/bin/iceauth:  error in locking authority file /tmp/tmp.8HXlKLZ4gu/xdg_runtime/ICEauthority

(xfce4-session:165044): xfce4-session-WARNING **: 17:49:28.696: Failed to execute "/usr/bin/iceauth source /tmp/.xfsm-ICE-G1MTS3"
Terminated
Desktop 'xfce' ended with 143 status...
Cleaning up...
xfsettingsd: Could not connect: Connection refused.

(xfsettingsd:165108): xfsettingsd-ERROR **: 17:49:28.704: Failed to connect to the dbus session bus.
Killing Xvnc process ID 164995

Taking a look at the folder, I don’t see the xdg_runtime directory created inside the new tmp directory:

[root@hcocx001 ~]# ls -lah /tmp/tmp.8HXlKLZ4gu/
total 0
drwx------  2 jpg00017 its-rc-harpers  40 Jul 14 17:49 .
drwxrwxrwt 12 root     root           240 Jul 14 17:58 ..

Two side notes:

  1. Every system I have checked has /tmp/.ICE-unix/ owned by root with 1777 permissions, then the files inside are owned by the given user.

  2. While the before.sh never changes, I do see that in the job_script_content.sh that gets created, the contents of submit/harpers.yml.erb’s before_script does get added into that .sh:

Alright, progress over here @jeff.ohrstrom !

I corrected a mistake with the XDG_RUNTIME_DIR="$(mktemp -d)/xdg_runtime" not having export (that’s what I get for bouncing around on projects) and ensured it is created by the user with mkdir $XDG_RUNTIME_DIR after the the export. Now we get everything set up correctly:

[root@hcocx001 ~]# ls -lah /tmp/tmp.zbBkJ1IxI4/xdg_runtime/
total 0
drwxr-xr-x 4 jpg00017 its-rc-harpers 100 Jul 14 18:05 .
drwx------ 3 jpg00017 its-rc-harpers  60 Jul 14 18:05 ..
-rw------- 1 jpg00017 its-rc-harpers   0 Jul 14 18:05 ICEauthority
drwx------ 2 jpg00017 its-rc-harpers  60 Jul 14 18:05 dconf
drwx------ 2 jpg00017 its-rc-harpers  40 Jul 14 18:05 pulse
[root@hcocx001 ~]# ls -lah /tmp/tmp.zbBkJ1IxI4/xdg_runtime/*
-rw------- 1 jpg00017 its-rc-harpers  0 Jul 14 18:05 /tmp/tmp.zbBkJ1IxI4/xdg_runtime/ICEauthority

/tmp/tmp.zbBkJ1IxI4/xdg_runtime/dconf:
total 4.0K
drwx------ 2 jpg00017 its-rc-harpers  60 Jul 14 18:05 .
drwxr-xr-x 4 jpg00017 its-rc-harpers 100 Jul 14 18:05 ..
-rw------- 1 jpg00017 its-rc-harpers   2 Jul 14 18:05 user

/tmp/tmp.zbBkJ1IxI4/xdg_runtime/pulse:
total 0
drwx------ 2 jpg00017 its-rc-harpers  40 Jul 14 18:05 .
drwxr-xr-x 4 jpg00017 its-rc-harpers 100 Jul 14 18:05 ..

However, we are still failing to start the VNC, seemingly because the proxy is failing to connect after a bunch of gvfs errors.

Setting VNC password...
Starting VNC server...

Desktop 'TurboVNC: hcocx001:1 (jpg00017)' started on display hcocx001:1

Log file is vnc.log
Successfully started VNC server on hcocx001:5901...
Script starting...
Starting websocket server...
Launching desktop 'xfce'...
[websockify]: pid: 166632 (proxying 59909 ==> localhost:5901)
[websockify]: log file: ./websockify.log
[websockify]: waiting ...
grep: ./websockify.log: No such file or directory
/usr/bin/iceauth:  creating new authority file /tmp/tmp.zbBkJ1IxI4/xdg_runtime/ICEauthority

(xfwm4:166663): xfwm4-WARNING **: 18:05:41.119: Unsupported GL renderer (llvmpipe (LLVM 20.1.8, 256 bits)).

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.709: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.710: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.710: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.711: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.711: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.

(xfdesktop:166688): GVFS-WARNING **: 18:05:41.711: The peer-to-peer connection failed: Error when getting information for file “/tmp/tmp.zbBkJ1IxI4/xdg_runtime/gvfsd”: No such file or directory. Falling back to the session bus. Your application is probably missing --filesystem=xdg-run/gvfsd privileges.
[websockify]: started successfully (proxying 59909 ==> localhost:5901)
Scanning VNC log file for user authentications...
Generating connection YAML file...

** (wrapper-2.0:166698): WARNING **: 18:05:42.463: No outputs have backlight property

(wrapper-2.0:166698): Gtk-CRITICAL **: 18:05:42.513: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:166698): Gtk-CRITICAL **: 18:05:42.534: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:166698): Gtk-CRITICAL **: 18:05:42.534: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(wrapper-2.0:166695): libnotify-WARNING **: 18:05:42.541: Failed to connect to proxy

(wrapper-2.0:166698): Gtk-CRITICAL **: 18:05:42.588: gtk_icon_theme_has_icon: assertion 'icon_name != NULL' failed

(xfdesktop:166688): GVFS-RemoteVolumeMonitor-WARNING **: 18:05:49.193: Owner of volume monitor org.gtk.vfs.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts

(tracker-miner-fs-3:167221): GVFS-RemoteVolumeMonitor-WARNING **: 18:05:49.194: Owner of volume monitor org.gtk.vfs.UDisks2VolumeMonitor disconnected from the bus; removing drives/volumes/mounts
xfsettingsd: Another instance took over. Leaving...

(Thunar:166683): thunar-WARNING **: 18:05:49.197: Name 'org.xfce.FileManager' lost on the message dbus.

(Thunar:166683): thunar-WARNING **: 18:05:49.197: Name 'org.freedesktop.FileManager1' lost on the message dbus.

(xfce4-panel:166679): xfce4-panel-CRITICAL **: 18:05:49.197: Name org.xfce.Panel lost on the message dbus, exiting.
Terminated
Desktop 'xfce' ended with 143 status...
Cleaning up...
Killing Xvnc process ID 166597

OK

This is also an issue websockify doesn’t seem to start. Though it does not seem to be the main issue.

That said - I’m not sure what the GVFS issue could be or those messages about “lost on the message dbus.” Seems like DBUS isn’t working quite right for you X session, but I could not say why.

Are there any logs in journalctl or other system logs that may have some information?

Also whats the OS you’re running?

I would strongly suggest to simplifying and just try starting vncserver directly inside and interactive job;

# Isolate to it's own XDG environment
export XDG_RUNTIME_DIR=$TMPDIR/xdg-runtime-test
export XDG_CACHE_DIR=$TMPDIR/xdg-cache-test
mkdir -p "$XDG_CACHE_DIR" "$XDG_RUNTIME_DIR"

# probably want to isolate this into it's own DBUS environment as well:
unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SYSTEM_BUS_ADDRESS
eval $(dbus-launch --sh-syntax)

# Should launch without to many errors in vnc log:
vncserver -xstartup xfce4-session

alternatively

vncserver -xstartup script.sh

where script.sh

unset DBUS_SESSION_BUS_ADDRESS
unset DBUS_SYSTEM_BUS_ADDRESS
dbus-run-session -- xfc4-session

I suspect that this might be a very new Xfce4, and they start relying more on DBus. I know when I built Xfce4 from source, this started to become a requirement to isolate the dbus environments when i tested stuff. Probably always a good idea to do this.

This worked right out of the gate. Here is the final state:

  before_script: |
    # Isolate the XDG Runtime Directories
    export TMPDIR = "$(mktemp -d)"
    export XDG_RUNTIME_DIR=$TMPDIR/xdg_runtime
    export XDG_CACHE_DIR=$TMPDIR/xdg_cache
    mkdir -p $XDG_RUNTIME_DIR $XDG_CACHE_DIR
    # Unset DBUS Hooks to allow TurboVNC to Work with XFCE4
    unset DBUS_SESSION_BUS_ADDRESS
    unset DBUS_SYSTEM_BUS_ADDRESS
    eval $(dbus-launch --sh-syntax)
    # Export the module function if it exists
    [[ $(type -t module) == "function"  ]] && export -f module
    # reset SLURM_EXPORT_ENV so that things like srun & sbatch work out of the box
    export SLURM_EXPORT_ENV=ALL

For @jeff.ohrstrom , nothing illuminating was in the journalctl or other system logs. This system is running RHEL 9.7 and kernel 5.14.0-611.55.1.el9_7.x86_64 with xfce4 4.18.3-1.el9.

The one issue I am running into is that the screensaver comes up and requires a password, which it doesn’t accept from the user. If I remember right, a solution for this is to just uninstall xfce4-screensaver.

Just as a side-note; what’s happening here is we create a new dbus environment for this new isolated xfce. It isn’t turbovnc specific, it’s an desktop-environment thing (Xfce and many others that rely on dbus). If we ran a simpler desktop environment, say, some basic OpenBox environment, this wouldn’t be needed.
No matter if we run turbovnc (Xvnc), Xvfb, Xorg, or even wayland, you want this isolated dbus thing environment (from dbus-launch) to launch multiple Xfce’s.