Unable to start xfce desktop

Hello. I’m trying to set up XFCE on a SLURM cluster, but I’m running into issues. Below is the output.log with debug messages. I noticed errors related to dbus-launch, such as

Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.

and

dbus[166472]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/10015" not available: No such file or directory

I’ve tried two potential solutions based on other posts, such as setting the PATH to deal with potential conda clashes (as seen in the output.log); and confirming that the line “unset DBUS_SESSION_BUS_ADDRESS” exists in script.sh before the xfce.sh script is ran. But no luck so far.

I appreciate any help.

Below is the output.log:
output.log.txt (4.6 KB)

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

Desktop 'TurboVNC: c176:1 (testuser)' started on display c176:1

Log file is vnc.log
Successfully started VNC server on c176:5901...
Script starting...
Starting websocket server...
The system default contains no modules
  (env var: LMOD_SYSTEM_DEFAULT_MODULES is empty)
  No changes in loaded modules

sh_debug: This is a debug message.
sh_debug: dbus address: unix:path=/run/user/10015/bus
sh_debug: dbus address: 
Launching desktop 'xfce'...
++ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/TurboVNC/bin/:/share/kyric/spack/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
++ xfce-session
/home/testuser/ondemand/data/sys/dashboard/batch_connect/sys/bc_desktop/kxc/output/f4087499-cb2d-4fc2-b3ac-31338659dd28/desktops/xfce.sh: line 3: xfce-session: command not found
++ echo 'sh_debug: Starting xfce script...'
sh_debug: Starting xfce script...
++ [[ -f /home/testuser/.config/monitors.xml ]]
++ PANEL_CONFIG=/home/testuser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
++ [[ ! -e /home/testuser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml ]]
++ xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.
++ xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.
++ AUTOSTART=/home/testuser/.config/autostart
++ rm -fr /home/testuser/.config/autostart
++ mkdir -p /home/testuser/.config/autostart
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ TERM_CONFIG=/home/testuser/.config/xfce4/terminal/terminalrc
++ [[ ! -e /home/testuser/.config/xfce4/terminal/terminalrc ]]
++ sed -i '/^CommandLoginShell=/{h;s/=.*/=TRUE/};${x;/^$/{s//CommandLoginShell=TRUE/;H};x}' /home/testuser/.config/xfce4/terminal/terminalrc
WebSocket server settings:
  - Listen on :46631
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
Scanning VNC log file for user authentications...
Generating connection YAML file...
+++ dbus-launch --sh-syntax
dbus[166472]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/10015" not available: No such file or directory
++ eval 'DBUS_SESSION_BUS_ADDRESS='\''unix:abstract=/tmp/dbus-fOraublrEd,guid=a3c5a88cb818e852c847142264e6b368'\'';' export 'DBUS_SESSION_BUS_ADDRESS;' 'DBUS_SESSION_BUS_PID=166475;'
+++ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-fOraublrEd,guid=a3c5a88cb818e852c847142264e6b368
+++ export DBUS_SESSION_BUS_ADDRESS
+++ DBUS_SESSION_BUS_PID=166475
++ xfce4-session
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.
+ echo 'Desktop '\''xfce'\'' ended...'
Desktop 'xfce' ended...
Cleaning up...
Killing Xvnc process ID 166427

Hi and welcome!

Seems like you need to set the XDG_RUNTIME_DIR environment variable. You can see how we do the same here:

@jeff.ohrstrom Thank you for your suggestion!

Setting that variable indeed solves the second error (dbus[166472]: Unable to set up transient service directory: XDG_RUNTIME_DIR "/run/user/10015" not available: No such file or directory)

However, the first dbus error is still there (Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.)

I noticed that this error results from running xfconf-query in two different lines, as seen in the output.log:

++ xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.
++ xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.

I manually went into the compute node and ran the exact same xfconf-query lines above. As root user, the command has exit status 0. But as the user, there is this error:

[testuser@c176 ~]$ xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
Failed to init libxfconf: Cannot autolaunch D-Bus without X11 $DISPLAY.

So, the error message from the manual run vs. from xfce.sh slightly differ, but I wonder if they are caused by the same problem.

The error from the manual run says $DISPLAY is not set, which is similar to the error I see when I launched the Desktop in OOD, both referring to that variable:

xfce4-session: Cannot open display: .

I’m trying to find anything related to setting $DISPLAY in the OSC config repo, but I didn’t find anything. Any ideas?

Can you re-run the job and give the full output log as you did before?

DISPLAY should be set during the job when vncserver boots up. If you look in the resulting job_script_content.sh you’ll see it.

Here it is. As you can see, it’s set to :1.

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

Desktop 'TurboVNC: c176:1 (testuser)' started on display c176:1

Log file is vnc.log
Successfully started VNC server on c176:5901...
Script starting...
Starting websocket server...
The system default contains no modules
  (env var: LMOD_SYSTEM_DEFAULT_MODULES is empty)
  No changes in loaded modules

shuso2: This is a debug message.
shuso2: dbus address: unix:path=/run/user/10015/bus
shuso2: dbus address: 
Launching desktop 'xfce'...
++ echo 'sh_debug: Starting xfce script...'
sh_debug: Starting xfce script...
++ [[ -f /home/testuser/.config/monitors.xml ]]
++ PANEL_CONFIG=/home/testuser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml
++ [[ ! -e /home/testuser/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-panel.xml ]]
++ echo 'sh_debug: before first xfconf-query'
sh_debug: before first xfconf-query
++ whoami
testuser
++ xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.
++ echo 'sh_debug: before second xfconf-query'
sh_debug: before second xfconf-query
++ xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false
Failed to init libxfconf: Error spawning command line ?dbus-launch --autolaunch=f0b48b7a638f47108c5dd1696e7d1e28 --binary-syntax --close-stderr?: Child process exited with code 1.
++ AUTOSTART=/home/testuser/.config/autostart
++ rm -fr /home/testuser/.config/autostart
++ mkdir -p /home/testuser/.config/autostart
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ for service in "pulseaudio" "rhsm-icon" "spice-vdagent" "tracker-extract" "tracker-miner-apps" "tracker-miner-user-guides" "xfce4-power-manager" "xfce-polkit"
++ echo -e '[Desktop Entry]\nHidden=true'
++ TERM_CONFIG=/home/testuser/.config/xfce4/terminal/terminalrc
++ [[ ! -e /home/testuser/.config/xfce4/terminal/terminalrc ]]
++ sed -i '/^CommandLoginShell=/{h;s/=.*/=TRUE/};${x;/^$/{s//CommandLoginShell=TRUE/;H};x}' /home/testuser/.config/xfce4/terminal/terminalrc
+++ dbus-launch --sh-syntax
WebSocket server settings:
  - Listen on :51381
  - No SSL/TLS support (no cert file)
  - Backgrounding (daemon)
Scanning VNC log file for user authentications...
Generating connection YAML file...
++ eval 'DBUS_SESSION_BUS_ADDRESS='\''unix:abstract=/tmp/dbus-DDI9hnTn6K,guid=53dddbf7cc7737427616b05864ee1e11'\'';' export 'DBUS_SESSION_BUS_ADDRESS;' 'DBUS_SESSION_BUS_PID=212437;'
+++ DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-DDI9hnTn6K,guid=53dddbf7cc7737427616b05864ee1e11
+++ export DBUS_SESSION_BUS_ADDRESS
+++ DBUS_SESSION_BUS_PID=212437
++ echo 'sh_debug: DISPLAY= :1'
sh_debug: DISPLAY= :1
++ /usr/bin/xfce4-session
Unable to init server: Could not connect: Connection refused
xfce4-session: Cannot open display: .
Type 'xfce4-session --help' for usage.
+ echo 'Desktop '\''xfce'\'' ended...'
Desktop 'xfce' ended...
Cleaning up...
Killing Xvnc process ID 212397

OK - not more information than the other message.

I think it’s time to look into dmesg, journalctl or similar. I’d also look into /var/log/audit if you have selinux running. I’d like to see if there are any relevant error messages in the system logs.

I solved it! The error above was overcome by fixing the permissions on /tmp (it was not writable for some reason). I found that this was an issue by running Xvnc manually and seeing that Xvnc failed to create a “/tmp/.tX1-lock”. There was no other system error log, so it was tough to figure out until I did this manual run.

After that, the “Launch Desktop” button was finally visible. But, clicking it resulted in “Failed to connect to server” in the VNC console. By reading a prior topic here, I found that there was a 404 code in the Websockify request. After configuring the reverse proxy, the desktop finally works!

Thank you for your help, Jeff!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.