Gentoo Logo
Gentoo Logo Side

Gentoo - LTSP Guide

Content:

1. Introduction

What is LTSP? 

LTSP is an abbreviation for "Linux Terminal Server Project". Installed on a server it can supply many workstations (so called thin-clients) with identical environments. All applications run on the server and therefore you can use old PCs and convert them into XTerminals. This reduces costs and maintenance especially in an environment where you need to have an uniform workspace on each computer you login, e.g. in schools or firms.

2. Installation

Preliminaries 

All of the examples in this document presume that your server's IP is 192.168.0.254, your domain is named yourdomain.com and your network is 192.168.0.0/24.

Installation 

First of all, you must have a working Gentoo system. Please read the Gentoo Installation Manual for your architecture on Gentoo's Documentation Website.

Then lets begin with the easiest step, installing the ltsp package:

Code Listing 2.1: Emerge LTSP

# emerge ltsp

This will install the following packages as dependencies:

  • XFree: They are called XTerminals, guess why :)
  • DHCP: DHCP is a protocol for automating the configuration of computers that use TCP/IP, used by ltsp to distribute IPs to the workstations.
  • NFS: NFS is a protocol to allow access to harddisks through the network, used by ltsp to mount a base system for the workstations.
  • TFTP: TFTP is a simple file transfer protocol, used by ltsp to transfer the kernel to the workstations.
  • XINETD: Xinetd is a powerful replacement for inetd, with advanced features, used by ltsp to start tftp.

Note: If you have the kde/gnome useflag set, it will also install a complete kde/gnome system.

3. Configuration

After the emerge process has finished all services must be configured:

System Logger 

To analyze problems easier, the system logger must be configured to accept remote connections. Please read the documentation of your system logger on how to achieve this. If, for example, you are using sysklogd, all you need to do is edit /etc/conf.d/sysklogd and add "-r" to the SYSLOGD line:

Code Listing 3.1: /etc/conf.d/sysklogd

SYSLOGD="-m 0 -r"
KLOGD="-c 3 -2"

NFS 

Next step is to edit your /etc/exports file, in order to allow the workstations to mount the root filesystem. There should be at least two lines in it:

Code Listing 3.2: /etc/exports

/opt/ltsp-4.1/i386         192.168.0.0/255.255.255.0(ro,no_root_squash,async)
/var/opt/ltsp/swapfiles    192.168.0.0/255.255.255.0(rw,no_root_squash,async)

Note: You have to alter the network/netmask to match your network/netmask settings.

Now start NFS.

Code Listing 3.3: Starting nfs

# rc-update add nfs default
# /etc/init.d/nfs start

xinetd/tftp 

TFTP requires a bit of configuring to get it to work properly. First, edit /etc/conf.d/in.tftpd to set tftpd's options and path correctly:

Code Listing 3.4: /etc/conf.d/in.tftpd

INTFTPD_PATH="/tftpboot"
INTFTPD_OPTS="-s ${INTFTPD_PATH}"

The -s flag specifies that TFTP is to run in secure chrooted mode (recommended). This means that you don't need to include the /tftpboot path for example in the DHCP configuration.

Next, configure xinetd to run TFTP and allow remote connections. By default TFTP won't be started by xinetd, so edit /etc/xinetd.d/tftp and replace disable=yes with disable=no. If the file is missing just go ahead and create /etc/xinetd.d/tftp with the contents below.

Code Listing 3.5: /etc/xinetd.d/tftp

service tftp
{
        disable = no
        socket_type = dgram
        protocol = udp
        wait = yes
        user = root
        server = /usr/sbin/in.tftpd
        server_args = -s /tftpboot
}

Now edit /etc/xinetd.conf and comment out the line only_from = localhost by prefacing it with a #. Finally, start xinetd.

Code Listing 3.6: Starting xinetd

# rc-update add xinetd default
# /etc/init.d/xinetd start

Name resolving 

In order for the workstation to reach all resources, a correct name resolving must be available. There are several ways to achieve this. One is to configure a DNS server for the local network, the other (and more simple) is to have almost identical /etc/hosts files on all systems. We are going to use the latter.

All workstations must be listed in /etc/hosts. Take a look at the example:

Code Listing 3.7: /etc/hosts

127.0.0.1        localhost
192.168.0.254    server      server.yourdomain.com
192.168.0.1      ws001       ws001.yourdomain.com

DHCP Config 

This is the most complicated step in my opinion, you have to create a valid DHCP Config (/etc/dhcp/dhcpd.conf). Here is an example:

Code Listing 3.8: dhcpd.conf

// Some general options
default-lease-time            21600;
max-lease-time                21600;
use-host-decl-names           on;
ddns-update-style             ad-hoc;

// Bootp options
allow booting;
allow bootp;

// Network Options
option subnet-mask            255.255.255.0;
option broadcast-address      192.168.0.255;
option routers                192.168.0.254;
option domain-name-servers    192.168.0.254;
option log-servers            192.168.0.254;
option domain-name            "yourdomain.com";

// LTSP Path Options
option root-path              "192.168.0.254:/opt/ltsp-4.1/i386";
filename                      "/lts/vmlinuz-2.4.26-ltsp-2";

// If your workstations have ISA NICs uncomment the following
// lines and alter the driver and IO
#option option-128 code 128 = string;
#option option-129 code 129 = text;
#option option-128 e4:45:74:68:00:00;
#option option-129 "NIC=ne IO=0x300";

shared-network WORKSTATIONS {
  subnet 192.168.0.0 netmask 255.255.255.0 {
    // Distribute dynamic IPs to the workstations
    range dynamic-bootp 192.168.0.1 192.168.0.16;
    // Workstation specific configuration for PXE booting
    #host ws001 {
    #  hardware ethernet     00:E0:06:E8:00:84;
    #  fixed-address         192.168.0.1;
    #}
  }
}

If your workstations support PXE, you should list each one of them as we have done with host ws001 (don't forget to uncomment it). Don't give them an adress in the dynamic range, otherwise it would be possible that more workstations have the same IP (which is troublesome). Remember, if you cut-n-paste the above example, replace any "//" comments with "##", or else dhcp will fail to start.

For more documentation on this item read the official dhcp handbook: http://www.dhcp-handbook.com/

Now start DHCP as you did with NFS and xinetd:

Code Listing 3.9: start dhcp

# rc-update add dhcp default
# /etc/init.d/dhcp start

Note: DHCPD needs CONFIG_PACKET and CONFIG_FILTER activated in the kernel to work.

LTSP Configuration 

There are many options to configure your workstations, visit http://www.ltsp.org/documentation/ltsp-3.0-4-en.html#AEN903 for a full description of /opt/ltsp/i386/etc/lts.conf.

As a few suggestions to get started, you will want to first copy /opt/ltsp/i386/etc/lts.conf.example to /opt/ltsp/i386/etc/lts.conf and edit it from there. You may want to try changing the SCREEN_01 option to read SCREEN_01 = startx. To use a USB mouse on the remote client, add the following MODULE lines, and change the X_MOUSE_* lines as follows:

Code Listing 3.10: /opt/ltsp/i386/etc/lts.conf

MODULE_01          = usb-uhci
MODULE_02          = mousedev
MODULE_03          = usbmouse
X_MOUSE_PROTOCOL   = "IMPS/2"
X_MOUSE_DEVICE     = "/dev/input/mice"

Displaymanager 

Now you have to change your displaymanager's configuration to also accept remote connections.

First change your /etc/X11/xdm/Xaccess file, uncomment the following line:

Code Listing 3.11: /etc/X11/xdm/Xaccess

#*                   #any host can get a login window

Now change the configuration of the displaymanager you use:

XDM: In /etc/X11/xdm/xdm-config comment out DisplayManager.requestPort: 0

KDM: In /usr/kde/3.1/share/config/kdm/kdmrc look for the [Xdmcp] section and change Enable = false to Enable = true.

GDM: In /etc/X11/gdm/gdm.conf look for the [xdmcp] section and change Enable = false to Enable = True.

Then start the displaymanager:

Code Listing 3.12: Starting xdm

# rc-update add xdm default
# /etc/init.d/xdm start

Warning: There seem to be problems currently with XDM and GDM. The author used KDM to resolve these issues.

Remember, if your display manager is already running, restarting the X server via CTRL-ALT-BACKSPACE doesn't restart the display manager.

Creating a bootfloppy 

If your workstations don't support PXE booting, you can create a boot-floppy which is used to start your workstations and connect to the terminal server. Go to http://www.rom-o-matic.net, select the latest version, select your NIC, press Get ROM and write the image to a floppy:

Code Listing 3.13: Write floppy image

# cat nicfile.zdsk > /dev/fd0

4. Troubleshooting

There are a lot of things that can be the source of trouble, but there are also several resources around which help you solve your problems:

5. FAQ

Q: My workstations have Pentium II CPUs, but my server is compiled with march=athlon-xp, does this work?

A: This is no problem, because all applications run on the server.

Q: Which CPU and how much RAM should the server have?

A: There is a good document with suggestions at http://ltsp.org/documentation/server_suggestions.html.

Q: Do you have more information about this PXE stuff?

A: Yes, take a look at http://ltsp.org/documentation/eproms.txt and http://ltsp.org/documentation/pxe.howto.html.

Q: Is it possibly to use 3D-Accelerated software on the workstations?

A: If you are using NVidia cards take a look at http://ltsp.org/documentation/nvidia.txt.

Q: In some applications the fonts look crappy, what to do?

A: You have to setup the XFontServer, add USE_XFS=Y to your lts.conf, edit /etc/X11/fs/config and comment no-listen: tcp out, replace XFS_PORT="-1" with XFS_PORT="7100" in /etc/conf.d/xfs and start xfs: /etc/init.d/xfs start. Also doublecheck that /etc/X11/XF86Config (or /etc/X11/xorg.conf) contains FontPath "unix/:7100" in the Files-section.

Q: How can I use the soundcard of my workstation?

A: There is a ltsp-sound package in gentoo, for more instructions read the included README file.

6. Glossary

LTSP "The LTSP provides a simple way to utilize low cost workstations as either graphical or character based terminals on a GNU/Linux server."

PXE "Short for Pre-Boot Execution Environment. Pronounced pixie, PXE is one of the components of Intel's WfM specification. It allows a workstation to boot from a server on a network prior to booting the operating system on the local hard drive. A PXE-enabled workstation connects its NIC to the LAN via a jumper, which keeps the workstation connected to the network even when the power is off."


The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.
Print
line
Updated October 18, 2004
line
Heinrich Wendel
Author

Josiah Ritchie
Author

Sven Vermeulen
Editor

line
Summary:  This guide shows you how to setup a LTSP Server with Gentoo.
line
The Gentoo Linux Store
line
Copyright 2001-2004 Gentoo Foundation, Inc. Questions, Comments, Corrections? Email [email protected].