That looks like the kind of xstartup you'd want if you were running it in a old school configuration where you logged into local sessions with just a console and then manually started a GUI session using startx, and you want VNC to start the same GUI session remotely as locally
In a more typical modern setup, the local GUI session is determined at login time via a display manager such as lightdm or gdm, and users typically don't have a ~/.xsession file. In that case, it's more usual to initiate a session directly in the xstartup file. There is an example of a custom xstartup file in the community wiki that you can use and modify NB the ubuntu-2d session is probably no longer a valid session type post 12.04, you will need to choose a session type that is actually installed on your remote system
https://help.ubuntu.com/community/VN...g_your_session
FYI here is one that I use (avoiding Ubuntu/gnome sessions altogether - I find that lighter desktops work better for me): it tries for an XFCE4 session, dropping through to LXDE then plain OpenBox if necessary and finally to a default terminal emulator / window manager as an absolute last fallback
Code:
#!/bin/sh
MODE="xfce4"
#Uncommment this line if using Gnome and your keyboard mappings are incorrect.
#export XKL_XMODMAP_DISABLE=1
# Load X resources (if any)
if [ -r "$HOME/.Xresources" ]; then
xrdb "$HOME/.Xresources"
fi
case $MODE in
xfce4)
if which startxfce4 > /dev/null; then
exec startxfce4
fi
;;
lxde)
if which startlxde > /dev/null; then
exec startlxde
fi
;;
openbox)
if which openbox-session > /dev/null; then
exec openbox-session
fi
;;
*)
echo "Falling back to default minimal X session"
;;
esac
xsetroot -solid "#DAB082"
x-terminal-emulator -geometry "80x24+10+10" -ls -title " Desktop" &
x-window-manager &
Of course if you do want to do the oldschool setup, you could just leave your ~/.vnc/xstartup as-is, and create a minimal ~/.xsession file: one that I've used in the past for a plain Lubuntu session is simply
Code:
lxsession -e LXDE -s Lubuntu
TBH I don't know the difference between running startlxde versus simply invoking an lxsession - don't rely on what I've done as "best practice"