HowTo LTSP 4.2 en DEBIAN ETCH

De Grupo de Usuarios de GNU Linux de Quilmes

Contenido

Introduccion

¿Que es un Terminal Server?

Un servidor de terminales es un servidor que nos permite crear estaciones de trabajo a traves de clientes delgados. Estos clientes son generalmente equipos viejos, reciclados, que no tienen la capacidad suficiente para usarse de escritorio y que gracias a este servicio pueden ser reciclados para volverse a usar.

¿Como funciona?

Un equipo delgado bootea mediante Etherboot y busca un dhcp. Una ves obtenida una direccion IP, el servidor procede a enviarnos mediante el servicio TFTP, un kernel y los archivos necesarios para bootear. Una ves recibido, el cliente ya tiene todo lo necesario para poder levantar una estacion de trabajo.

Mientras trabajemos en nuestro cliente, nosotros en nuestra pc, no gestionamos nada mas que video, ya que las tareas que realizamos, las estamos corriendo en realidad en nuestro servidor, que es quien se encarga de procesar todo.

¿Que es un cliente delgado?

Un cliente delgado es una PC que vamos a utilizar de cliente para iniciar nuestra estacion de trabajo gracias al servidor de Terminal Server.

¿Cuales son los requisitos minimos de un cliente delgado?

  • Microprocesador 486 / Pentium 1.
  • Una placa de red PCI Ethernet.
  • 32MB de Ram como minimo. Si bien se puede con menos, lo ideal seria mas de 32MB.
  • Entrada de teclado.
  • Salida de video.
  • Una diskettera.
  • Sin disco rigido ni lectora de cds.

Instrucciones para armar clientes delgados.

¿Que necesito para montar el servidor?

  • Antes que nada, tener un conocimiento basico de linux.
  • Tener algun conocimiento basico de ingles.
  • Una distribucion de Linux. En este caso usamos Linux Debian Etch 4.05r
  • Una PC dedicada. Con conexion a internet. (Para la instalacion de los paquetes en caso de no tenerlos).
  • Dos placas de red Ethernet PCI.
  • El paquete LTSP. (www.ltsp.org)

Instalación.

En este HowTo vamos a usar Debian Etch en su version 4.05r y vamos a usar LTSP (Linux Terminal Server Project).

Preparativos.

Una ves instalado nuestro sistema linux, procederemos a configurar nuestros repositorios de debian. Para ello vamos a editar el archivo /etc/apt/source.list y luego vamos a agregar los repositorios argentinos de la UBA.

# vim /etc/apt/source.list

Agregamos los repositorios: (Pueden ser otros, pero en este HowTo usamos los repositorios de la UBA):

deb http://ftp.ccc.uba.ar/pub/linux/debian/debian/ etch main
deb-src http://ftp.ccc.uba.ar/pub/linux/debian/debian/ etch main

deb http://security.debian.org/ etch/updates main contrib
deb-src http://security.debian.org/ etch/updates main contrib

Guardamos y cerramos con:

:wq

Ahora para actualizar apt-get con los nuevos repositorios usamos el comando:

# apt-get update

Instalando.

Ya estamos listos. Tenemos los repositorios desde donde vamos a bajar los paquetes.

Nuestro objetivo es instalar y configurar un servidor de terminales. Para esto vamos a empezar instalando los paquetes que vamos a necesitar.

# apt-get install ltsp-utils tftpd dhcp3-server nfs-user-server

Una ves instalados, pasamos a configurar nuestro servidor.

Configuración.

Con todo el software necesario lo unico que nos queda es configurar y probar.

Configuramos nuestras placas de red.

El LTSP nos va a pedir una interface por la cual vamos a gestionar las conexiones de los clientes. Hay varias alternativas para configurar nuestra red, pero solo vamos a ver ejemplos basicos.

Teniendo dos placa de red, asignamos a una direccion estatica a una de las placas, y a la otra, que va a ser nuestra salida a internet u a otra red si es que la hay, la configuramos como nos convenga. Esto lo hacemos desde el archivo /etc/network/interfaces.

# vim /etc/network/interfaces

Veamos un ejemplo sencillo.

auto lo eth0 eth1

iface lo inet loopback

iface eth0 inet dhcp

iface eth1 inet static
       address 12.10.0.1
       netmask 255.255.255.0
       gateway 12.10.0.1

Esta (eth1) es la interface que luego vamos a setear en la configuracion del LTSP. Podemos tener mas interfaces, pero solo necesitamos tener configurada una para nuestro LTSP.

LTSP.

Vamos a configurar el paquete LTSP con el siguiente comando:

# ltspadmin
ltspadmin - v0.17                                            LTSP dir: /opt/ltsp

LTSP Administration Utility

 Install/Update LTSP Packages
 Configure the installer options
 Configure LTSP

 Quit the administration program

Press <Enter> to Select   N-Next   P-Prev   Q-Quit

Esta utilidad nos permite gestionar la instalacion y configuracion de LTSP.

  • La primera opcion instala los paquetes requeridos por LTSP.
  • La segunda opcion, nos permite setear ciertos parametros de la instalacion.
  • La tercera, es la que vamos a usar para configurar el paquete de LTSP.

Si vamos a la segunda opcion "Configure the installer options", vamos a ver que parametros podemos configurar:

LTSP Installer configuration

Where to retrieve packages from?
[ http://ltsp.mirrors.tds.net/pub/ltsp/ltsp-4.2/ ]

In which directory would you like to place the LTSP client tree?
[/opt/ltsp]

If you want to use an HTTP proxy, enter it here
Use 'none' if you don't want a proxy
Example:  http://proxy.yourdomain.com:3128

[none]

If you want to use an FTP proxy, enter it here
(Use 'none' if you don't want a proxy)

[none]

Correct? (y/n/c)

Contestamos "y" en caso de haber realizado algun cambio, en caso contrario "n" para volver a modificar o "c" para cancelar y volver al menu principal.

Una ves mas desde el menu principal elegimos la opcion "Install/Update LTSP Packages" para bajar los paquetes que requiere LTSP.

ltspadmin - v0.17                                            LTSP dir: /opt/ltsp

    Component                Size (kb)   Status
[ ] ltsp_core                    80916   Not installed
[ ] ltsp_debug_tools              4284   Not installed
[ ] ltsp_kernel                  41744   Not installed
[ ] ltsp_libusb                    896   Not installed
[ ] ltsp_localdev                    4   Not installed
[ ] ltsp_pciutils                  428   Not installed
[ ] ltsp_perl                    28072   Not installed
[ ] ltsp_rdesktop                 1872   Not installed
[ ] ltsp_scanners                29308   Not installed
[ ] ltsp_vnc_module                452   Not installed
[ ] ltsp_x_addtl_fonts           17368   Not installed
[ ] ltsp_x_core                  97716   Not installed

Use 'A' to select ALL components, 'I' to select individual components. When you
leave this screen by pressing 'Q', the components will be installed.   'H'-Help

Selecionamos todo y apretamos la Q para salir e instalar los paquetes previamente seleccionados.

ltspadmin - v0.17                                            LTSP dir: /opt/ltsp

Ready to install/update the selected LTSP packages? (y/n) y

Le decimos que si (Y) y esperamos a que terminen de bajar todos los paquetes.

Vamos a "Configure LTSP"

ltspcfg - Version 0.16

Checking Runlevel....: 2
Checking Ethernet Interfaces
Checking Dhcpd.....
Checking Tftpd.......
Checking Portmapper...
Checking nfs...
Checking xdmcp............Found: gdm   Using: gdm
Checking /etc/hosts.
Checking /etc/hosts.allow.
Checking /etc/exports.
Checking lts.conf.

Press <enter> to continue..

Esto que vemos: Chequea los servicios y configuraciones para ver en que estado se encuentran para luego informarnos el estado actual. Si modifican algo mientras estan ejecutando esta aplicacion, tienen que salir y volver a entrar a "Configure LTSP" para actualizar.

Apretamos Enter...

ltspcfg v0.16               The Linux Terminal Server Project (http://www.LTSP.org)
 
S - Show the status of all services
C - Configure the services manually

Q - Quit

Make a selection:

En esta pantalla tenemos dos opciones, la primera (S) nos muestra un resumen de los servicios y configuraciones. La segunda (C) es la que nos va a permitir configurar el paquete LTSP. Asi que lo siguiente es ir a la segunda opcion.

ltspcfg v0.16               The Linux Terminal Server Project (http://www.LTSP.org)

1  - Runlevel
2  - Interface selection
3  - DHCP configuration
4  - TFTP configuration
5  - Portmapper configuration
6  - NFS configuration
7  - XDMCP configuration
8  - Create /etc/hosts entries
9  - Create /etc/hosts.allow entries
10 - Create /etc/exports entries
11 - Create lts.conf file

R - Return to previous menu
Q - Quit

Make a selection:

Vamos a ir configurando punto por punto, asi que empezamos por el primero.

1 - Runlevel

ltspcfg v0.16       The Linux Terminal Server Project (http://www.LTSP.org)

A runlevel is a software configuration variable that init uses to determine
which programs/services to run.  Various distributions have different ideas
of what each runlevel is for.  Systems derived from Redhat typically use
runlevel 3 for character mode console, and runlevel 5 for X-Windows based
console.  Debian typically uses runlevel 2 all the time.  Slackware uses
runlevel 4 for X-Windows mode.

You need to decide what runlevel you want to run the server in.  This can
cause a bit of a problem if you change it while you are logged in on the
console.  If you change from a non-gui runlevel to a gui runlevel, it may
start X Windows running on your current screen.

Select a runlevel (2,3,4,5) [2]:

Seteamos nuestro runlevel a 5, ya que lo que necesitamos es que levante una estacion de trabajo sobre X. Esto es el init de linux, cada nivel del init es una forma en la que el sistema inicia.

2 - Interface selection

ltspcfg v0.16                           The Linux Terminal Server Project (http://www.LTSP.org)

Interface IP Address      Netmask         Network         Broadcast        Used
eth0      x.x.x.x         x.x.x.x         x.x.x.x         x.x.x.x
eth1      12.10.0.1       255.255.255.0   12.10.0.0       12.10.0.255     <-----
 
Found 2 Ethernet interfaces.

You need to indicate which interface the workstations are connected to.

Select one of (eth0,eth1) or 'Q' to quit [eth1]:

Seleccionamos la interfaz que vamos a usar para nuestro LTSP: eth1

3 - DHCP configuration

ltspcfg v0.16                                          The Linux Terminal Server Project (http://www.LTSP.org)

dhcpd is the daemon that implements the Dynamic Host Configuration Protocol.
This is needed for LTSP workstations to obtain an IP address and other vital
information from the server.

There are 2 main steps to configuring dhcpd:

 1)  Build the configuration file

 2)  Enable the daemon to run when the system is booted

Currently, this utility is not a full dhcp configuration tool.  It will
only create a sample dhcpd.conf file that can be hand tuned for your
specific needs.

dhcpd is already enabled!

Do you want to build a dhcpd.conf file (y/n) ?

Le damos a "Y" para que nos arme un dhcpd.conf de muestra. Aunque mas adelante vamos a ver una configuracion basica.

4 - TFTP configuration

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

tftpd is the daemon that implements the 'Trivial File Transfer Protocol'.
This is needed for LTSP workstations to download the kernel from
the server.

tftpd is already enabled and running!
Press <enter> to continue..

Si vemos "already enabled and running!" significa que el servicio esta instalado y esta ejecutandose, de lo contrario revisamos el servicio. Apretamos Enter.

5 - Portmapper configuration

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

portmap is the daemon that converts RPC Program numbers to DARPA protocol
port numbers.  This is needed for NFS and NIS to function properly.  The
clients will query the portmapper daemon to figure out which ports to connect
to for the various services.

portmap is already enabled and running!
Press <enter> to continue..

Si vemos "already enabled and running!" significa que el servicio esta instalado y esta ejecutandose, de lo contrario revisamos el servicio. Apretamos Enter.

6 - NFS configuration

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

nfsd is the daemon that implements the user level part of the NFS service.

The main functionality of NFS is typically handled by a kernel module
called nfsd.o.

nfsd is already enabled and running!
Press <enter> to continue..

Si vemos "already enabled and running!" significa que el servicio esta instalado y esta ejecutandose, de lo contrario revisamos el servicio. Apretamos Enter.

7 - XDMCP configuration

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

Xdmcp is the protocol used by a display manager to present
a login dialog box on the workstation.

Do you want to enable gdm (y/n) ? y

Le decimos que si. Con gdm vamos a hacer el login en los clientes.

Normally, when a display manager is running, it will launch an X server on
the console screen, giving you a graphical login on the console as well as
on the workstations.  Some people prefer to keep their server in character
mode.

Do you want to disable the graphical login on the server (y/n) []? y

Le decimos que si.

Configuring Gdm
Updating: /etc/gdm/gdm.conf
Press <enter> to continue..

8 - Create /etc/hosts entries

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

It is important that several services running on the server
are able to map an IP address back to a hostname.  This is
typically referred to as "reverse mapping".

There are 2 common ways to achieve this:

 1) Entries in /etc/hosts for each workstation.

 2) Reverse mapping entries in DNS.

If you have (or will) setup your DNS server to do the proper
reverse mapping for each workstation, you can skip this
configuration step.  Otherwise, it is recommended that you add
entries to the /etc/hosts file for each workstation.

Do you want to add entries to /etc/hosts (y/n) ?

Contestamos Y.

9 - Create /etc/hosts.allow entries

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

Some services, such as dhcpd, tftpd and portmap use a security feature
called 'tcpwrappers'.  This feature restricts connections from any
host addresses specified in /etc/hosts.deny, and allows connections
from host addresses specified in /etc/hosts.allow.

ltspcfg can add the necessary entries to /etc/hosts.allow for you.

Do you want to add entries to /etc/hosts.allow (y/n) ?

Contestamos Y.

10 - Create /etc/exports entries

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

To tell the NFS system which directories to make available, entries
must exist in /etc/exports, for each directory.  With each entry, is
information about which machines are allowed to access the directory,
and what permissions they will have.

ltspcfg can add the necessary entries to /etc/exports for you.

Do you want to add entries to /etc/exports? (y/n) ? y

Contestamos Y.

11 - Create lts.conf file

ltspcfg v0.16                                           The Linux Terminal Server Project (http://www.LTSP.org)

Do you want to create a default lts.conf file (y/n) ? Y

Contestamos Y para que nos cree el archivo de configuracion del LTSP.

Bueno ya terminamos de configurar nuestro servidor. Ahora pasamos a configurar nuestro servidor de DHCP.

DHCP.

# vim /etc/dhcp3/dhcpd.conf
ddns-update-style             none;
authoritative;                # Declara este DHCP como servidor maestro.

option subnet-mask            255.255.255.0;
option broadcast-address      12.10.0.255;
option routers                12.10.0.1;
option domain-name-servers    12.10.0.1;
option domain-name            "ltsp-test";
option option-128 code 128 = string;
option option-129 code 129 = text;

next-server                   12.10.0.1;
option root-path              "12.10.0.1:/opt/ltsp/i386";

subnet 12.10.0.0 netmask 255.255.255.0 {
   range   12.10.0.10   12.10.0.100;
   if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
       filename "/tftpboot/lts/2.6.20.9-ltsp-1/pxelinux.0";
   }
   else{
       filename "/tftpboot/lts/vmlinuz-2.6.20.9-ltsp-1";
   }
}

#
# 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";

TFTP.

Primero vamos a /etc/exports y comprobamos la siguiente linea:

/opt/ltsp                     12.10.0.0/255.255.255.0(ro,no_root_squash,sync)

Tambien modificamos el archivo /etc/inetd.conf. Buscamos la linea del tftp y chequeamos que este asi, sino la agregamos o la modificamos:

# tftp            dgram   udp     wait    nobody  /usr/sbin/tcpd  /usr/sbin/in.tftpd /tftpboot

Testeando el servidor.

Bueno, ya tenemos todo listo. Solo nos queda probar el servidor. Reiniciamos, conectamos un cliente delgado y esperamos a que inicie.

Sino inicia, tenemos que revisar las configuraciones.

Posibles Fallas.

Es posible que tengamos alguna falla de configuracion, si es el caso, revisamos cuidosamente nuestro sistema. Dependiendo de el error que nos muestre la salida del booteo del cliente o consultando en /var/log/syslog podemos tener una idea de por donde empezar a mirar.

Fallas de hardware (Placas de red).

Fallas de DHCP.

Fallas de TFTP.

tftp server not supporting the tsize option

Informacion extra.

Para mayor informacion puede consultar la pagina oficial del proyecto LTSP (www.ltsp.org).

Herramientas personales