LTSP Mini How To Daya Ram Budhathoki dayaramb (At) gmail.com    LTSP Nepal, ltspnepal.org.np

LTSP Mini How To
LTSP Mini How To
Switch
LTSP server
LTSP Workstations
Daya Ram Budhathoki dayaramb (At) gmail.com
LTSP Nepal, ltspnepal.org.np
Madan Puraskar Pustakalaya
mpp.org.np
Feb 2008
1
LTSP Mini How To
Table of contents
1. Introduction
1. what is ltsp ?
2. why ltsp ?
2. Clients and server hardware Requirements
1. PXE boot
2. Etherboot
3. Steps to create a floppy disk or CD Etherboot image.
3. Basic Architecture of LTSP LAB 4. LTSP major networking services 1. dhcp 2. tftp 3. nfs 4. ssh 5. ldm 5. configuring ltsp in NepaLinux
6. Building LTSP in standalone system 7. LTSP in chrooted environment 8. LTSP boot process 9. Clamping CAT5 Network cable
10. LTSP troubleshooting 2
LTSP Mini How To
Introduction:
What is LTSP?
LTSP is an open source project (http://ltsp.org) that adds thin client support to the Linux Server. A thin client is a client computer which completely depends on central server for processing activities and mainly focuses on conveying input and output between the user and the remote server. Applications typically runs on the server and accept input and display their output on thin client display. LTSP clients doesn't need any storage devices such as HardDisk, and can be used the minimal configuration PC. Besides economical, the important aspects of LTSP is re­usability of computer hardwares. The old and low configurations PC such as Pentium II and Pentium III can be used as LTSP thin clients.
Why LTSP?
1.Economical:
Its very economical to use LTSP for setting a lab in school, colleges and other sectors for eg. Cyber cafe. The cost may be reduced by 50 to 75 % depending upon the Hardwares used for the thin clients. Able to save a lot of money in workstation is the major advantages of LTSP.
2.Re­ usability:
Re­usability is another important aspects of LTSP. Old and depreciated hardwares can be used in case of LTSP thin clients.
3.Centralized Administration:
The administrator don't have to move each and every client for administration of softwares and backups. He can sit in the server, and manages the users account and monitor the system and network overload. This reduces the administration costs. You never need to worry about installing softwares and managing spaces in the individual PCs.
4.Additional peripherals:
Any additional peripherals such as Printers, Scanner, removable media can be made available to each clients without any additional configuration.
5.Open Source project:
Its the open source project under GPL that runs in Linux system. Its freely available to download or it comes by default out of Box in some Linux distribution such as Edubuntu and NepaLinux. So you don't have to depend on proprietary software to setup the LTSP lab.
3
LTSP Mini How To
Clients and Server Hardware Requirements
Clients Hardware Requirement
In clients the list you don't required will be more than what you required. Any way, you don't required any storage devices, HardDisk, CD/DVD and floppy(provided you have NIC that supports the network boot options.)
Processors:
Any processor 233 MHz or better would provide acceptable performance. 533 MHz or above provide best thin clients.
Memory:
Client system only required minimal memory, As swap is in server and only minimal application are run on the clients. 128 MB RAM in client is sufficient.
Network:
A thin client boots over the network using a network boot loader. This network boot loader is sometimes located in the card itself, or for older card the user can provide it in CD­ROM and floppy which can be used to boot the thin clients.
There are two common Network boot loaders:
PXE
Etherboot
PXE
PXE stands for Preboot Execution Environment (PXE) , is an open industry standard developed by different softwares and hardware vendors. PXE works with NIC in the PC and makes NIC a boot device. PXE boot a client PC from the network by transferring a boot image file from the server. This file acts as pre­OS agent to the client. Since PXE works with NIC, it requires a PXE­enabled NIC. Most of the currently available NIC do support PXE, including those from 3com, Intel, Digital, RealTek. PXE is available either as a boot ROM chip that you add to the NIC, or as part of the system BIOS if the network interfaces is on the motherboard. If you have PXE enabled NIC, you can boot through the network without any problem.
4
LTSP Mini How To
Etherboot
Etherboot is a software package for creating ROM images that can download code over an Ethernet network to be executed on an x86 computer. Many network adapters have a socket where a ROM chip can be installed. Etherboot is code that can be put in such a ROM. Etherboot is normally used for for booting PCs diskless. If your NIC doesn't support PXE, you can create a boot image in CD or Floppy. The Etherboot project( www.etherboot.org) offers the software that you can use to create a floppy disk or CD Etherboot image.
Steps to create a floppy disk or CD Etherboot image.
1. open the http://rom­o­matic.net from the Browser, and select the link to the latest production release (for now 5.4.3). You see a page that dynamically generates Etherboot images.
2. Choose NIC/ROM type. You can determine the NIC in your computer by using the lspci command. You can run this command by running the live CD such as NepaLinux in the computer. Most supported NIC appears in the class 0200.
You can run the command lspci ­n |grep 200
eg. daya@nepalinux:~$ lspci ­n |grep 200 00:12.0 0200: 1106:3065 (rev 74) The identifier after the class number is the family, For me, matching is , via­rhice:dlink­503tx –
[Ox1106:3065]
3. Now choose the ROM output format. You can output the ROM as a bookable ISO image that can be used on CD/ DVD or floppy. Use “Floppy bootable ROM Image (.zdsk)” to create a boot floppy and “ISO bootable image without legacy floppy emulation (.iso)” to create a CD/DVD image. 4. Configure ROM is optional, so neglect it.
5. Now click on Generate ROM to create and download the ROM image.
6. Copy ROM to medium,
For floppy, cat ROM­image­name > /dev/fd0
For CD/DVD use, cdreocord or GUI tools like gnomebaker or k3b
5
LTSP Mini How To
Server Hardware Requirements
Disk Space:
Depends upon the no. of clients and the space you required. 200 GB SATA will best work in a school with 10 terminals. Even it depends on the need.
Memory
The usual formula for calculating the memory requirement is:
256 + *128 * users) MB
so for 10 thin clients 2 GB RAM is sufficient.
Processors:
How fast the processor is to use depends entirely on what applications you plan to run in thin clients. The education application such as tuxmath, tuxtype and gcompris and interactive games requires more than a word processor. 3.0GHz processor would better handle more than 10 clients in my experience. For larger networks moving to multiple cpu server may be advantageous. The new technology Dual­core provide good results.
Network:
It you have more thin clients, it would be better to use Gigabit Ethernet port of the server connected to the Gigabit port of the switch.
6
LTSP Mini How To
Basic Architecture of LTSP Lab.
LTSP System is designed to use minimal hardware referred to as thin clients which are driven by the central server. The client doesn't need any storage device such as HardDisk and CD/DVD which effectively reduces the cost. LTSP also support the concept of re­usability i.e old computers such as Pentium II and III can be used as thin clients.
The clients and sever are put in a network as shown in fig. The clients are then configured to boot from the Network.
Switch
LTSP server
LTSP Workstations
Fig.. LTSP Architecture
Applications typically run on the server and accept input and display their output on the thin client display. LTSP is available as a set of packages that can be installed on any Linux system. It is also available as a part of complete distributions, such as NepaLinux, Edubuntu Debian. LTSP major networking services
The detail knowledge of these services are required in order to fully understand the working principle of LTSP.
1. DHCP
2. TFTP
3. NFS
4. SSH
5. LDM
7
LTSP Mini How To
What is DHCP ?
DHCP stands for Dynamic Host configuration protocol is a TCP/IP Application layer protocol used to provide networking information such as IP address, subnet mask, gateway, DNS etc dynamically to workstations.
DHCP Working Principle
DHCPDISCOVER
Broadcast for a DHCP Server
Client IP: ??
Gateway: ??
DNS: ??
DHCPREQUEST
Broadcast requesting configuration information sent in DHCPOFFER
Pool: 192.168.1.0/24
Gateway: 192.168.1.1
DHCPREQUEST
Broadcast requesting configuration information sent in DHCPOFFER
DHCPACK
Acknowledge configuration information and begins lease
After all Four
operations
Client IP: 192.168.1.10/24
Gateway: 192.168.1.1
DNS: 192.168.1.6
8
Fig. DHCP working priciple
DNS Server: 192.168.1.6
LTSP Mini How To
IP addresses is leased for a predefined amount of time called lease time. The configuration file for dhcp is dhcpd.conf stored in directory /etc/dhcp3 directory.
DHCP is used to pass the information to the client which it needs during boot. This can include the IP address, DNS, gateway etc. DHCP is also used to by the LTSP to identify the location of the bootstrap or Linux Kernel each workstation need to boot from.
DHCP configuration file used in LTSP system
To understand in detail about the DHCP and its role in LTSP please go through the sample configuration file dhcpd.conf.
authoritative; subnet 192.168.0.0 netmask 255.255.255.0 { range 192.168.0.10 192.168.0.100; option domain­name "example.com"; option domain­name­servers 192.168.0.1; option broadcast­address 192.168.0.255; option routers 192.168.0.1; next­server 192.168.0.1; # get­lease­hostnames true; option subnet­mask 255.255.255.0; option root­path "/opt/ltsp/i386"; if substring( option vendor­class­identifier, 0, 9 ) = "PXEClient" { filename "/ltsp/i386/pxelinux.0"; } else { filename "/ltsp/i386/nbi.img"; } } The keyword authoritative at the top of the configuration file indicates that the DHCP server in the network is authoritative. It indicates that the DHCP server should send DHCPNAK messages to mis­ configured clients. If this is not done, clients will be unable to get a correct IP address after changing subnets until their old lease has expired, which could take quite a long time.
9
LTSP Mini How To
The next parameters is range. Its the range of the IP address which are to be broad­casted and hence leased by the server to the clients.
The parameters which begins with options, such as domain­name, domain­name­server, routers,broadcast address sets the individual settings. Note the option next­server it should be set to the IP address of the LTSP server. The root path to the LTSP is /opt/ltsp/i386 as indicated in the DHCP configuration file.
Now Lets see the last parameters of the configuration file, inside if and else statements.
if substring( option vendor­class­identifier, 0, 9 ) = "PXEClient" { filename "/ltsp/i386/pxelinux.0"; } else { filename "/ltsp/i386/nbi.img"; } These statements are used to identify what kind of boot loader to use in client system, the DHCP server checks if the vendor­class­identifier from each client is PXEClient. If it is, the pxelinux.0 boot kernel (PXE) is used. If it’s not, the nbi.img boot kernel (Etherboot) is used. You can add Host specific setting in the dhcpd.conf file as well. For detail configuration parameters please refer the man pages, man dhcpd.conf.
Always remember that you have restart the dhcp service when you have made the changes. You can restart it by the command invoke­rc.d dhcp3­server restart
NFS
Network File System (NFS) is a network file system protocol that is used to make a directory (and its subdirectories) available to the network on UNIX and Linux based system. Given the proper permission the users can mount that directory, and access that directory as if it is stored locally. Since LTSP client has not any storage device(DISK) directory structure is provided by NFS. 10
LTSP Mini How To
/etc/exports is the configuration file for NFS. The basic syntax of exports file.
<Directory to share> <network><options>
eg. /opt/ltsp *(ro,no_root_squash,async) or 192.168.0.0/255.255.255.0(ro,no_root_squash,async)
You can start the nfs services by invoke­rc.d nfs­kernel­server restart
TFTP:
tftp stands for Trivial file system protocol. TFTP is a simple file transfer protocol which can be implemented in minimal amount of memory. It is used primarily to boot diskless workstation. TFTP service is actually used to download the bootstrap file i.e Linux kernel from the server. TFTP unlike ftp is UDP and works on port 69.
SSH
SSH (Secure Shell) is a protocol to login unto remote system. SSH provides an encrypted session for transferring files and executing server programs. X server starts encrypted ssh tunnel to the server and finally login prompt is presented to the thin client.
LDM(LTSP Display Manager)
The LTSP Display Manager, or ldm is the display manager specifically written by the LTSP project to handle logins to a GNU/Linux server. LDM has a lots of features. It is written in C, for speed and efficiency. It can be configured to encrypt X­Widows traffic for better security or leave it un­encrypted for better performance in slower client. It supports logging in via either a greeter ( a graphical login application) or auto login.
11
LTSP Mini How To
By default, LTSP5 encrypts the X session between the server. This makes your session more secure, but at the cost of increased processing power required on the thin client and on the server. If processing power is a concern to you, it's very easy to specify that the connection for either an individual workstation, or the default setting should use an unencrypted connection. To do so, simply specify: LDM_DIRECTX=True Format of lts.conf file,
1. Section Heading: Section headings begin with an identifier in square brackets. f:It can be MAC address of the client or IP address or Host name of the client. 2. Variable assignments
After the section heading, you can then define variables. BOOLEAN_VARIABLE = True/False or Yes/No or Y/N whichever you prefer,
STRING_VARIABLE = Information
comments can be inserted in your file for documentation purpose. lts.conf file is located in /opt/ltsp/i386/etc/ directory.
some important parameters in lts.conf
X_MODE_0=1024x768 SOUND=True LOCALDEV=True X_COLOR_DEPTH=16 LOCAL_STORAGE=True
SOUND_DAEMON=pulse to force the resolution to the client.
Enables sound in clients
Enable Local Devices in Clients(Such as hardDisk and CD­ROM)
Specify the color depth to be 16.
Enable Local Storage device in client such as USB Disk.
Force Sound Daemon to be pulse.
Auto login features
New LDM supports auto login. Specify it in lts.conf,
[00:E0:81:27:D6:AE]
LDM_USERNAME=daya
LDM_PASSWORD=daya
12
LTSP Mini How To
Configuring LTSP in NepaLinux:
NepaLinux LTSP DVD contains LTSP out of Box. For configuring LTSP in NepaLinux simply install it as told in the installation manual and configure your network interface card to use the IP 192.168.0.1 and subnet mask 255.255.255.0. If you want to use your own stetting you have to edit dhcp configuration file.
By default, sound ,usb get worked in NepaLinux LTSP thin client. You only have to make necessary arrangement for client to boot from the Network.
Building LTSP in Standalone System (Debian Based System): (Ref:wiki.debian.org/LTSP)
Use backported pkgs. For newer ltsp pkgs and pulseaudio.
1. Add the key(s) for the repository to your keyring(after verifying that you trust them): 1. wget http://pkg­ltsp.alioth.debian.org/debian/pkg­ltsp­keyring 2. apt­key add pkg­ltsp­keyring 2. Add to /etc/apt/sources.list: •
deb http://pkg­ltsp.alioth.debian.org/debian etch­ltsp­backports main 3. Update: •
apt­get update 4. Install new packages: •
apt­get install ltsp­server­standalone 5. When building a chroot, you'll need to tell it to use the backport sources: ltsp­build­client \ ­­extra­mirror "http://pkg­ltsp.alioth.debian.org/debian etch­ltsp­backports main" \ ­­apt­key /etc/apt/trusted.gpg to get sound working with pulseaudio+alsa: •
/usr/share/doc/ltsp­server/README.Debian.sound to get local devices working with ltspfs (usb sticks, cdrom, floppy): 1. echo fuse >> /etc/modules
13
LTSP Mini How To
LTSP ch­rooted environment:
LTSP stores the directory structure needed by each workstation in the /opt/ltsp/i386 directory of the server. Almost all the files and directories are shared by the client while you can force each workstation to add specific setting by editing the main ltsp configuration file lts.conf file located in /opt/ltsp/i386/etc/lts.conf. To change LTSP specific setting you can run the command “chroot /opt/ltsp/i386” for example to set the root password in LTSP, you chroot to the directory and run the command to set the root password. This root password is used to login in each thin client in tty1 i.e in command line terminal for troubleshooting purposes such as to note the clients hardware settings.
14
LTSP Mini How To
LTSP Boot process:
I tried to show a very basic boot process of a thin client in the following block diagram.
Load Kernel in thin client's Memory
through Etherboot or PXE
DHCP
Kernel will initialize entire system
and all the peripherals it recognizes
TFTP
Root File system /opt/ltsp/i386
exported by nfs is loaded
NFS (NBD in
edubuntu 7.10)
During kernel load process
initramfs image is also loaded
init srcipts
Several Scripts are executed in
client such as ltsp-client-core
LDM & SSH
X-window system will be launched
giving you a GUI interface
Fig. LTSP boot process
15
LTSP Mini How To
Clamping CAT5 Network cable:
Although you can follow your own way of cabling, its recommended to follow the standard presented below for avoiding confusion. For PC to Switch use Strght­thru and from PC to PC use cross­over. For LTSP we use straight­thru cabling, and crossover is used only for testing the purposes.
PC
PC
Switch
PC
Fig. CAT5 cabling standards and pairs uses in Ethernet
16
PC
LTSP Mini How To
LTSP Troubleshooting:
1. Check the Hardware and connection:
Check the hardware, if it is working properly. Check the network connection, by issuing ping command.
2. Can't boot PXE
Make sure that your NIC supports the PXE and you have properly set the boot options in BIOS to boot from the Network as first option in boot methods.
3. Can't boot Etherboot:
Check the media such as floppy and CD/ROM or USB are not corrupt. Re­check for the probability of wrong driver for NIC you choose to build the Etherboot image.
4. DHCP failure
check whether DHCP is running in the server or not. If you have made individual setting in the client make sure that correct MAC address is specified in the dhcp configuration file.
5. TFTP Failure
Make sure that tftp service is enabled in the server. Note that correct Kerenl file is specified in the dhcpd.conf file.
6. NFS Failure
If you see the message /opt/ltsp/i386 mount failure, then for some reason thin client is not able to mount the remote file system. For this check whether nfs is running in the server or not. Check the firewall settings, they may have cause the issues.
7. Graphical Interface fails:
This may be the reason the thin clients video card is not detected. X window system can't start. For this try passing specific parameters in lts.conf file in server. (XSERVER=<value>). For detail refer to the lts.conf documentation.
8. Login failure:
Make sure that user account is added in the server, and proper user and password is typed in the client.
9. Sound and USB Error
For USB verify that, fuse module is loaded and user is kept in the fuse group. For sound, make sure that pulseaudio is started in the client, you can check it by running alsamixer command. Make sure that you have used ALSA as output plugin in the sound application such as totem or xmms.
17
LTSP Mini How To
References:
1. http://ltsp.org 2. http://wiki.debian.org/LTSP 3. http://etherboot.org 3. http://cisco.com 4. edubuntu handbook( http://doc.ubuntu.com/edubuntu/edubuntu/handbook/C/)
5. http://rom­o­matic.net 18