Menu Close

VNC keep dying after playing around with XRDP

Considering donating if you found my post helpful 😊

Buy Me a Coffee QR Code

I am running TigerVNC on a headless Debian server. After playing around with XRDP, TigerVNC refuse to work properly. The server started, listened, then died within a second.

There were no related logs at all!

What was actually happening

The killer was the XFCE session:

$ strace -f xinit xfce4-session -- Xvnc

xfce4-session: exit_group(0) # session exits cleanly
xinit: kill(-pgid, SIGHUP) # xinit kills the process group
xinit: kill(-pgid, SIGTERM) # ...including Xvnc

xfce4-session wasn’t crashing — it was choosing to quit right after startup. And when the session (xinit’s client) exits, xinit tears down the X server by design.

Why it quit

startxfce4 doesn’t start a D-Bus session bus; it assumes a display manager did. On this box the boot session was XRDP, not VNC — so the VNC-launched XFCE had no dedicated bus, couldn’t claim its D-Bus names, and bailed. A manual test confirmed it: with dbus-launch xfce4-session it survived; without it, it died.

The fix

In ~/.config/xfce4/xinitrc

#!/bin/sh
exec dbus-run-session -- xfce4-session

startxfce4 prefers this over the system copy. Now the VNC session runs inside its own D-Bus bus and stays up.

Considering donating if you found my post helpful 😊

Buy Me a Coffee QR Code
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x