I need some help getting xfce to run inside a virtual session using tigervnc on my raspberry pi. With session=xfce in ~/.vnc/config, when I run vncserver :2 it looks like everything is going to work, but instead I see xinit: connection to X server lost, then the program exits.
I made /usr/share/xsessions/twm.desktop which looks like this:
[Desktop Entry]
Version=1.0
Name=TWM Session
Comment=Use this session to run TWM as your desktop environment
Exec=twm
Icon=
Type=Application
DesktopNames=TWM
Setting session=twm in ~/.vnc/config works perfectly. I can connect without issue, so the problem is isolated to xfce. Not sure what I’m doing wrong, though.
I solved it by saving this file to /usr/share/xsessions/xfce4vnc.desktop
[Desktop Entry]
Version=1.0
Name=Xfce4vnc Session
Comment=Use this session to run Xfce in a virtual vnc server
Exec=dbus-launch startxfce4
Icon=
Type=Application
DesktopNames=XFCE4VNC