Gentoo - LTSP Guide Heinrich Wendel Josiah Ritchie Sven Vermeulen This guide shows you how to setup a LTSP Server with Gentoo. 1.3 December 11, 2003 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.

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 core utils:

# emerge ltsp-core

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.
If you have the kde/gnome useflag set, it will also install a complete kde/gnome system.
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.

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:

/opt/ltsp/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)
You have to alter the network/netmask to match your network/netmask settings.

Now start NFS.

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

By default TFTP won't be started, to change this edit /etc/xinetd.d/tftp and replace disable=yes with disable=no. Afterwards, start 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:

127.0.0.1        localhost
192.168.0.254    server      server.yourdomain.com
192.168.0.1      ws-1        ws-1.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:

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/i386";
filename                      "/lts/vmlinuz-2.4.19-ltsp-1";

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.1.1 192.168.1.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).

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:

# rc-update add dhcp default
# /etc/init.d/dhcp start
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.

Displaymanager

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

First change your Xaccess file, uncomment the following line:

#*                   #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:

# rc-update add xdm default
# /etc/init.d/xdm start
There seem to be problems currently with XDM and GDM. The author used KDM to resolve these issues.
Creating a bootfloppy

If you workstations don't support PXE booting, you must create a boot-floppy, which is needed to start your workstations. Go to http://www.rom-o-matic.net/5.0.9/, select your NIC, press Get ROM and write the image to a floppy:

# cat nicfile.lzdsk > /dev/fd0
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:

  • The official documentation: http://www.ltsp.org/documentation/, especially the Troubleshooting section.
  • The gentoo IRC channel: irc.freenode.org #gentoo
  • The ltsp irc channel: irc.freenode.org #ltsp
  • The ltsp mailinglists http://ltsp.org/mailinglists.php are full of some real good knowledge.
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.

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.

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."