Ubuntu10

04Ltsp42

Para o funcionamento do LTSP, é preciso alguns programas.
# apt-get install dhcp3-server tftpd-hpa portmap nfs-kernel-server

Pra usar o ltsp-utils instalar bibliotecas do perl
# apt-get install libwww-perl libhtml-parser-perl libhtml-tagset-perl libhtml-tree-perl liburi-perl

Vamos instalar o ltsp-utils, com ele instalamos e configuramos o LTSP 4.2.
http://ltsp.mirrors.tds.net/pub/ltsp/utils/ ou
https://www.idsorocaba.tk/ltsp/utils/
# wget http://ltsp.mirrors.tds.net/pub/ltsp/utils/ltsp-utils-0.25-0.tgz
# tar xvf ltsp-utils-0.25-0.tgz
# cd ltsp-utils
# sh install.sh 
Installing ltspadmin
Installing ltspcfg
Installing ltspinfo

Installation of ltsp-utils complete

No Ubuntu/Debian o pacote ltsp-utils não é mais oficial, por isso pegar o fonte para instalar.


Sobre Instalando a partir da .ISO
http://wiki.ltsp.org/twiki/bin/view/Ltsp/LTSP-42#Installing_from_the_LTSP_4_2u2_I
Obter a .iso
http://ltsp.mirrors.tds.net/pub/ltsp/isos/
ou
https://www.idsorocaba.tk/ltsp/isos/

Montar .Iso do LTSP4.2
#mount -o loop ltsp-4.2u2-0.iso /mnt

Abra o #ltspadmin

Na tela do ltspadmin vamos primeiro em Configure the installer options

Em Where to retrieve packages from? vamos trocar e colocar:
file:///mnt/

na opção abaixo In which directory would you like to place the LTSP client tree?
[/opt/ltsp]

Indicado manter o padrão e pra outras pode deixar em branco e dar enter.

Para instalar vamos em Install/Update LTSP Packages
Tecle A para selecionar todos arquivos para instalação

e Q para começar o Download
Instalou e tecle Enter para continuar


Com LTSP já instalado, falta somente configurar...
mas antes vamos editar/verificar se alguns arquivos estão como devem.

Abra o:
#nano /etc/default/tftpd-hpa
(pode usar seu editor preferido...vi, vim, pico, emacs e etc...)

E deixe o arquivo tftpd-hpa deste jeito...

# /etc/default/tftpd-hpa
TFTP_USERNAME="tftp"
TFTP_DIRECTORY="/tftpboot"
TFTP_ADDRESS="192.168.20.1:69"
TFTP_OPTIONS="--secure --listen -r blksize -vvvvvv"

TFTP_ADDRESS= informar o ip do servidor com imagens do ltsp
Salva e pronto.

O servidor deve ter duas placas de rede, vamos usar aqui no exemplo a eth1 com ip 192.168.20.1 para o LTSP
Para isso vamos abrir o:
#nano /etc/network/interfaces
E colocar a seguinte configuração na eth1 deste jeito.

auto eth1
iface eth1 inet static
        address   192.168.20.1
        netmask   255.255.255.0
        network   192.168.20.0
        broadcast 192.168.20.255

depois executar...
#/etc/init.d/networking restart

Para ver como esta a configuração atual do LTSP
#ltspcfg
tecle S e veja se tem tudo instalado

Maiores informações:
2.5. Exibindo a configuração atual
http://ltsp.mirrors.tds.net/pub/ltsp/docs/ltsp-4.1-ptbr.html#AEN641


Em #ltspcfg Tecle C (configure)
2.3. Configurando os serviços necessários ao LTSP
http://ltsp.mirrors.tds.net/pub/ltsp/docs/ltsp-4.1-ptbr.html#AEN443

Vamos Configurar

1 - Runlevel

Antes de entra na opcao, execute:
sudo echo "id:5:initdefault:" > /etc/inittab

Com isso se cria o arquivo inittab com valor id:5 - isso não vai afetar o Ubuntu que usa outro sistema.
Mas pra LTSP4.2 e preciso ter este arquivo pra gente continuar a instalação.

Não preciso se preocupar com este passo se fez o comando anterior de criar o inittab
mas se quiser tem que estar no Runlevel 5

2 - Interface selection

e escolha a interface/placa de rede que LTSP vai usar.
Vamos aqui usar a eth1 que antes já configuramos

3 - DHCP configuration

aqui criei o arquivo dhcpd.conf
Do you want to build a dhcpd.conf file (y/n) ? Y

em outro Terminal/Aba faça
#mv /etc/dhcp3/dhcpd.conf.sample /etc/dhcp3/dhcpd.conf

E agora edite o dhcpd.conf
#nano /etc/dhcp3/dhcpd.conf

e procure por:

option domain-name            "your_domain.org";   # You really should fix this

e coloque o domínio da sua rede.
Sugestão usar "ltsp"

option domain-name            "ltsp";   # You really should fix this

procure a linha - subnet 192.168.0.0 netmask 255.255.255.0

 subnet 192.168.0.0 netmask 255.255.255.0 {
 range 192.168.0.100 192.168.0.199;
 if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
 filename "/lts/2.6.16.1-ltsp-1/pxelinux.0";
 }
 else{
 filename "/lts/vmlinuz-2.6.16.1-ltsp-1";
 }
 }

Verifica se esta com o ip de sua rede configurada na eth1.

Em um Terminal/Aba execute: ls /tftpboot/lts e veja o retorno.

# ls /tftpboot/lts
 2.6.17.3-ltsp-1 vmlinuz-2.6.17.3-ltsp-1

No dhcpd.conf criado esta escrito a versão - 2.6.16.1-ltsp-1 - só que ltsp tem instalado a: 2.6.17.3-ltsp-1.
Mude para 2.6.17.3-ltsp-1.

  1. tail -f /var/log/syslog
Jan 17 20:55:10 Balaio1 in.tftpd[4606]: RRQ from 192.168.20.102 filename /tftpboot/lts/vmlinuz-2.6.17.3-ltsp-1                                                  
Jan 17 20:55:10 Balaio1 in.tftpd[4606]: sending NAK (1, File not found) to 192.168.20.102 

Remover no dhcpd.conf o /tftpboot/ se tiver

filename "/tftpboot/lts/2.....
deixando como:
filename "/lts/2......";

Agora faça as mudanças no option domain-name, subnet e no filename -, o dhcp.conf deve ficar assim.

# dhcpd.conf

 ddns-update-style ad-hoc;

 option subnet-mask 255.255.255.0;
 option broadcast-address 192.168.20.255;
 option routers 192.168.20.1;
 option domain-name-servers 192.168.20.1;
 option domain-name "ltsp"; # You really should fix this
 option option-128 code 128 = string;
 option option-129 code 129 = text;


 get-lease-hostnames true;

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

 subnet 192.168.20.0 netmask 255.255.255.0 {
 range 192.168.20.100 192.168.20.110;
 if substring (option vendor-class-identifier, 0, 9) = "PXEClient" {
 filename "/lts/2.6.17.3-ltsp-1/pxelinux.0";
 }
 else{
 filename "/lts/vmlinuz-2.6.17.3-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";
#

Feito tudo...execute.
#/etc/init.d/dhcp3-server restart

# /etc/init.d/dhcp3-server restart
Stopping DHCP server: dhcpd3 failed!
Starting DHCP server: dhcpd3.

dhcp3 ligou corretamente.

Voltar ao Terminal/Aba que tem o Menu de Configure

4 - TFTP configuration

coloque **Y** (yes ) para ligar/enabled o TFTP

Em outro Terminal/Aba antes edite:
#nano /etc/inetd.conf
e procure pela linha.

# /etc/inetd.conf                              

#:BOOT: Tftp service is provided primarily for booting.  Most sites
# run this only on machines acting as "boot servers."
#<off># tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd /usr/sb$
tftp           dgram   udp     wait    root  /usr/sbin/in.tftpd -s /tftpboot -r blksize -vvvvvv

e deixe como esta acima. ...in.tftpd -s /tftpboot -r blksize -vvvvvv

Bem continuando a instalação....

5 - Portmapper configuration

coloque Y (yes) para ligar/enabled.

6 - NFS configuration

coloque Y (yes) para ligar/enabled.

7 - XDMCP configuration

Crie o arquivo:

  1. nano /etc/gdm/custom.conf

Com o seguinte conteúdo.

# /etc/gdm/custom.conf

[daemon]
User=gdm
Group=gdm

[security]
DisallowTCP=true

[xdmcp]
Enable=true
DisplaysPerHost=2
HonorIndirect=false
MaxPending=4
MaxSessions=16
MaxWait=30
MaxWaitIndirect=30
PingIntervalSeconds=60
Port=177

[greeter]

[chooser]
Multicast=false

[debug]
Enable=false

8 - Create /etc/hosts entries
9 - Create /etc/hosts.allow entries
10 - Create /etc/exports entries
11 - Create lts.conf file
Nesta 4 seleções coloque Y (yes) para que o ltspcfg criar as entradas de configurações em cada arquivo e crie o arquivo lts.conf
Abaixo vamos editar algumas configurações que ltspcfg criou.

8 - Create /etc/hosts entries

Se o arquivo #cat /etc/hosts - tiver como retorno um parecido com abaixo

## LTSP-begin ##
#
# The lines between 'LTSP-begin' and 'LTSP-end' were added
# on: Qua Abr 18 23:55:07 2007, by the ltspcfg configuration tool.
# For more information, visit the LTSP homepage
# at http://www.LTSP.org
#

......
192.168.20.84           ws084.ltsp      ws084
192.168.20.85           ws085.ltsp      ws085
192.168.20.86           ws086.ltsp      ws086
192.168.20.87           ws087.ltsp      ws087
......

esta tudo ok

9 - Create /etc/hosts.allow entries

Edite o arquivo #nano /etc/hosts.allow

bootpd:     0.0.0.0
in.tftpd:   192.168.20.0
portmap:    192.168.20.0

mude para ip que tu tem configurado no seu servidor. No caso aqui: 192.168.20.1

bootpd:     0.0.0.0
in.tftpd:   192.168.20.1
portmap:    192.168.20.1

Salve e pronto.

10 - Create /etc/exports entries

Edite o arquivo #nano /etc/exports - mudando para o ip do servidor. 192.168.20.1 Deve ficar assim:

## LTSP-begin ##
#
# The lines between 'LTSP-begin' and 'LTSP-end' were added
# on: Qua Abr 18 23:57:57 2007, by the ltspcfg configuration tool.
# For more information, visit the LTSP homepage
# at http://www.LTSP.org
#

/opt/ltsp                 192.168.20.1/255.255.255.0(ro,no_subtree_check,no_root_squash,sync,no_subtree_check)
#/var/opt/ltsp/swapfiles   192.168.20.1/255.255.255.0(rw,no_root_squash,async,no_subtree_check)

## LTSP-end ##

Pronto....reinicie a maquina e faça os teste nos terminais.

Depois de reiniciar...vai em ltspcfg e veja o S Status (ou #ltspcfg -p) e veja como esta tudo sim em: Instalado, Ligado e Rodando. Installed Enabled Running

ltspcfg - Version 0.16

Checking Runlevel....: 5
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.

ltspcfg v0.16

Interface IP Address      Netmask         Network         Broadcast        Used 
eth0      192.168.0.130   255.255.255.0   192.168.0.0     192.168.0.255   
eth2      192.168.20.1    255.255.255.0   192.168.20.0    192.168.20.255  <-----

Service    Installed   Enabled   Running   Notes                                
dhcpd      Yes         Yes       Yes       Version 3
tftpd      Yes         Yes       Yes       Has '-s' flag
portmapper Yes         no        Yes       
nfs        Yes         Yes       Yes       
xdmcp      Yes         Yes       Yes       gdm   Using: gdm

File                                Configured  Notes                           
/etc/hosts                          Yes         
/etc/hosts.allow                    Yes         
/etc/exports                        Yes         
/opt/ltsp/i386/etc/lts.conf         Yes         

Configured runlevel: 5         (value of initdefault in /etc/inittab)
   Current runlevel: 5         (output of the 'runlevel' command)

Installation dir...: /opt/ltsp

Configuração baseada na: Instalação LTSP4.2 no Debian Etch
Algumas infomações sobre configuração no lts.conf

GDM+XDMP
Set up XDMCP connection on Ubuntu 10.04 LTS and add it to a Windows domain
xdmcp connection
xdmcp in 10.04

TFTPD-HPA
Diskless Servidor: TFPT-HPA
Instalar servidor de tftp em Ubuntu
Netboot Install
Set up a TFTP server for easy network boots and firmware upgrades
Configure TFTPD Server in Ubuntu