Next Previous Contents

4. LTSP - The Linux Terminal Server Project

The LTSP provides a simple way to utilize low-cost workstations as either graphical or character based terminals on a GNU/Linux server. Using the LTSP, you can take very low-end PCs, remove the hard drives and CD-ROMs, and add floppies or bootable network cards. Many network cards have bootrom sockets just waiting for a bootrom to be inserted. During the boot phase, the diskless workstation obtains its IP info and a kernel from the server, then mounts the root filesystem from the server via NFS.

A workstation using the LTSP can be configured in the following ways:

  1. Graphical Workstation

    The workstation uses the X-Window System to access applications on the Linux Terminal Server

  2. Character-Based Telnet Session

    Multiple telnet sessions are invoked by the client to the telnet server. Users can switch between telnet sessions by pressing Alt+F1 through Alt+F9. However, telnet being an extremely insecure service, the use of this mode is strongly discouraged.

  3. Shell Prompt

    This basically drops the user in a minimalistic bash prompt. This mode is basically a diagonistic or troubleshooting mode that helps debug problems with X or NFS.

Depending on the size of the server and the applications being run, a number of clients can be served by a single Linux server. The LTSP official documentation tells us: "It's not unusual to have 40 workstations, all running Netscape and StarOffice from a Dual PIII 650 with 1GB of ram. We know this works. In fact, the load average is rarely above 1.0!"

4.1 Configuring the Linux Terminal Server

Let us now look at how to configure LTSP on a Red Hat 9 server. Perform all the underlined steps as root

Packages required

The packages required for LTSP are available at ltsp.org. To start, you will need the following packages:

  1. ltspcore-x.x.x.i386.rpm
  2. ltsp_kernel-x.x.x.i386.rpm
  3. ltsp_x_core-x.x.x.i386.rpm
  4. ltsp_x_fonts-x.x.x.i386.rpm
Where x.x.x is the version of the package set downloaded.

Installing the packages

Install the packages as follows:


[root@quaker install_scripts]#rpm -ivh ltspcore-x.x.x.i386.rpm
[root@quaker install_scripts]#rpm -ivh ltsp_kernel-x.x.x.i386.rpm
[root@quaker install_scripts]#rpm -ivh ltsp_x_core-x.x.x.i386.rpm
[root@quaker install_scripts]#rpm -ivh ltsp_x_fonts-x.x.x.i386.rpm

Running the distro-specific install script

Once the packages are installed, change to the directory /opt/ltsp/install_scripts/ and run the script redhat.sh


[root@quaker install_scripts]# cd /opt/ltsp/install_scripts/
[root@quaker install_scripts]# sh redhat.sh

Take a look in /tmp/ltsp.install.log for a complete log of the installation.
 
You now need to change to the /opt/ltsp/templates directory and
run the ltsp_initialize script to complete the installation

Initializing the Services

Now change to the directory /opt/ltsp/templates and run the script ltsp_initialize. Follow the steps as indicated below.


[root@quaker install_scripts]# cd /opt/ltsp/templates/
[root@quaker templates]# ./ltsp_initialize

The Linux Terminal Server Project (http://www.LTSP.org)
                                                                                
                                                                                
    About to update important system files.  If you would like
    to stop and review the changes that are about to be made,
    you can cancel now and look at the replacement files that
    are about to be installed.
                                                               
Press <ENTER> to go on, or 'C' to cancel

<ENTER>


The Linux Terminal Server Project (http://www.LTSP.org)
                                                                                
The following files will be created/modified:
                                                                                
 /etc/X11/xdm/Xaccess               The config file to allow remote xdm log [Y]
 /etc/X11/xdm/Xservers              Config file for xdm to launch local Xse [Y]
 /etc/X11/xdm/Xsetup_workstation    Sets the logo of your login window      [Y]
 /etc/dhcpd.conf.example            Example config file for dhcp            [Y]
 /etc/exports                       The config file for nfs                 [Y]
 /etc/X11/gdm/gdm.conf              The config file for gdm                 [Y]
 /etc/X11/gdm/Init/Default          The gdm startup script                  [Y]
 /etc/hosts.allow                   Configuration file for tcp wrappers     [Y]
 /etc/inetd.conf                    Config file for inetd                   [Y]
 /etc/inittab                       Config file for init                    [Y]
 /etc/kde/kdm/kdmrc                 The config file for kdm                 [Y]
 /etc/X11/xdm/ltsp.gif              The background logo for your login      [Y]
 /etc/rc.d/rc5.d/S60nfs             Startup links for nfs                   [Y]
 /etc/rc.d/rc5.d/S13portmap         Startup links for portmapper            [Y]
 /etc/rc.d/init.d/syslog            Startup script for syslogd              [Y]
 /etc/xinetd.d/tftp                 Enable the tftp daemon                  [Y]
 /etc/X11/xdm/xdm-config            The main config file for xdm/kdm        [Y]
                                                                                
Ready to apply the changes? ( R-Review, A-Apply, C-Cancel )

A<ENTER>


The Linux Terminal Server Project (http://www.LTSP.org)
                                                                                
Doing the update
Xaccess.tmpl
Saving old /etc/X11/xdm/Xaccess as /etc/X11/xdm/Xaccess.2
Xservers.tmpl
Saving old /etc/X11/xdm/Xservers as /etc/X11/xdm/Xservers.2
Xsetup_workstation.tmpl
Saving old /etc/X11/xdm/Xsetup_workstation as /etc/X11/xdm/Xsetup_workstation.1
dhcpd.tmpl
Saving old /etc/dhcpd.conf.example as /etc/dhcpd.conf.example.1
Creating new dhcpd.leases file
Saving old /etc/exports as /etc/exports.2
gdm.conf.tmpl
Saving old /etc/X11/gdm/gdm.conf as /etc/X11/gdm/gdm.conf.2
gdm_Init_Default.tmpl
Saving old /etc/X11/gdm/Init/Default as /etc/X11/gdm/Init/:0
hosts.allow.tmpl
Saving old /etc/hosts.allow as /etc/hosts.allow.2
inetd.tmpl
Saving old /etc/inetd.conf as /etc/inetd.conf.1
inittab.tmpl
Saving old /etc/inittab as /etc/inittab.2
kdmrc.tmpl
Saving old /etc/kde/kdm/kdmrc as /etc/kde/kdm/kdmrc.2
ltsplogo.tmpl
Saving old /etc/X11/xdm/ltsp.gif as /etc/X11/xdm/ltsp.gif.1
nfs.tmpl
Saving old /etc/rc.d/init.d/syslog as /etc/rc.d/init.d/syslog.2
tftpd.tmpl
xdm-config.tmpl
Saving old /etc/X11/xdm/xdm-config as /etc/X11/xdm/xdm-config.2

Configuring the DHCP daemon

Bingo!! That sure does take care of a lot of stuff! Now all we need to do is perform some minor changes to a few configuration files. The first file I usually modify is /etc/dhcpd.conf.

In this example, I assume a server with IP address 192.168.100.13 and a diskless workstation which will be assigned the IP address 192.168.100.14 and hostname ws001. This workstation's ethernet card has a MAC address 00:0B:2B:0B:6B:2E. The netmask is 255.255.255.0 and the domain name is gamingheaven.com.

In order to do this, open the file /etc/dhcpd.conf and make it read as follows (rather, change it to suit your setup ;)). This is a recommended minimum configuration:


ddns-update-style             ad-hoc;
default-lease-time            21600;
max-lease-time                21600;

option subnet-mask            255.255.255.0;
option broadcast-address      192.168.100.255;
option root-path              "192.168.100.13:/opt/ltsp/i386";
#The above line specifies where to fetch the root file system from

shared-network WORKSTATIONS {
    subnet 192.168.100.0 netmask 255.255.255.0 {
    }
}

group   {
    use-host-decl-names       on;
    option log-servers        192.168.100.13;
#configuring the first host
    host ws001 {
        hardware ethernet     00:0B:2B:0B:6B:2E;
        fixed-address         192.168.100.14;
        filename              "/lts/vmlinuz-2.4.9-ltsp-5"; 
#We need to copy the above file to the tftpboot directory.
    }
}

Configuring hostname mapping

Computers usually love communicating with numbers. Human beings on the other hand prefer names because we find them easier to remember. This is where the file /etc/hosts or DNS comes into play. Theoritically, IP address to hostname mapping should not be required. In an LTSP environment, however, we can't do without it because NFS throws permission errors when the workstation tries to mount the root file system over the network. We just need to add a single line to /etc/hosts describing the workstation, so that surely won't be too painful! In my case the line would look like this:


ws001.gamingheaven.com  ws001 192.168.100.14

Workstation-specific configurations

We now need to edit the global LTSP configuration file /opt/ltsp/i386/lts.conf and perform the following steps. Again, this is a recommended minimum configuration.

  1. In the default section edit the line containing SERVER and change it to read

    SERVER = <your server ip>

    In my case, it reads:


    SERVER = 192.168.100.13
    

  2. In the section [ws001] (which you should change to the hostname you set in /etc/dhcpd.conf), you can play with the following options: There are a number of other such parameters to play with, but discussing them all would be beyond the scope of this document.

Setting the Default Display Manager

The ltsp_initialize script does a great job handling all the scripts, but makes a the mistake of setting XDM as the display manager for the clients. I personally enjoy the insane eye-candy of GDM. To use GDM, open the file /etc/inittab, scroll down to the line that reads x:5:respawn:/usr/X11R6/bin/xdm -nodaemon and change it to:


x:5:respawn:/usr/bin/gdm -nodaemon

Well, that's it for the server configuration. Switch to runlevel 5.
[root@quaker etc] init 5

Whoa!! Your LTS is up and running. We still need to work a little to get our workstation up.

4.2 Building the bootdisk for the workstations.

Making the floppy is usually as simple as downloading the boot image from Marty Connor's http://www.rom-o-matic.net. Marty has done an execellent job with the site: it generates boot images on the fly when you enter your network card chip model. The default configuration usually doesnt need changing. For my Realtek 8139 cards (rt8139), I got the following boot image:


eb-5.0.8-rtl8139.lzdsk  

To create the bootdisk, change to the directory containing the downloaded boot image and run the following command:
[sumeet@quaker sumeet]$ dd if=eb-5.0.8-rtl8139.lzdsk of=/dev/fd0

You could also use Etherboot to locally build boot images for various NICs. Etherboot is a package for creating ROM images that can download code over an Ethernet network, to be executed on an x86 computer. It can be downloaded freely from http://etherboot.sourceforge.net/distribution.html.

Creating boot images with Etherboot involves the following steps:

  1. Untar and unzip the sources from the etherboot package
  2. Dive into the "src" directory at the location where you untarred the package.
  3. Insert a floppy into the floppy drive and run the following command:

    make bin32/<network-card-name.fd0>

    For example, with my RTL 8139 cards I need to execute the following steps


    [sumeet@quaker sumeet]$ tar -zxvf etherboot-5.0.8.tar.gz
    [sumeet@quaker sumeet]$ cd etherboot-5.0.8/src/
    [sumeet@quaker src]$ make bin32/rtl8139.fd0
    

Now that your disk is ready, configure the BIOS of your diskless workstations to boot from the floppy and boot them up using this disk. You should get the GDM login window, with an LTSP.org background. Login and enjoy!!

4.3 Shutting down the diskless system

Shutting down a diskless node couldn't be easier. Just press the power switch and walk away. That's it!! Now isn't that easy?


Next Previous Contents
Hosted by www.Geocities.ws

1