Headless Install: TigerVNC working, XFCE cannot start. Help?

EDIT @ 2020 07 04 1527 US Central Time: Added contents of VNC Server .service file.


I'm running a headless Manjaro install on my Raspberry Pi 4b (4 GB). I've run a system update and have the latest stable everything installed.

I'm attempting to install TigerVNC in headless System mode, using the instructions here: https://wiki.archlinux.org/index.php/TigerVNC

The installation seems to have worked as the wiki said it should (the VNC server is visible as a running server in systemctl), but I get the following error(s) whenever I boot the system.

I think there's 1 or 2 errors here.

  1. TigerVNC runs its own Xserver. From the wiki: "It is both a VNC server and an X server with a virtual framebuffer. This means it is similar to the standard X server but has a virtual screen rather than a physical one. The virtual server runs in parallel with the physical X server should one be running." Is it possible XFCE is trying to start its own Xserver and choking because TigerVNC already heas one up and going? If so, how do I fix it?

  2. "Unable to Connect to DBUS." I'm still new enough not to understand exactly what a DBUS is, but I do understand it has something to do with connecting to virtual devices (like an X server). Not being able to connect seems like a fatal error. What should I do to fix this?

Sat Jul 4 13:43:48 2020
vncext: VNC extension running!
vncext: Listening for VNC connections on local interface(s), port 5901
vncext: created VNC server for screen 0
The XKEYBOARD keymap compiler (xkbcomp) reports:

Internal error: Could not resolve keysym XF86FullScreen
Errors from xkbcomp are not fatal to the X server
> /usr/bin/startxfce4: X server already running on display :1
> Failed to connect to bus: No such file or directory
> dbus-update-activation-environment: error: unable to connect to D-Bus: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead

vncserver@.service looks like this:

Description=Remote desktop service (VNC)
After=syslog.target network.target

ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :; /bin/dbus-launch'
ExecStart=/usr/bin/vncserver %i -geometry 1920x1080 -alwaysshared
ExecStop=/usr/bin/vncserver -kill %i


I modified it to try to force it to do dbus-launch before starting the service, but that did not change anything.

systemctl output:

> │ └─vncserver@:1.service
│ ├─337 /usr/bin/dbus-daemon --syslog --fork --print-pid 4 --print-address 6 --session
│ ├─350 /usr/bin/Xvnc :1 -alwaysshared -desktop sandbox -geometry 1920x1080 -localhost -securitytypes vncauth,tlsvnc -auth /home/panoptitom/.Xauthority -pn -rfbauth /home/$HOME/.vnc/passwd -rfbport 5901 -rfbwait 30000 -alwaysshared
│ └─411 xfce4-session

xstartup looks like this:



exec startxfce4

If I'm reading this right, XFCE4-session is actually running as PID 411.

I see that I'm actually unsetting DBUS_SESSION_BUS_ADDRESS, which is what the TigerVNC wiki entry says to do, which I'm guessing is my problem, but I don't yet know enough about how this works to guess at fixing it.

However, commenting out "unset DBUS_SESSSION_ADDRESS" had no impact. Error remains.


I use krfb and krdc, no problem, I never solved the problems I had with tigervnc...
See below, I hope it will be helpful

Just added some more info to the OP, including contents of the .service file and a couple more troubleshooting steps I tried that were ineffective.

@nl.smart : Thanks! I'm not quite ready to give up on TigerVNC yet, mostly because I don't want to start over again, but if I can't get this to work I'll try that. I'm not running KDE, though, so I wonder if I can use your method on XFCE.

you're welcome.

kde apps with xfce? not sure, but I think it's possible with pamac...

I'm running headless. There's no monitor connected. I cannot even see pamac. :frowning:

Pamac has a cli interface too.

My odroid sbc's are running headless, but to launch the DE (kde) I plug an hdmi dummy


1 Like

@nl.smart I'm using the dummy driver, which does the same thing as the hardware dummy plug. Mostly because I was feeling cheap and trying to set up this thing at 1 AM the first time and didn't want to buy more dongles. :stuck_out_tongue:

@Strit probably remembers me screaming as I careened into getting my headless X server working many moons ago.

Hello, again.

I'm marking this one solved. I've got the VNC server starting, and XFCE. I tweaked a few settings files and deleted a few others to force fresh versions to be created, and everything is copacetic when I query systemctl about the status of the VNC server.

EDIT ( 2020 07 04 @ 2218 US Central Time): Everything is working now.

I actually got lost googling and randomly fell upon the answer, so please forgive me for not citing all my sources. I'm not entirely sure where I got this at this point, but I know it was from at least two different sources.

So, here's xstartup: Aside from the unsetting, all it does is take instructions from my .xinitrc file. I only switched it to this because someone else did this and it helped things work, but honestly now that 's it's done I prefer it this way. I like the idea of having a single file in control of how XFCE starts at the root level of my user folder structure, instead of buried inside TigerVNC's .vnc folder.



#exec startxfce4 # From TigerVNC page on ArchLinux wiki. Seems to fail somehow.

source /home/panoptitom/.xinitrc

Here's .xinitrc:

# ~/.xinitrc
# Executed by startx (run your window manager from here)

# SOURCE: https://wiki.manjaro.org/index.php?title=Getting_Window_Managers_to_work_properly
# Ensure that the D-Bus Communication System is running properly to fix
# File management, authentication, and other essential system processes

if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
    eval "$(dbus-launch --sh-syntax --exit-with-session)"
    echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"

## Ensure that GTK themes are applied uniformly in the Desktop Environment

export GTK2_RC_FILES="$HOME/.gtkrc-2.0"

## Where the default Home folders have not already been created, generate them

if [ -x /usr/bin/xdg-user-dirs-update ]; then

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  unset f

# exec enlightenment_start
# exec i3
# exec mate-session
# exec xmonad
# exec startlxqt
# exec startlxde
# exec awesome
# exec bspwm
# exec gnome-session
# exec gnome-session --session=gnome-classic
# exec startplasma-x11
# exec startplasma-wayland

#exec startxfce4
dbus-launch /usr/bin/startxfce4 &     # attempt to resolve dbus issue

# exec startfluxbox
# exec openbox-session
# exec cinnamon-session
# exec pekwm
# exec catwm
# exec dwm
# exec startede
# exec icewm-session
# exec jwm
# exec monsterwm
# exec notion
# exec startdde       # deepin-session

What finally made it work was commenting out the exec command for xfce, and replacing it with:
dbus-launch /usr/bin/startxfce4 & # attempt to resolve dbus issue

The VNC server's log file is now a riot of warnings and startup non-essential errors (?), but I'm at least able to log in with my VNC client.

Does anyone know why this fixed it? What exactly does dbus-launch do?
My understanding is that startxfce4 & starts it in the background...?

1 Like

Forum kindly sponsored by