Introduction: Ltsp Clustering.

About: Bytesize articles instead of a trilogy in one post.

This page is specific to Ubuntu versions 9.10, 10.04

If you find this information applicable to additional versions/releases, please edit this page and modify this header to reflect that. Please also include any necessary modifications for this information to apply to the additional versions.


When there is a need for hundreds or thousands thin clients, you need a ltsp-cluster. Read more about ltsp-cluster:

In this guide we install very basic, but working ltsp-cluster for testing and studying purpose. We use here "A setup with internet connection" from wiring howto:

We need two x86_64/amd64 servers. First one is root server for all thin clients. Second one is application server for all thin clients in this guide. In the real world you need more than one application server, of course. And one server for home files (NFS) and one server for managing all the users (openLDAP). But as we said – this is very basic ltsp-cluster, just something to get familiar and start with.

Here is Stéphane Graber's excellent guide:

We have named two server this way.

Ltsp-root01 – | Ltsp-appserv01 –

Both servers need to know each others.

cat /etc/hosts       localhost   ltsp-root01   ltsp-appserv01

For the installation we need two CD's.

For the root server we need "64-bit PC (AMD64) server install CD".

For the application server we need “64-bit PC (AMD64) alternate install CD".

Note: somehow the last section disappeared. It has been restored.

Step 1: Root Server for LTSP-Cluster

Some of this may be old hat by now.

Root Server for LTSP-Cluster

We use "64-bit PC (AMD64) server install CD" to install root server. Do not install anything extra – just SSH server. After that make all updates and upgrades.

sudo apt-get update
sudo apt-get dist-upgrade

uname -a
Linux ltsp-root01 2.6.31-12-server #40-Ubuntu SMP Wed Oct 7 05:13:39 UTC 2009 x86_64 GNU/Linux

Install ltsp- and dhcp3-servers

Install ltsp- and dhcp3-servers in root server.

sudo apt-get install ltsp-server dhcp3-server

Modify dhcp3.conf for your network. Here we use this one. Note: File is not in /etc/ltsp directory!

sudo nano /etc/dhcp3/dhcpd.conf

# /etc/dhcp3/dhcpd.conf
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
log-facility local7;
subnet netmask {
  option domain-name "ubuntu-ltsp5";
  option domain-name-servers;
  option routers;
  filename "/ltsp/i386/pxelinux.0";

Restart dhcp3-server.

sudo /etc/init.d/dhcp3-server restart

Build chroot

Thin clients need 32-bit chroot. Build that one this way in root server.

sudo ltsp-build-client --arch i386 --ltsp-cluster --prompt-rootpass

When asked for ltsp-cluster settings answer as follow. Remember change “Server name” if needed.

Configuration of LTSP-Cluster
NOTE: booleans must be answered as uppercase Y or N
Server name:
Port (default: 80): 80
Use SSL [y/N]: N
Enable hardware inventory [Y/n]: Y
Request timeout (default: 2): 2

Root user passwd for chroot will be asked, too.

Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Your answered setup is in this file: /opt/ltsp/i386/etc/ltsp/getltscfg-cluster.conf


Step 2: Install Ltsp-cluster-control

Install ltsp-cluster-control

Install web based admin program for thin clients in root server.

sudo apt-get install ltsp-cluster-control postgresql

Modify program's configuration file. Note: Do not left any empty lines before or after php-tags (<?php / ?>) - php will not run!

sudo nano /etc/ltsp/ltsp-cluster-control.config.php

In this setup we use this one. Note all database related information.

    $CONFIG['save'] = "Save";
    $CONFIG['lang'] = "en"; #Language for the interface (en and fr are supported"
    $CONFIG['charset'] = "UTF-8";
    $CONFIG['use_https'] = "false"; #Force https
    $CONFIG['terminal_auth'] = "false";
    $CONFIG['db_server'] = "localhost"; #Hostname of the database server
    $CONFIG['db_user'] = "ltsp"; #Username to access the database
    $CONFIG['db_password'] = "ltsp"; #Password to access the database
    $CONFIG['db_name'] = "ltsp"; #Database name
    $CONFIG['db_type'] = "postgres"; #Database type (only postgres is supported)
    $CONFIG['auth_name'] = "EmptyAuth";
    $CONFIG['loadbalancer'] = ""; #Hostname of the loadbalancer
    $CONFIG['first_setup_lock'] = "TRUE";
    $CONFIG['printer_servers'] = array(""); #Hostname(s) of your print servers
    $CONFIG['rootInstall'] = "/usr/share/ltsp-cluster-control/Admin/";

Create new user for database. Use same passwd as above (db_password = ltsp)

sudo -u postgres createuser -SDRIP ltsp
Enter password for new role: 
Enter it again: 

Create new database.

sudo -u postgres createdb ltsp -O ltsp

Move to the new directory and create tables in database.

cd /usr/share/ltsp-cluster-control/DB/

cat schema.sql functions.sql | psql -h localhost ltsp ltsp

Password for user ltsp: 

Now you have to act as a root user and move to the /root directory.

sudo su
cd /root

Get two files for database.



Modify file, use same information for database as above.


import pgdb, os, sys

#FIXME: This should be a configuration file

Install one python-package.

apt-get install python-pygresql

Stop Apche2 and install two files.

/etc/init.d/apache2 stop

python rdp+ldm.config

Cleaned status table
Cleaned log table
Cleaned computershw table
Cleaned status table
Cleaned log table
Cleaned computershw table
Regenerated tree

Start Apache2 again.

/etc/init.d/apache2 start

Stop acting like a root user.


Open your Firefox and go to the admin web page.


In the first page (“Configuration”) make few changes, this way.

LANG = en_EN.UTF-8
SCREEN_07 = ldm

Create a new node.

  • Press the Create child buton
  • Type the name of your node in the Name field and press save

Here are some screenshots after all setups.

Install loadbalancer

Install loadbalancer in root server.

sudo apt-get install ltsp-cluster-lbserver

Modify information for loadbalancer.

sudo nano /etc/ltsp/lbsconfig.xml

Here we have only one application server: <node address="" name="ltsp-appserv01"/>

We have changed group name to “karmic” and max-threads to “1”.

cat /etc/ltsp/lbsconfig.xml

<?xml version="1.0"?>
    <lbservice listen="*:8008" max-threads="1" refresh-delay="60" returns="$IP"/>
    <lbslave is-slave="false"/>
    <mgmtservice enabled="true" listen="*:8001"/>
        <group default="true" name="karmic">
            <node address="" name="ltsp-appserv01"/>
        <variable name="LOADAVG" weight="50">
            <rule capacity=".7"/>
        <variable name="NBX11SESS" weight="25">
            <rule capacity="$CPUFREQ*$CPUCOUNT*$CPUCOUNT/120" critical="$CPUFREQ*$CPUCOUNT*$CPUCOUNT/100"/>
        <variable name="MEMUSED" weight="25">
            <rule capacity="$MEMTOTAL-100000"/>

We have now root server ready.

Step 3: Application Server

Application Server for LTSP-Cluster

We use "64-bit PC (AMD64) alternate install CD" to install application server. Do not install anything extra – nothing at all LTSP related. After that make all updates and upgrades.

sudo apt-get update
sudo apt-get dist-upgrade

uname -a
Linux ltsp-appserv01 2.6.31-12-generic #40-Ubuntu SMP Wed Oct 7 04:13:44 UTC 2009 x86_64 GNU/Linux

We install following packages.

sudo apt-get install ubuntu-desktop ltsp-server ltsp-cluster-lbagent ltsp-cluster-accountmanager

Remove few useless packages.

sudo apt-get remove --purge gnome-screensaver compiz

Be sure that everything is in good shape.

sudo apt-get autoremove && sudo apt-get autoclean

Remove following services.

sudo update-rc.d -f nbd-server remove

sudo update-rc.d -f gdm remove

sudo update-rc.d -f bluetooth remove

sudo update-rc.d -f pulseaudio remove

Create following file and copy this inside that file.

sudo nano /etc/xdg/autostart/pulseaudio-module-suspend-on-idle.desktop

[Desktop Entry]
Name=PulseAudio Session Management
Comment=Load module-suspend-on-idle into PulseAudio
Exec=pactl load-module module-suspend-on-idle

Create a test user and add user to the following groups.

sudo adduser ltsp001

sudo adduser ltsp001 fuse

sudo adduser ltsp001 audio

sudo adduser ltsp001 video

If ltsp-cluster-accountmanager is killing user sessions when using ldap authentication add the following to the /etc/pam.d/common-session file

session    optional unrwap
session    optional nox11

We have updated and upgraded chroot and installed ssh, nano, mc and htop in chroot for testing purpose.

Here is user “ltsp001” at application server “ltsp-appserv01”

ltsp001@ltsp-appserv01:~$ uname -a
Linux ltsp-appserv01 2.6.31-12-generic #41-Ubuntu SMP Wed Oct 7 19:37:12 UTC 2009 x86_64 GNU/Linux

Here is user “root” at thin client “ltsp200”

root@ltsp200:~# uname -a
Linux ltsp200 2.6.31-12-generic #41-Ubuntu SMP Wed Oct 7 18:42:46 UTC 2009 i686 GNU/Linux
root@ltsp200:~# ps ax | grep ltsp
 2291 ?        S      0:00 /bin/sh /usr/share/ltsp/screen_session 07
 4108 ?        S      0:00 /bin/openvt -f -w -c 7 -- /usr/share/ltsp/screen.d/ldm
 4109 tty7     Ss+    0:00 /bin/sh /usr/share/ltsp/screen.d/ldm
 4222 tty7     S+     0:00 xinit /usr/share/ltsp/xinitrc /usr/sbin/ldm -- :7 vt7 -auth /var/run/ldm-xauth-iVl786vMH/Xauthority -br
 4486 pts/0    Ss+    0:00 ssh -Y -t -M -S /var/run/ldm_socket_4241_192.168.1.102 -o NumberOfPasswordPrompts=1 ltsp001@ echo LTSPROCKS; /bin/sh -
 5407 ?        Ssl    0:00 sshfs -o allow_other,ControlPath=/var/run/ldm_socket_4241_192.168.1.102 /home/ltsp001
 5495 tty7     S      0:00 /bin/sh /usr/bin/ltsp-localappsd
 5499 tty7     S      0:00 ssh -Y -t -S /var/run/ldm_socket_4241_192.168.1.102 -l ltsp001  XDG_DATA_DIRS=/tmp/ltsp-localapps-ltsp001-MITLUY/:/usr/local/share/:/usr/share/ LTSP_CLIENT= LTSP_CLIENT_HOSTNAME=ltsp200  DISPLAY=  PULSE_SERVER=tcp: ESPEAKER= /etc/X11/Xsession default < /dev/null > /dev/null ; /usr/sbin/ltspfsmounter all cleanup
 5651 pts/1    S+     0:00 grep ltsp