Lubuntu – Installing VNC Server

I use VNC to access the graphical interface from my PC to a Cubieboard running Lubuntu. I chose TightVNC and spent some time configuring it. A helpful guide on ubuntuforums.org (currently offline — see status) got me started, but I needed to make changes, so I documented what actually worked.

Note: This guide is based on an older Lubuntu/LXDE setup with LightDM. The package names and file paths match that environment — newer Lubuntu releases may differ. TightVNC creates a separate virtual desktop and does not encrypt traffic; use it on a trusted network or tunnel through SSH.

Install TightVNC

Install the package:

sudo apt-get install tightvncserver

If you want to check first whether any VNC package is already installed:

dpkg --get-selections | grep vnc

Create the Initial Session

Set a VNC password with vncpasswd:

VNC password setup prompt.

Run tightvncserver once to generate the config files in ~/.vnc/:

TightVNC server started for the first time.

Stop the initial session:

tightvncserver -kill :1

Configure xstartup

Edit ~/.vnc/xstartup to start Openbox as the window manager and Lubuntu’s LXSession as the desktop environment:

#!/bin/sh
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
#autocutsel -fork
openbox &
/usr/bin/lxsession -s Lubuntu &
xstartup configuration file.

Important: Do not add -e LXDE to the lxsession line. See the Troubleshooting section below for why.

Connect from a VNC Client

Start the VNC server:

tightvncserver :1

TightVNC maps display :1 to TCP port 5901 (display :N maps to port 5900+N). Connect your VNC viewer to your-server-ip:5901.

VNC log showing TCP port 5901.

I installed VNC viewer on my Windows PC:

VNC viewer connection dialog.
VNC viewer password prompt.
Connected VNC session showing Lubuntu desktop.

TightVNC server is up and running on Lubuntu, and the VNC client is connected.

Note: TightVNC creates a separate virtual desktop session — it does not share the physical display. If you need to remote into the desktop that’s already visible on the machine, use x11vnc instead. For a full overview of VNC server options, see Ubuntu VNC/Servers.

Autostart After Login

To start TightVNC automatically after login, enable autologin in LightDM and add TightVNC to the Lubuntu autostart file (I used autologin in my previous post). Update /etc/lightdm/lightdm.conf:

[SeatDefaults]
autologin-user=linaro
autologin-user-timeout=0
greeter-session=lightdm-gtk-greeter
user-session=Lubuntu
LightDM autologin configuration.

Add this line to /etc/xdg/lxsession/Lubuntu/autostart:

@/usr/bin/tightvncserver :1

You can edit the file with:

sudo mcedit /etc/xdg/lxsession/Lubuntu/autostart
Autostart file with tightvncserver entry.

VNC will start automatically after reboot.


Troubleshooting: Log File Growing Uncontrollably

If ~/.cache/lxsession/Lubuntu/run.log is growing rapidly, remove the -e LXDE flag from ~/.vnc/xstartup.

The corrected line:

/usr/bin/lxsession -s Lubuntu &

The original (broken) line was:

/usr/bin/lxsession -s Lubuntu -e LXDE &
Original xstartup with -e LXDE flag.

The -e LXDE flag causes lxsession to restart in a loop, writing error messages to run.log on every attempt. My file was growing by ~100 MB per day. You can check the log size:

ls -la ~/.cache/lxsession/Lubuntu/

If this message appears repeatedly, the session is being restarted in a loop:

** Message: app.vala:59: Launching /usr/bin/tightvncserver :1 (null)
A VNC server is already running as :1
** Message: app.vala:73: /usr/bin/tightvncserver exit with this type of exit: 25088
** Message: app.vala:91: Exit not normal, reload

This bug is still open

Launchpad #1376380 — reported in 2014, confirmed, still unfixed as of 2026. Other users report log files reaching 76 GB, 600 GB, and filling entire disks. Lubuntu 16.04 and even Raspberry Pi users hit the same issue.

This blog post is referenced in the bug report.

Alternative workaround

If removing -e LXDE does not solve it, you can prevent the log from growing by removing write permissions:

chmod a= ~/.cache/lxsession/Lubuntu/run.log

Credit: comment #14 on Launchpad (2020).


VNC Server Alternatives

If you are setting this up on newer hardware or a newer distro, these are the main alternatives worth considering:

ServerUse CaseSecurityLink
TigerVNCFast, lightweight, multi-monitorBasic TLS, needs manual setuptigervnc.org
RealVNCEnterprise, cross-platform, polished256-bit AES, MFA, SSOrealvnc.com
x11vncShares real desktop (remote help)Needs SSH/VPN tunnelGitHub
TightVNCSimple setup, low-bandwidth, legacyPassword only, no encryptiontightvnc.com

Tip: For security, always tunnel VNC over SSH or VPN. On Linux, Remmina is a solid multi-protocol client (VNC, RDP, SSH).