Wednesday, September 17, 2008

LTSP(Linux Terminal Server Project)

LTSP

To define LTSP I can only say, it's an efficient and most usable technology which one could have seen till now.
As the name denotes it is a Linux terminal or to be more precise i can say that it is a client terminal and a light weight too, it means that it neither uses much of your workstations memory nor the LAN's bandwidth.




Working

When a client boots from a local boot device (like a hard disk, CD-ROM or USB disk), it loads a small Linux kernel from that device which initializes the system and all of the peripherals that it recognizes. When configured for network booting the client first requests its own IP address and the IP address for the LTSP server via DHCP and loads the Linux kernel from a preconfigured Linux image on the LTSP server via the Trivial File Transfer Protocol (TFTP) service running on the LTSP server.

During this process the client makes a (new) DHCP request for the IP address of the LTSP server and the path to its chroot environment. When this information is retrieved, the client mounts the path on its root file system via the Network File System (NFS) service running on the LTSP server.

The client loads Linux from the NFS mounted root file system and finally starts the X windowing system. The client connects to the XDMCP login manager on the LTSP server. From this point forward, all programs are started on the LTSP server, but displayed and operated from the client.

Prerequisites

Server: A system with enough RAM and hard disk to support as many systems as you want to run.
Workstations: A system with no hard disk, only RAM and other basic parts are required.
Connection: Cable and switch

The basic requirements to run LTSP on your system you need :-

  • DHCP - This is required to allocate IP's to the client machines.
  • TFTP - This is required to copy kernel image from host to the client, which helps the client to boot up.
  • NFS - This is required to mount a file system on the client which has no memory of its own.
  • GDM - This is required to give Thin Clients Display Manager.


Isn't this sounds great running workstations with no hard-disk, no OS.
I think it is an ideal setup for schools, colleges and other places where you don't have much to store and with this you can cut down the cost also.
And if some one is worried about the crashing of the server then he/she can go for RAID disks, which can save you from loosing your data at least.



Installation

As far as installation is considered I am using Debian machine,

  • If you have a DHCP server already up and running on your network:
    apt-get install ltsp-server openssh-server
    Otherwise, if you want your LTSP server to function as the DHCP server:
    apt-get install ltsp-server-standalone openssh-server
  • Build the LTSP client environment:
    ltsp-build-client


If you change the IP data after you have done the initial setup and run ltsp-update-sshkeys on the server.

  • Configure /etc/dhcp3/dhcpd.conf:
    See examples in /usr/share/doc/ltsp-server/examples/dhcpd.conf or /etc/ltsp/dhcpd.conf and adapt to your network.
  • Add next server to dhcpd.conf and Restart dhcpd:
    /etc/init.d/dhcpd3-server restart.
  • And if you are running your DNS server on the same machine then you may have to configure /etc/dnsmasq.conf:
    See example in
    /usr/share/doc/ltsp-server/examples/dhcpd-dnsmasq
    and adapt to your network.
  • If you configured your DNS then Restart dnsmasq:
    /etc/init.d/dnsmasq restart
  • Configure /etc/exports:
    /opt/ltsp/i386 *(ro,no_root_squash,async,no_subtree_check)
This tells the NFS server to export this particular directory.
  • Restart nfs:
    /etc/init.d/nfs-kernel-server restart
And if required you can export the file system through exportfs (man exportfs for further details).
  • Start tftpd:
    /etc/init.d/tftpd-hpa start
  • But a change has to be made in edit /etc/default/tftpd-hpa:
    RUN_DAEMON="yes"
  • Restart tftpd:
    /etc/init.d/tftpd-hpa restart
  • You can also check if the tftp server is running:
    type tftp and press enter you will get tftp prompt(tftp>)


And most important thing i.e. to start a GDM session .




Troubleshooting


DHCP:

  • No DHCP or poxyDHCP offers were received.
This error can be due to many reasons, few of which I was able to cover were:
* Network not connected.
* DHCP server is down.
* Faulty dhcpd.conf file.
To solve this kind of problem start step-by-step ensuring that it won't happen again:
* Check the network cable (if it is connected properly or not).
* Check if the DHCP server is running:
* Check if the dhcpd.conf file is configured properly
i.e. every thing from subnet to ip range is set
properly(refer the sample file).



TFTP:

  • Connection timed out.
This error can occur due to firewalls/iptables blocking TFTP server's path to connect to the system.
And can be resolved by removing the corresponding reject rules from the firewalls/iptables.

  • ARP timed out
It's a problem which can make one think even thought the solution to his is very simple.
This occurs due to Network is not able to resolve the servers MAC address,
and can be solved by connecting a switch(layer 2 device) in the network.
Switch maintains a ARP table which helps the systems to Know the MAC address of the system which it wants to
connect.


NFS:

  • Mounting file system timed out.
I found only one error of such kind and that also didn't bothered me for a long time.
This was due to wrong path in the /etc/exports file i.e. the path of the exported Dir is wrong
.
And as you may guess the solution is as simple as it seems go to the /etc/exports and change the path.




Initialization

  • Restart DHCP, TFTP and NFS server and check if they are running properly.
  • Change the bios setting on the client machine to boot from the network.
  • Create users to access the client as you can not login as root.

No comments:

Post a Comment