LTSP

The Linux Terminal Server Project (website) is a collection of scripts and documentation to create a cluster of thin clients. For instance, an entire client chroot environment is built with a single command: ltsp-build-client. This article will guide you through the installation and configuration of a basic LTSP 5 system.

This guide shows you how to install and configure the Gentoo LTSP 5 port. This guide assumes some knowledge of thin client architecture and experience in manually installing Gentoo. Also, you need a server and client with the specifications listed in the LTSP manual. Concerning the client networkcard, only PXE is included in this manual.

Several resources can help you speed you on your way in time of need. Others are listed in the Resources section. For more online LTSP help, you can visit #ltsp on one of the freenode irc servers.
 * LTSP Administrator's Reference
 * LTSP upstream development page
 * LTSP mailing lists

Bugs can be reported in two locations. Check known issues before a potential duplicate.
 * Gentoo - For issues related to Gentoo
 * Upstream - For issues related to LTSP itself

Installation
Gentoo's LTSP packages are stored in the ltsp-overlay. To use the Gentoo LTSP-Overlay, get it with. Because ltsp resides in the git overlays, the git USE flag is needed.

In case you are using stable settings for your architecture, add the following to package.keywords.

The LTSP server package needs a tftp and dhcp server (dhcp or dnsmasq). In this tutorial and  are used. It also requires a system logger which can accept client messages over tcp, for which is used in this tutorial. Don't forget to add a window manager, ltsp-client won't log in if no window manager is installed on the server.

Kernel
Besides the obvious drivers, the server kernel ought to have the following settings. If you're going to use NFS to serve the chroot environments, make sure to compile it in as well and reboot afterwards.

DHCP and PXE-boot
First, setup the server to provide client machines with a kernel at boottime. Install a few packages on the server. The PXE boot loader is provided by. Dnsmasq is a simple DHCP/DNS server. Advanced TFTP is one of the TFTP server options, and the only one to support multicast TFTP.1 The chroot environments as well as the kernels served at boot time are stored in /opt/ltsp. Configure dnsmasq as a DHCP server:

Configure next. This is used for the client nodes to retrieve the kernel and initrd/initramfs, before they mount their root filesystems via NFS.1

Set up the PXE boot loader next. First, copy the executable into the TFTP root from where it was installed. Create the configuration directory after that and populate it with a default file. In the example configuration, the system mounts the local client disk after booting and loading the kernel from the server. Make sure the kernel and initramfs are in /var/lib/tftpboot. You can test the work so far with a working kernel and system.

Start the services, now and at every boot

NFS and Xinetd
The chroot environments are shared with NFS. Xinetd is used for ldminfod and nbd sharing. By default only the localhost is allowed access, so edit the /etc/xinetd.conf and restart the service.

Client Install
The ltsp-server package amongst others ships a command called ltsp-build-client. This command is responsible for building the entire chroot environment. And while ltsp-build-client and available plugins setup the environment, Quickstart actually builds it.

Configuration
You can invoke the build script with command line arguments or configure the config file in /etc/ltsp/ltsp-build-client.conf. Commandline options take precedence over config file options. If you encounter some problems and have to perform ltsp-build-client again, the program tells you to remove the entire chroot environment. It is recommended to first copy the downloaded stage outside the chroot and point the ltsp-build-client command to it, so it won't have to be downloaded again.

Kernel
A separate section for the client kernel is in order. A standard Genkernel kernel is created during the installation when configuration changes are made. It's advisable to take a closer look at the client's kernel config and use the config during the client install.

Building the Client
By default, the packaged quickstart profile in /etc/ltsp/quickstart/profile.qs is used with no debug options. Another profile can be selected with command line options. The kernel config you just made can be used in the build process by adding the server vars to ltsp-build-client.conf (See in Configuration section above).

After invoking the ltsp-build-client command, the environment is preparing. For each architecture the first build takes up the most time because binary packages are created from source in the first run. These binary packages are stored in /usr/portage/packages through a bind mount on your server. Any consequent builds use these packages to speed up the process.

Finishing the Install
Some things still need to be done after building the environment. First up is the kernel, which needs to be put in your tftroot. In the default setup, this is copied from the chroot in and copied to the tftproot in an ltsp subdir in /var/lib/tftpboot, /tftpboot or /srv/tftp, if one exists. Calling ltsp-update-kernels with a different tftproot location:

Your pxelinux configuration has to be updated to reflect the changes in the setup. See the PXE boot section for more info.

Known Issues

 * If you get an emerge error for "=dev-lang/python-2.6* is not installed", with a "die "$(python_get_implementational_package) is not installed";", this means that some of your binary packages were installed against Python 2.6, Remove your binary packages to let them compile against your new python environment.


 * Several programs will fight for the virtual terminals on the clients. Comment out getty in inittab: