Manual tecnico Edubuntu en la escuela

Aquí intento escribir sobre mi experiencia desde la instalación de hardware hasta la configuración de LTSP (Linux Terminal Server Project).

Preparación (requisito del servidor y clientes)

Servidor

Ante he probado instalar Edubuntu+LTSP en un servidor mas o menos fuerte. Tuvo 2 GB RAM, 2 CPU con 2.4 GHz y 2 tarjetas de red de 10 MBit.
Yo lo he hecho y funciono pero siempre he tenido problemas. El Red fue demasiado lento, el procesador no tuvo suficiente capacidades, la tarjetas de red baratos hicieron muchos problemas.
Ahora tengo un servidor de una donación de Alemania. Funciona muy bien con 14 clientes.

Thin Clients

Yo tengo las computadoras de una donación. Todas son diferentes, por eso hay que configurar algo mas, cuando la instalación (lts.conf). Lo mas importante es la tarjeta de red.

Red

Estoy usando un switch con 10 MBit puertos y 2 GBit puertos. El servidor esta conectando con el puerto de GBit y los clientes con los de 10/100 Mbits. Para aprovechar el GBit port del switch hay que desactivar FlowControl (explicación mas abajo).

Instalación Edubuntu Ltsp-Server 10.04 lucid

Yo he instalado el dvd de Edubuntu 10.04 (lucid) pero también se puede usar para edubuntu 9.10 (karmic). Después de la instalación hay que configurar la red:
En mi caso eth0 es para la clase y eth1 para el internet.
Nota el imagen:
ltsp_clase_edubuntu.jpg

sudo gedit /etc/network/interfaces

No olvidar que de-activar el "network-manager-gnome" o eliminar las conexiones.
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.254
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255

auto eth1
iface eth1 inet dhcp
sudo /etc/init.d/networking restart

Después instalamos el servidor de ltsp:
sudo apt-get install ltsp-server-standalone

Eth1 (conexión de internet) tiene un IP de DHCP en mi caso 192.168.0.30. Por eso he tenido que cambiar el IP de mi clase. Yo quiero un red así: 192.168.1.0. Por eso hay que editar la configuración del servidor de DHCP:
cambia todos los "192.168.01" a "192.168.1."
sudo nano /etc/ltsp/dhcpd.conf

Para construir el "client image":

sudo ltsp-build-client

En mi caso había problemas con la conexión y cambie el comando asi:
sudo ltsp-build-client --mirror http://do.archive.ubuntu.com/ubuntu  lucid main --security-mirror http://security.ubuntu.com/ubuntu  lucid-security main

Si todavía tienes problemas, atiende este Link:https://answers.launchpad.net/ubuntu/+question/27500

Flowcontrol

Si tienes un switch con 16 o 24 puertos de Mbit y 1-2 Gbit ports, normalmente solo tienes 10Mbit para todo la red. Este articulo me ayudo muchisimo. Ahora cada cliente tiene su 10 Mbit. Pruebelo es muy facil:

https://help.ubuntu.com/community/UbuntuLTSP/FlowControl#Disabling%20flow%20control%20with%20ethtool

Disabling flow control with ethtool

For drivers that support ethtool, the following command can be used to disable flow control on the server NIC:

sudo ethtool -A eth0 autoneg off rx off

To see if flow control is currently disabled, you may execute:

ethtool -a eth0

One place to insert this command could be in a new /etc/network/if-up.d/flow-control script. Remember to do chmod +x flow-control. (Note that in the following script you must delete the space between "#" and "!" on the first line. Please edit this section if you know how to make these two characters display side by side.)

if you've forgotten doing the given hint (delete the space between "#" and "!) you'll get:

run-parts: failed to exec /etc/network/if-up.d/flow-control: Exec format error
run-parts: /etc/network/if-up.d/flow-control exited with return code 1

/etc/network/if-up.d/flow-control
#!/bin/sh
# Disable flow control. For more info, see
# https://help.ubuntu.com/community/UbuntuLTSP/FlowControl

set -e

# Don't do anything for the lo interface.
if [ "$IFACE" = lo ]; then
        exit 0
fi

# Only run from ifup.
if [ "$MODE" != start ]; then
        exit 0
fi

# Only care about inet and inet6.
if [ "$ADDRFAM" != inet ] && [ "$ADDRFAM" != inet6 ]; then
        exit 0
fi

# Is /usr mounted?
if [ ! -e /usr/sbin/ethtool ]; then
        exit 0
fi

/usr/sbin/ethtool -A eth0 autoneg off rx off >/dev/null 2>&1 || true

exit 0

Edubuntu ltsp en espanol (spanish) (language is english)

Si tienes childsplay:

sudo apt-get install childsplay-alphabet-sounds-es

Eliminar / remove compiz en el LTSP servidor

He tenido demasiados problemas con cpmpiz/fusion. Tal vez puede funcionar con un sistema nueva pero con computadores lentos no es diversión.
sudo apt-get remove —purge compiz
sudo apt-get remove —purge compiz-gnome

Crear lts.conf (customize ltsp clients)

Si no hay ya, hay que crear lo:

sudo nano /var/lib/tftpboot/ltsp/i386/lts.conf

El lts.conf (edubuntu 10.04 + ltsp5.2) mio, se pude encontrar aqui: lts.conf
My lts.conf (edubuntu 10.04 + ltsp5.2) is here: lts.conf

repair shutdown and reboot on ltsp thin clients (lucid 10.04)

install pathc (.deb) from
https://launchpad.net/~ts.sch.gr/+archive/ppa/+sourcepub/1134508/+listing-archive-extra

Customize Tuxmath

regard help in /usr/share/doc/tuxmath/

sudo nano /usr/share/tuxmath/missions/options

Games en espanol (Tuxgames, Tuxmath, TuxPaint, TuxType, childsplay)

The only way I found replacing the locales:
https://bugs.launchpad.net/ubuntu/+source/tuxpaint/+bug/572994/comments/4

sudo apt-get install translate-toolkit
sudo apt-get install poedit

get .po files of the games
eg: tuxpaint: http://www.tuxpaint.org/download/source/
compile .po to .mo with poedit

pocompile Desktop/es.po Desktop/tuxpaint.mo

copy to LC_MESSAGES_DIR:
sudo cp Desktop/tuxpaint.mo /usr/share/locale-langpack/es/LC_MESSAGES/

set rights:
sudo chmod 755 /usr/share/locale-langpack/es/LC_MESSAGES/tuxpaint.mo

The same should work with the other programs.
childsplay read by default the $LANG variable if your default is outside of espania it wont work. In my case (dominican republic) i have es_DO.utf8. when i set the variable to es_ES.utf8 it works.

export LANG=es_ES.utf8

you can also set it by language parameter:
childsplay --fullscreen --no-exit-question --bigcursor --language=spanish --no-login

Get sound working

https://lists.ubuntu.com/archives/edubuntu-devel/2007-September/002394.html

Tips & Tricks Edubuntu 10.04 or lesser

Actualizar Thin-Client-Systems

Thin-clients sin soporte para iniciar via la red

Estoy usando "images" de http://rom-o-matic.net/ para disquete o CD-ROM.

"Menueditor"

Menueditor_Edubuntu_10_04.png

Proteger gnome (el escritorio)

Los nionios les gustan crear carpetas, eliminar menus o "paneles". Por eso para mi es muy importante tener un gnome que no se puede destruir:

sudo gconf-editor

llaves importantes estan en "/desktop/gnome/lockdown"
alternative way:

sudo apt-get install pessulus

no olvida markar: "Establecer como obligatorio" y "predeterminado" !!!!
mas informaciones:
https://help.ubuntu.com/community/UbuntuLTSP/GnomeOptimize

tener un escritorio cerrado o siempre reset?!!

shutdown ltsp clients remotly (from server) via ssh

if not already installed:
install ssh in chroot:

sudo mount --bind /dev /opt/ltsp/i386/dev
sudo mount -t proc none /opt/ltsp/i386/proc
sudo chroot /opt/ltsp/i386/ apt-get install ssh

on server:
sudo apt-get install expect

file: shutdown.exp

#!/usr/bin/expect -f
# script to shutdown ltsp clients need to install "expect" - sudo apt-get install expect
set pw [lrange $argv 0 0]
set ip [lrange $argv 1 1]

# connect to host
spawn ssh root@$ip -o StrictHostKeyChecking=no -q "init 0" 
match_max 100000

expect "*?assword:*"
send -- "$pw\r"
send -- "\r"
expect eof

check the script by running (change your pw and client ip)
to get the ip, you can use the following command to get all ip-adresses of the running ltsp-clients:
ps eaxww|grep "bash -c"|grep "LTSP_CLIENT" | w | cut -d " " -f6 | grep "[0-9][0-9]"  > "ips.txt"

test ltsp-shutdown
./shutdown.exp ThinClientRootPassword 192.168.1.22

Now lets get all client ips and shut them down. Change the script with the root password of your thin client chroot. Dont have one: https://help.ubuntu.com/community/UbuntuLTSP/UnlockChrootRootAcct

file shut.sh

#!/bin/bash
ps eaxww|grep "bash -c"|grep "LTSP_CLIENT" | w | cut -d " " -f6 | grep "[0-9][0-9]"  > "ips.txt"
while read line
do
    ./shutdown.exp ThinClientRootPassword $line
done < "ips.txt"

# EOF

finaly you only need to call
sh shut.sh

to shutdown all ltsp thin clients.
I know its a little hacky but i didnt find another way… Bugs and comments are welcome: moc.liamg|relgeiznnoif#moc.liamg|relgeiznnoif

Command to get connected mac adresses:

sudo arp -an | cut -d " " -f 4

example output:
00:1f:29:d1:0f:33
<incompleto>
00:0b:cd:43:03:cb
00:25:b3:e6:74:7e
<incompleto>
00:1e:90:f8:7d:4b

restoring/recover deleted files ( rm command ) with extundelete

install folowing packages

sudo apt-get install e2fsprogs
sudo apt-get install g++

download http://extundelete.sourceforge.net/
and do

cd extundelete-0.1.8/src
make
sudo ./extundelete /dev/sdb1 --restore-directory /home/profesor/WinShare
 ls RECOVERED_FILES/

LTSP-Error lucid-10.04: getpwuid_r(): failed due to unknown user id (0) no X

In client Xorg.log you can se something like that: "(EE) VESA: kernel modesetting driver in use, refusing to load…."
add option "nomodeset" to:

 sudo nano /var/lib/tftpboot/ltsp/i386/pxelinux.cfg/default

open /dev/sequencer: No such file or directory

when running gcompris, tuxpaint or other games i got:
open /dev/sequencer or /dev/snd/seq: No existe el fichero ó directorio
to solve:

sudo modprobe snd-seq

Use cases

Añadir o cambiar una computadora (o tarjeta de red)

La configuración del thin client depende de la direción MAC. MAC es la direcion de la tarjeta de red (ejemplo: 00-23-AE-30-DC-0C). El DHCP-servidor esta responsable por la asignación. Si se cambia la dirección no se puede hacer un autologin.
Hay que cambiar este archivo:

sudo nano /etc/ltsp/dhcpd.conf

si ha cambiado la computadora 001 este parte es importante:
host ltsp01{
                hardware ethernet **00:06:5b:16:b9:04;**
                fixed-address 192.168.1.21;
        }

AutoLogin no funciona, que puedo hacer?

Chequear lts.conf
La asignación funciono a través de la IP.

sudo nano /var/lib/tftpboot/ltsp/i386/lts.conf

Update chroot

http://www.mail-archive.com/ltsp-discuss@lists.sourceforge.net/msg35950.html
sometime it's useful to copy the /etc/resolv.con and /etc/apt/sources.list into the ltsp chroot
eg:

 sudo cp /etc/apt/sources.list /opt/ltsp/i386/etc/apt/sources.list
 sudo cp /etc/resolv.conf /opt/ltsp/i386/etc/resolv.conf
>   sudo chroot /opt/ltsp/i386
>   # alternately:
>   # su -c 'chroot /opt/ltsp/i386'
> 
>   # from here on out, you're in the chroot as root
>   mount -t proc /proc /proc
> 
>   # make sure daemons don't start
>   export LTSP_HANDLE_DAEMONS=false
>   
>   # update package lists
>   apt-get update
> 
>   # install available package updates
>   apt-get upgrade
>   # alternately: 
>   # apt-get dist-upgrade
> 
>   # update the ltsp network boot configuration files if needed
>   /usr/share/ltsp/update-kernels
> 
>   # unmount proc, as it really shouldn't be there.
>   umount /proc
> 
>   # exit the chroot
>   exit
> 
>   # update the server's /var/lib/tftpboot/ltsp/
>   ltsp-update-kernels
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License