InstallX11VncOnLtspClients

Differences between revisions 15 and 16
Revision 15 as of 2008-06-10 11:20:58
Size: 4047
Editor: 202-89-185-120
Comment:
Revision 16 as of 2008-06-10 11:28:14
Size: 4407
Editor: 202-89-185-120
Comment:
Deletions are marked like this. Additions are marked like this.
Line 61: Line 61:
Exit the chroot environment:
{{{
exit
}}}
== A safer and more secure way to run x11vnc on the thin clients ==
Line 66: Line 63:
== 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).
Line 105: Line 102:
# chmod 400 /etc/x11vncpassword
# chown root:root /etc/x11vncpassword
Line 107: Line 106:
When you run <code>ltsp-update-image</code> outside the chroot you should have a working x11vnc setup WITHOUT hacking any core init scripts. This means that your changes won't be trodden on by future system upgrades. 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:
{{{
exit
}}}

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 doesnt 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 <code>/etc/init.d/x11vnc</code> init script:

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

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

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

Finally, create the <code>/etc/x11vncpassword</code> 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:

exit

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 192.168.1.44 you could connect to it with:

xvnc4viewer -FullColour 192.168.1.44

(omit <code>-FullColour</code> for faster but uglier access to the remote screen).

You may find the <code>thin-client-manager</code> package and the strangely named <code>student-control-panel</code> 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)