How do I configure a VNC/Lubuntu desktop on a Linode?

Linode Staff

We are trying to get VNC up and running with minimal installation of Lubuntu desktop (--no-install-recommends lubuntu-desktop).

After trying various options, the xstartup file (below) works fine on another Linode, but is resulting in a cursor and blank gray screen on my current Linode. Any advice on how to fix this?

We just care about getting a nice minimalistic GUI desktop on our Linodes. Any other way to achieve this will be acceptable as well.

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
#/etc/X11/Xsession
export XKL_XMODMAP_DISABLE=1
lxpanel &
nautilus &
/usr/bin/lxsession -s Lubuntu -e LXDE &

3 Replies

The first thing to try is to kill your current VNC server and restart it. If you make any changes in xstartup, you'll have to restart each time to make sure they apply to the new session.

It looks like the commands in xstartup are failing somewhere after setting your background color (the xsetroot -solid grey line) but before it can execute your applications (or your LXDE desktop, for that manner). The only thing that jumps out at me here is this line:

x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

Distributions can refer to programs in various ways, but this looks like it might be using a deprecated way of calling the X terminal emulator. You may want to comment that line out and add a slightly different one:

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

You can also drill down into the source of this problem by commenting out most of the lines in xstartup except the last one (where you load LXDE) and see if that helps:

#!/bin/sh
...
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
#vncconfig -iconic &
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
#/etc/X11/Xsession
#export XKL_XMODMAP_DISABLE=1
#lxpanel &
#nautilus &
/usr/bin/lxsession -s Lubuntu -e LXDE &

From there, you can slowly add lines back in again until you figure out where the problem is.

You should also make sure that the applications you are starting in this script (including LXDE) are installed. Newer versions of Lubuntu now use LXQt instead of LXDE.

There is an example xstartup file in this guide to setting up Lubuntu/VNC on a VPS that you can refer to as well.

Thanks Linode team for your excellent tips and suggestions!

We solved this problem following your first suggestion of using "xterm" instead of possibly deprecated way of calling "x-terminal-emulator".

I.e. following change helped us to get what we wanted: -

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

Thanks again,
Sumit

Thanks Linode team for your excellent tips and suggestions!

We solved this problem following your first suggestion of using "xterm" instead of possibly deprecated way of calling "x-terminal-emulator".

I.e. following change helped us to get what we wanted: -

#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &

Thanks again,
Sumit

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct