# Unable to start xfce desktop

**URL:** <https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920>\
**Category:** Get Help\
**Created:** [August 24, 2023, 1:46am UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920 "2023-08-24T01:46:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sh\_hpc](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sh\_hpc](https://discourse.openondemand.org/u/sh_hpc)\
**Post date:** [August 24, 2023, 1:46am UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/1 "2023-08-24T01:46:20Z")

</div>

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

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

```

and

```auto
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](https://discourse.openondemand.org/uploads/short-url/hpJyJ7CmrCR5fzQsKAx9FFdKTLz.txt) (4.6 KB)

```auto
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

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [August 25, 2023, 2:00pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/2 "2023-08-25T14:00:45Z")

</div>

Hi and welcome!

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

> <https://github.com/OSC/osc-ood-config/blob/4bf6c277c2ad3a73cfb4a47072e3a1d71c9db2c7/ondemand.osc.edu/apps/bc_desktop/submit/slurm.yml.erb#L73-L74>

---

<div class="post-metadata">

**Author:** ![sh\_hpc](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sh\_hpc](https://discourse.openondemand.org/u/sh_hpc)\
**Post date:** [August 29, 2023, 4:00pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/3 "2023-08-29T16:00:07Z")

</div>

@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:

```auto
++ 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:

```auto
[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:

```auto
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?

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [August 29, 2023, 4:15pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/4 "2023-08-29T16:15:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sh\_hpc](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sh\_hpc](https://discourse.openondemand.org/u/sh_hpc)\
**Post date:** [August 29, 2023, 4:44pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/5 "2023-08-29T16:44:30Z")

</div>

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

```auto
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

```

---

<div class="post-metadata">

**Author:** ![jeff.ohrstrom](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/jeff.ohrstrom/32/136_2.png) [@jeff.ohrstrom](https://discourse.openondemand.org/u/jeff.ohrstrom)\
**Post date:** [August 29, 2023, 4:52pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/6 "2023-08-29T16:52:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sh\_hpc](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@sh\_hpc](https://discourse.openondemand.org/u/sh_hpc)\
**Post date:** [August 30, 2023, 11:23pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/7 "2023-08-30T23:23:28Z")

</div>

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!

> [@noVNC: Failed to connect to server](https://discourse.openondemand.org/t/novnc-failed-to-connect-to-server/2304/13):
>
> Hi @jeff.ohrstrom any further thoughts on this?

Thank you for your help, Jeff!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [February 26, 2024, 11:24pm UTC](https://discourse.openondemand.org/t/unable-to-start-xfce-desktop/2920/8 "2024-02-26T23:24:19Z")

</div>

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