Thursday, 7 February 2019

How to auto start x11vnc on LXQt or LXDE (including Raspbian)

LXQt is the desktop environment of the current edition of Lubuntu. Previous editions of Lubuntu used LXDE as the desktop environment. My personal preference is to use LXQt on Debian instead of XFCE on Debian, due to XFCE development being too slow (the same reason I switched most of my more powerful computers to KDE). I would only use LXQt on a computer like my Toshiab R500 which only has 2 GB of RAM, or in the case of the Raspberry Pi, they ship Raspbian using LXDE. I installed LXQt over the top of XFCE after installing Debian onto this laptop, and it works great.

LXQt and LXDE (and Raspbian) feature an easy autostart capability which can be configured from the GUI and can also be set up by placing a file called x11vnc.desktop into the ~/.config/autostart directory in the user's profile. If you use the GUI it creates the file with default settings. 

We want to use x11vnc to share the default desktop so that we can remote into it with a VNC client (I use Remmina) to remote control the laptop. This means I can use the laptop as my tethered desktop. The laptop sits on a docking station and can be quickly docked and undocked so the docking station can be left in place with all cables connected and all I need to do is bring out the laptop, dock it, turn it on and away we go.

The settings to be put into the desktop file (e.g. x11vnc.desktop) in the folder mentioned above are as follows. Note we have omitted -usepw as we are running it here without a password on a home network where there is no other user. If you want to use it with a password there are additional steps on first installing it to set the password and the extra switch to cause it to use the password which I have left out here.

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=X11VNC
Comment=
Exec=x11vnc -forever -display :0
StartupNotify=false
Terminal=false
Hidden=false