This is the quick HowTo to get x11vnc running on thin clients so you can connect to them using a vncviewer or the thin client manager app. note that this doc doesn't take security into account, if you want a safe solution enable a password for x11vnc

Installing x11vnc

Before installing in the ltsp environment, make sure that apt-get sources in ltsp are consistent with the base install:

sudo cp /etc/apt/sources.list /opt/ltsp/i386/etc/apt/sources.list

Now, chroot into the ltsp client environment on the server.

sudo chroot /opt/ltsp/i386

Update the repositories that the ltsp environment uses for apt-get:

apt-get update

Install the x11vnc package (it's in the universe repository, possibly you must add it in /etc/apt/sources.list; in this case don't forget to apt-get update):

apt-get install x11vnc

Setting x11vnc to run on the thin clients

Note:: You might want to avoid this and skip to A safer and more secure way to run x11vnc on the thin clients, below.

Now edit the rc.local file to add x11vnc to the system startup (note: make sure this is all being done in the chroot environment and not the root of the server)

vi /etc/rc.local

You can use also nano for that, but first you have to install it on the chroot environment.

apt-get install nano

nano /etc/rc.local

Add the following line before the exit 0 statement in this file and save it:

x11vnc -display :6 -forever -loop -shared &

Now lets make sure rc.local gets actually executed:

cd /etc/rc2.d
mv K99rc.local S99rc.local

A safer and more secure way to run x11vnc on the thin clients

(if you've already done the section entitled Setting x11vnc to run on the thin clients then skip this one).

An alternative to editing rc.d is to run the following code snippet in the ltsp chroot to create an /etc/init.d/x11vnc init script:

# cat <<__END__ > /etc/init.d/x11vnc
case "$1" in
                start-stop-daemon --start --oknodo \
                        --pidfile /var/run/ --background \
                        --nicelevel 15 --make-pidfile --exec \
                        /usr/bin/x11vnc -- -display :6 -loop -passwdfile /etc/x11vncpassword -nossl
                start-stop-daemon --stop --oknodo --pidfile /var/run/
                $0 stop
                $0 start
                echo "Usage: $0 start|stop|restart"

Then make it executable and link it into /etc/rc2.d:

# chmod 755 /etc/init.d/x11vnc
# cd /etc/rc2.d
# ln -s ../init.d/x11vnc S99x11vnc

Finally, create the /etc/x11vncpassword file with the password you want to use to connect to your thin clients:

# echo "thepassword" > /etc/x11vncpassword
# chmod 400 /etc/x11vncpassword
# chown root:root /etc/x11vncpassword

For better security you should consider setting x11vnc up to use system authentication (say, to your LDAP directory). That's far outside the scope of this HOWTO, but if you want to look into it you should start with the x11vnc documentation.

Exit the chroot environment

Having installed the x11vnc package and set x11vnc up to run when the thin client starts up you are ready to exit the chroot environment:


Update the LTSP image

Ubuntu/Edubuntu 7.10 and onwards - Make sure that the ltsp image gets updated:

sudo ltsp-update-image

If you are using an i386 image on an AMD64 build the command is:

sudo ltsp-update-image --arch i386

Testing it out

Reboot your thin clients and you should be able to connect to them via vnc now. For example, if you had a thin client at IP address you could connect to it with:

xvnc4viewer -FullColour

(omit -FullColour for faster but uglier access to the remote screen).

You may find the thin-client-manager package and the strangely named student-control-panel command it installs useful when managing thin clients with VNC. Run the following command on the ltsp server (NOT in the ltsp chroot):

aptitude install thin-client-manager

then launch it with:

sudo student-control-panel

and browse your connected users, view their screens, etc.


InstallX11VncOnLtspClients (last edited 2008-08-06 16:31:41 by localhost)