Linux Terminal Server Setup HowTo
on Debian Sarge

Attention: This howto is completely outdated and archived here for historic reasons.

Introduction

Quicklinx
Publications
$Id: ltsp-howto.html,v 1.19 2011-05-02 11:52:07 obiwan Exp $

This document will guide you through the setup of a Linux Terminal Server using the LTSP (Linux Terminal Server Project) package from http://www.ltsp.org. LTSP offers a specially for diskless clients tailored and stripped down disk images that can be easily booted over TFTP and mounted over NFS.

Please note that this document is a work in progress and is constantly evolving. If you have comments or additions, please send them to the author.

Target Audience

This HowTo uses Debian Linux for the Terminal Server, while the steps are similar on other Linux platforms like Redhat or SuSE this HowTo is specially tailored to Debian Sarge running on whatever platform Sarge supports (you can even use your old Alpha Server as Terminal Server if you can spare the room for the machine in your home/lab/office *g*).

This HowTo is geared toward SysAdmins that are already able to setup an i386 machine under Debian Linux as graphical desktops, this HowTo won't cover how you get there. There is also a wealth of Linux consultants and enthusiasts around the corner nowadays. If you're a curious enduser you might be able to find a friend or relative that knows enough Linux-Fu to get you started. If you're a business user you might better be off hiring a professional consultant because you probably can't afford to have you're server offline because you we're curious what "shutdown" really means with that linuxish thinggie.

What you will get..

At the end of this HowTo, assuming you really do what I say, you will have a fully featured, opensource Terminal Server, offering a huge amount of programs of all sorts including office tools like OpenOffice, Browsers like Mozilla and Konqueror and lot more.

Your diskless thinclients that you will connect to the newly configured Terminal Server can be build from computers that people threw away 3 years ago with minimal cost and with minimal time and effort.

We will also cover the method to run Windows Terminal Server Sessions from our Linux based diskless thinclients, this naturally extends our prerequisites below with a Windows Terminal Server or a Windows XP machine speaking the RDP protocol.

In the advanced section we will also cover an excellent solution for remote workers with, say suboptimal bandwidth possibilites like for example ADSL or ISDN users to access our Terminal Server services (read their personal desktop and applications) from anywhere in the world in highly secure manner. And the best of all, like commercial solutions it works from any java enabled web browser

What you will need..

It is important to note that the platform of the Terminal Server can be independently chosen to match you what you have or like. The same is theoretically valid for clients too, however since LTSP currently only supports the i386 architecture you have to stick with that platform for your thinclients. However all thinclients I have seen so far are from the i386 family that doesn't matter for the moment.

You just have to keep in mind that whatever programs your thinclients will be working with, will be running on the platform of the server, so if for example the latest version of Scribus won't build on your outdated IMac you're probably out of look.

For a very basic setup (one server, one diskless thinclient ) you will need the following items:

I have used a Mac Mini with 512MB RAM and GBas Terminal Server to write this HowTo, a nice Sparc Server would surely do a fine job too.

Installation and Configuration

We assume your Debian System is installed as graphical desktop system and boots successfully at this point. This means your debian system has the X-Window System installed with all needed components. If in doubt just select "Desktop Workstation" when the installer asks you how you would like to use your machine.

Please note: While your Terminal Server doesn't need to have a graphical session running at all it may do so and then users could also logon locally.

Please note: All commands entered have to be entered as root if not noted else.

Install LTSP and needed debian packages

We will need certain components for our setup, most of them can be run from different computers without problems. This might be an important issue if you need to scale up your existing environment at one point in the future.

The following components of the whole setup can easily be splitted onto different machines:

 

Install LTSP

To install the LTSP .deb package you could theoretically just enter (but don't do it!):

apt-get install ltsp-utils

but this would leave you with a rather old package of ltsp-utils, 0.10 is installed in stable as of this writing, while 0.25 is out on http://ltsp.mirrors.tds.net/pub/ltsp/utils/ as debian package, so it is recommended to fetch a current package from there and install it with i.e.

wget http://ltsp.mirrors.tds.net/pub/ltsp/utils/ltsp-utils_0.25_all.deb
dpkg -i ltsp-utils_0.25_all.deb

 

Install needed daemons (dhcp, tftp, nfs)

apt-get install atftpd dhcpd kdm nfs-kernel-server

or if you want xdm or gdm as window manager then replace kdm with xdm or gdm resp.. Answer all questions from apt-get to the default.

Please note: Don't use in.tftpd (the standard Debian tftpd) because its feature set is very limited and it won't work with LTSP.

 

Install LTSP packages

Now you can start downloading the LTSP packages by entering:

ltspadmin

Configuration

Configuration in LTSP

While still in ltspadmin..

  1. Select Runlevel 5
    Please note: If you dont want your server to start in graphical mode to save resources add the following comment the display line starting with
    :0 local@tty

    in /etc/kde3/kdm/Xservers

  2. If your system has only one Ethernet Interface then leave this unchanged
  3. Use this option to enable the DHCP daemon and build a sample configuration file for you to tailor for your environment (pls see also below)
  4. Check configuration of your TFTP daemon
  5. Check configuration of your portmapper (needed for NFS)
  6. Enable your NFS server/check configuration of
  7. Only use this if you want gdm to be your display manager, if you want to use kdm you need to edit /etc/kde3/kdm/kdmrc (see below)
  8. If you're not running a reverse DNS service and have added your clients to the database with a mapping you need to make sure the servers hosts file contains correct ip-name mappings for your clients. See here for a note about configuring bind8/9 for this job.
  9. Use this to add your local network (normally a /24) to the /etc/hosts.allow file which permits access to the services tftpd and portmap which we need.
  10. Use this to export the filesystem needed for the clients to boot from, it will add the following line to /etc/exports
    /opt/ltsp			10.1.1.0/255.255.255.0(ro,no_root_squash,sync)
    /var/opt/ltsp/swapfiles		10.1.1.0/255.255.255.0(rw,no_root_squash,async)
  11. Finally create the lts.conf for your clients, you might want to revisit this file later to change it to meet your needs, the reference to lts.conf can be found in the LTSP-wiki ( http://wiki.ltsp.org/twiki/bin/view/Ltsp/LtsConf )

Enabling xdmcp

Edit /etc/kde3/kdm/kdmrc to enable xdmcp:

[Xdmcp]
# Whether KDM should listen to incoming XDMCP requests.
# Default is true
Enable=true

Now you better reboot your machine to make sure all settings are activated. Else you can activate or restart daemons by hand by entering:

/etc/init.d/nfs-kernel-server restart
/etc/init.d/portmap restart
/etc/init.d/inetd restart

Check NFS daemon

Now make sure, your NFS daemon is running by running by entering:

showmount -e

Which should result in some output similar to the following:

minimac:~# showmount -e
Export list for minimac:
/opt/ltsp               10.1.1.0/255.255.255.0
/var/opt/ltsp/swapfiles 10.1.1.0/255.255.255.0
minimac:~#

If you don't get output similar to the one above you might want to check your /etc/exports and if the nfs-server is running. Else you can followup on the LTSP-Wiki and find there further troubleshooting information regarding NFS or generic troubleshooting information.

Check display manager (kdm in our case)

Add access allowance for other hosts by editing the file /etc/kde3/kdm/Xaccess and uncommenting the line

*				       #any host can get a login window

The restart kdm with:

/etc/init.d/kdm restart

Check if kdm is listening on a udp socket now:

netstat -anp | grep 177

you should see a line like:

udp	0      0 0.0.0.0:177	     0.0.0.0:*			  6716/kdm

if you don't get a similar line like that you might want to check the LTSP-Wiki for further information on configuring XDMCP.

Edit /opt/ltsp/i386/etc/lts.conf

Add the following lines to the default section:

RUNLEVEL		= 5  

and for a swiss-german keyboard

XkbModel		= pc102 
XkbSymbols		= ch(pc102)   
XkbLayout		= ch

Configure DHCPD

If you let ltspadmin create a sample file in /etc/dhcpd.conf.sample you should save your original configuration, edit the sample file to adjust your network parameters as outlined below, move it to /etc/dhcpd.conf afterwards and restart the DHCPD with:

/etc/init.d/dhcp restart  

The lines that you possibly should adjust in your /etc/dhcpd.conf are marked in red below:

# dhcpd.conf
ddns-update-style             ad-hoc;
option subnet-mask            255.255.255.0;
option broadcast-address      10.1.1.255;
option routers                10.1.1.1;
option domain-name-servers    10.1.1.2;
option domain-name            "intra.telemedia.ch"; 
get-lease-hostnames           true;
next-server                   10.1.1.4;
option root-path              "10.1.1.4:/opt/ltsp/i386";
subnet 192.168.0.0 netmask 255.255.255.0 {
	range   10.1.1.100	10.1.1.199;
	if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
		filename "/tftpboot/lts/2.4.26-ltsp-3/pxelinux.0";
	}
	else{
		filename "/tftpboot/lts/vmlinuz-2.4.26-ltsp-3";
	}
    }
#
# If you need to pass parameters on the kernel command line, you can
# do it with option-129.  In order for Etherboot to look at option-129,
# you MUST have option-128 set to a specific value.  The value is a
# special Etherboot signature of 'e4:45:74:68:00:00'.
#
# Add these two lines to the host entry that needs kernel parameters
#
#        option option-128     e4:45:74:68:00:00;       # NOT a mac address
#        option option-129     "NIC=ne IO=0x300";
#

This leaves you with a setup that offers every pxe client a boot image, thus every PC in your network with PXE enabled network card will try to boot this way. If you have an already existing network you might use the following /etc/dhcpd.conf :

# dhcpd.conf
ddns-update-style             ad-hoc;
option subnet-mask            255.255.255.0;
option broadcast-address      10.1.1.255;
option routers                10.1.1.1;
option domain-name-servers    10.1.1.2;
option domain-name            "intra.telemedia.ch"; 
get-lease-hostnames           true;
next-server                   10.1.1.4;
option root-path              "10.1.1.4:/opt/ltsp/i386";
subnet 192.168.0.0 netmask 255.255.255.0 {
	range   10.1.1.100	10.1.1.199;
	 host  thinclient1 {
		hardware ethernet 00:01:02:40:50:60;
		fixed-address 10.1.1.101;
		filename "/tftpboot/lts/2.4.26-ltsp-3/pxelinux.0"; 
		}

    }

This way only the hosts you define in your dhcpd.conf will be offered a file to boot from, all others will boot as usual and expected.

 

Testing your setup

Now, you are ready to fire off your first diskless thinclient and try if it boots over PXE.

If you did everything as described in this HowTo this should have left you with a working Linux Terminal Server environment.

 

Troubleshooting

See the LTSP-Wiki for more troubleshooting information.

Integrating FreeNX with your LTSP

We have also a HowTo on a how to setup FreeNX on your Linux Terminalserver, so that low-bandwidth remote users can work "as-if-local" with the applications and date on your Linux Terminalserver from anything with at least 64Kbit/s in both directions (i.e. ISDN). NX works also perfectly to speed up WAN access to VNC Hostcomputers and Windows Terminal Servers.
Please note: This adds the server capabilites of NX to your Linux Terminalserver, if you want your diskless clients to connect to a remote NX server, you might want to have a look at the section below:

Adding NX client as screen script to LTSP

Symbiont Workstation Manager has made a set of files available which allow you to directly connect your diskless Workstations to a remote server running NX or FreeNX.

First of all, download the latest NX_LTSP package from Sourceforge to a temporary folder: http://sourceforge.net/project/showfiles.php?group_id=110959&package_id=134524

Now unpack the file into your temporary folder with:

tar -xzvf NX1.5.0-141_LTSP_0.8.tgz

Change into the working dir and copy the files over your existing LTSP installation:

cd NX1.5.0-141_LTSP; cp -a i386/ /opt/ltsp/

Once you've finished copying the files, you must copy the NX Server's client.id_dsa.key file to the LTSP tree. If you are using the FreeNX server on the LTSP server, you can do this simply by executing:

cp /home/.nx/.ssh/client.id_dsa.key /opt/ltsp/i386/usr/NX/share/client.id_dsa.key.session
chmod 644 /opt/ltsp/i386/usr/NX/share/client.id_dsa.key.session

Now can add a screen script like the following to your /opt/ltsp/i386/etc/lts.conf:

SCREEN_02 = startnx

If you want to connect to different NX servers see the README file in the folder you just unpacked NX_LTSP to.

ToDo

Related Information

About the Author

Christoph Schneeberger is a Unix System Engineer with over 15 years of experience. He may be contacted at cschnee_at_telemedia_ch.

 


Visit our sponsors:
Werbung mit WebFusionClick