LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Blogs > beachboy2
User Name
Password

Notices



Rate this Entry

LTSP-Setting Up from Scratch

Posted 12-15-2012 at 06:47 AM by beachboy2
Updated 02-04-2014 at 07:33 AM by beachboy2

What is LTSP?
LTSP stands for Linux Terminal Server Project. It is a free and open source system where a Linux server is connected to several terminals, thus allowing a group of people to simultaneously use the same computer. Applications are run on the server, and the terminals or thin clients, handle the input and output. Generally, the terminals are low-powered, have no hard drives and are quieter and more reliable than standard desktop computers or laptops because they have fewer moving parts.

http://www.ltsp.org/

What are the benefits of LTSP?
Reduced purchase and running costs, no licensing fees, reduced maintenance and good security.
http://www.ltsp.org/benefits/


How to set up an LTSP system from scratch

Introduction: There is some good information about LTSP online and there are several different ways to produce a working LTSP system. However, some of this information is out of date especially with regard to current (December 2012) hardware requirements. Also, with regard to software, several configuration files need additional editing.
For somebody who is totally new to LTSP, much of this wide-ranging information can, at first sight, appear somewhat confusing.

As a result of my recent experiences in setting up a new LTSP system, I would like to pass on some useful tips and advice, so that your installation can go as smoothly as possible, unlike mine!
I must give special credit to the Fan Club, Bristol Wireless and Blackpool Linux User Group for their valuable help and advice (see links at end).

This article is intended as an LTSP HowTo, an LTSP walk-through, an LTSP guide for beginners; in other words, “LTSP from Scratch”.

As mentioned above, this is not the only LTSP route; it is simply the one that I took to set up LTSP using 2 network interface cards (NICs).

To see the wiring for an LTSP with 2 NICs, look at the third illustration down (featuring Edubuntu):
https://help.ubuntu.com/community/UbuntuLTSP/LTSPWiring


Preparation
: I know that there are online guides which claim that you can set up a new LTSP system in 45 minutes, but believe me, that is probably not going to be the case for most people.
I came across several pitfalls and bugs, which of course simply do not exist in the perfect “LTSP in 45 minutes” world.

Hardware

For the thin clients, virtually any old redundant or semi-redundant hardware will do and of course, no hard drives are required. With any luck you can possibly acquire some suitable thin clients for free, or at least very cheaply. Anything from laptops with P3 processors and 128 MB or 256 MB of memory to more recent desktops such as HP dc5750 SFFs with AMD 3800+ processors and 1GB of memory are suitable.
The former are featured at Blackpool LUG:
http://www.pcrecycler.eu/2012/10/red...computers.html

I used the latter myself.

For the server, it is better to build from new if funds allow, unless you are simply trialling LTSP and only building a test server. It is advisable to concentrate the bulk of your available resources on a powerful CPU and plenty of memory.
The old yardsticks for server memory are out of date. A current rule of thumb for the amount of server memory is something like (n+2)GB, where n is the number of thin clients.
Using this rough guide, it can be seen that 16GB of server memory will power at least 14 thin clients.

The other limiting factor is the number of available ports on the switch. I used a 16 port TP-Link TL-SL1117 switch, but switches with 32 and 64 ports are available:
http://www.tp-link.com/en/products/d...odel=TL-SL1117

My server hardware is as follows:
CPU: Intel i5-3570k quad core Ivy Bridge
CPU Cooler: Arctic Cooling Freezer 13 CO (Continuous Operation)
Motherboard: Gigabyte GA-H77D3H-Socket 1155
Memory: 16GB Crucial DDR3-1333Mhz (4 x 4GB)
PSU: Seasonic 430W S12II 80 Plus Bronze
Hard drives: 2 x Samsung 1TB SpinPoint F3 (HD103SJ)
Optical Drive: Samsung SH222-BB SATA DVD RW
Case fans: 2 x Noctua NF-S12B
Case: My existing Akasa Mirage (something like an Antec 1100 would be fine)
**NIC(s): 1 (or 2) Intel PCI-e Gigabit CT Network Cards (EXPI9301CTBLK)

**Normally it is sufficient to buy just a single network card to supplement the motherboard's existing built-in ethernet adapter/onboard LAN. However, it is very important to find out whether the onboard LAN behaves well with Linux.

I concentrated on buying a good quality Gigabyte motherboard (with solid Japanese capacitors etc) and I overlooked the fact that this board, like some others, uses an Atheros AR8131 ethernet controller. This controller, in common with some other Atheros controllers, causes major headaches in Linux because of driver problems. Some other onboard ethernet controllers are also troublesome, so please do your own research via Google and Linux forums before buying a new motherboard.

As I see it, there are 2 choices:
1. Ideally, choose a decent quality motherboard with a Linux-friendly onboard ethernet controller, and buy a SINGLE network card, or
2. Buy the above Gigabyte motherboard (or a similar one, with a “Linux-unfriendly” controller) and then purchase TWO network cards. When using this option, do remember to enter the BIOS and disable the motherboard's onboard LAN (under Peripherals) before proceeding any further.

The Intel Gigabit CT network card (82574L) has very good feedback from Linux users. The required e1000e driver is in the Linux kernel.
http://www.newegg.com/Product/Produc...82E16833106033

This Intel adapter is compatible with Ubuntu 12.04 and is installed in the HP ProLiant DL120 G7 server, amongst others. These Intel Gigabit CT cards worked perfectly for me in Xubuntu 12.04. Other non-Gigabit 10/100 PCIe network cards are available, but do please check their Linux compatibility before purchase.

http://www.ubuntu.com/certification/...e/201107-8315/


Software

Choose your favourite Linux distribution from Debian, Linux Mint, Fedora, CentOS, OpenSUSE, Gentoo or one of the Ubuntu versions as a candidate for LTSP. A normal, standard Desktop Edition should be installed first and then the LTSP server components added subsequently.
The following instructions are based on the various Ubuntu flavours but the general procedure is broadly the same, regardless of the Linux OS.

NB There are two points to bear in mind with Ubuntu 12.04 LTS in Classic mode (non-Unity).
Firstly, the offspring in the thin clients will still be Unity versions!
If you dislike Unity, then it is probably a good idea to choose Xubuntu 12.04 or Kubuntu 12.04 or use a completely different distribution altogether.
The second point is that there is a bug in gedit when using Ubuntu 12.04 in Classic mode.
I decided to use Xubuntu 12.04 LTS and I kept vim as my usual text editor.
For those who are unfamiliar with vim, here is a brief tutorial:
http://vim.wikia.com/wiki/Tutorial

Firewall

Is a firewall required for an LTSP server?

Firstly, most routers have a built-in firewall plus Network Address Translation (NAT) is enabled.

Secondly, default Ubuntu installations with a two NIC configuration (one dedicated to serving the thin-client subnet, and the other acting as a gateway to the rest of the physical network and/or the Internet) do not run any outward (internet-facing) services, so they have no ports open to the internet and do not require a firewall.

The LTSP server provides services to its clients, which by default are supposed to run on a dedicated and unrouted interface and gets set up with addresses from a private IP range (eg: 192.168...) provided by the LTSP DHCP server.
Since these are neither accessible nor visible from the outside world, they do not require firewall protection.
The default Ubuntu LTSP Server installation is perfectly safe without running its own firewall, and it is recommended that a firewall is not installed, especially during initial setup and testing. A small misconfiguration in a firewall could prevent LTSP working correctly.

However, if a firewall is required, perhaps because the server is also to run internet services such as a web server, then the firewall must be configured to enable the LTSP client services such as TFTP, DHCP, and NBD.
https://help.ubuntu.com/community/Ub...P/LTSPFirewall
Information on configuring Ubuntu’s Uncomplicated Firewall (UFW):
http://savvyadmin.com/ubuntus-ufw/
http://ubuntuforums.org/showthread.php?t=823741
Port Numbers:
http://en.wikipedia.org/wiki/List_of...P_port_numbers


METHOD

Install your preferred Linux distribution (Desktop Edition) as normal using a single ethernet cable connected from your router to either the server's onboard LAN or to an additional NIC. (Remember to first disable the onboard LAN in the BIOS, if using 2 additional network cards. See 2 choices above).

It is a good idea at this stage to go into the BIOS of each thin client and ensure that Network Boot is selected first in the Boot Order.

It is also necessary to set two more options in the BIOS (this may vary slightly, depending on the particular BIOS of your thin clients):
(i) Advanced > Power-On Options > Remote Wake Up Boot Source > select Remote Server
(ii) Device Options > select NIC PXE Option ROM Download

In July 2011 the Fan Club produced an excellent set of extremely clear and concise LTSP installation instructions:

Fan Club instructions:
http://www.thefanclub.co.za/how-to/h...t-thin-clients

Use those instructions, to carry out Step 1 and Step 2.

Step 3 Edit the DHCP configuration for your LTSP server to match your chosen IP range.

In this case 192.168.0.xx changes to 192.168.1.xx.
Open the Terminal Window and enter :

Code:
sudo vim /etc/ltsp/dhcpd.conf
The 8 numbering changes are marked in bold type:
Code:
# Default LTSP dhcpd.conf config file.
#
 authoritative;
 subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.20 192.168.1.250;
   option domain-name "example.com";
   option domain-name-servers 192.168.1.1;
   option broadcast-address 192.168.1.255;
   option routers 192.168.1.1;
#     next-server 192.168.1.21;
#     get-lease-hostnames true;
   option subnet-mask 255.255.255.0;
   option root-path "/opt/ltsp/i386";
   if substring( option vendor-class-identifier, 0, 9 ) = "PXEClient" {
       filename "/ltsp/i386/pxelinux.0";
   } else {
       filename "/ltsp/i386/nbi.img";
   }
 }
Step 4 Select the network interface/s for the DHCP server

Add the network devices you would like the DHCP server to run on. In this case we changed the value of INTERFACES to include eth1

Open the Terminal Window and enter:

Code:
sudo vim /etc/default/isc-dhcp-server
Do please note that the internal LAN network for the thin clients (second NIC) is eth1 and NOT eth0 as shown in the Fan Club's original instructions. The first network (router to the first NIC) is eth0.

The last line of the isc-dhcp-server file should now read:

Code:
INTERFACES="eth1"
Also note that *NEW (below) denotes an additional new Step compared to the Fan Club's original instructions above.

Step 5 Restarting the DHCP server
This step needs modification because of the introduction of Upstart Start Up Manager.
http://www.linuxplanet.com/linuxplanet/tutorials/7033/1

Upstart-What's the difference between “Service” and “/etc/init-d/”?

http://askubuntu.com/questions/2075/...and-etc-init-d

In Terminal, now enter this line:

Code:
sudo service isc-dhcp-server restart
(Note that restart can be replaced by stop or status for similar Service commands).

*NEW Step 5(a) It is also necessary to edit the isc-dhcp-server Upstart configuration file:

/etc/init/isc-dhcp-server.conf

Use your favourite text editor to edit the above file.

I used vim as follows:

Code:
sudo vim /etc/init/isc-dhcp-server.conf
To the line “start on runlevel [2345]” add “and net-device-up IFACE=eth1”
(without quotation marks), so that the new line now reads:

Code:
start on runlevel [2345] and net-device-up IFACE=eth1
Step 6(a) This is optional for Fat Clients. (I omitted this).

Step 6(b) Disable NBD compression? YES, but do remember to re-enable NBD compression after setting up the thin clients.

I used vim as follows:

Code:
sudo vim /etc/ltsp/ltsp-update-image.conf
There was no existing file, so all the following text was copied and pasted into the empty file:

# Configuration file for ltsp-update-image
# Do not compress the client image. Comment out the line below to enable again.
NO_COMP="-noF -noD -noI -no-exports"

Step 6(c) Build the 32bit Thin/Fat Clients

Code:
 sudo ltsp-build-client --arch i386
Step 7 Reboot the DHCP Server (as per Step 5):

Code:
sudo service isc-dhcp-server restart
Check the server status:

Code:
sudo service isc-dhcp-server status
*NEW Step 7(a) Re-enable NBD Compression:

Code:
sudo vim /etc/ltsp/ltsp-update-image.conf
Comment out the last line by means of # :

# NO_COMP="-noF -noD -noI -no-exports"


Step 8 Set up Thin Client Admin user

Replace the adminname with your new client admin username (not to be confused with your current Linux OS's administrator name).

Code:
sudo -s -H
chroot /opt/ltsp/i386
useradd -m adminname -G sudo
passwd adminname
exit
exit
Lock the admin account's password
Code:
sudo chroot /opt/ltsp/i386 passwd -l adminname
Update the client image
Code:
sudo ltsp-update-image --arch i386
Step 9 Set up a Thin Client User Account

Open Users and Groups

Step 9(a) Install gnome-system-tools:

Code:
sudo apt-get install gnome-system-tools
Next, follow Steps 9(b) to 9(e).


*NEW Step 9(f) Adjusting pxelinux.cfg/default (this is for Ubuntu 12.04).

https://help.ubuntu.com/community/UbuntuLTSP/ProxyDHCP

Unfortunately, the ipconfig and udhcp programs used in the initramfs do not support the proxy DHCP part of the PXE specification.

To rectify this, in Terminal perform the following:

Code:
sudo -i
  (cat <<EOF
  ipappend 3
  EOF
  ) | sudo tee -a /var/lib/tftpboot/ltsp/i386/pxelinux.cfg/default
  exit
  exit
*NEW Step 9(g) Additional step for 12.04, install tftpd-hpa

(In my case, using Xubuntu 12.04, tftpd-hpa was already installed).

Installing ltsp-server does not install tftpd-hpa, which is a necessary component needed in order to load tftp images to the client computers upon pxe boot.

The tftpd-hpa program listens on port 69, therefore in order to transfer the ltsp image files to the clients, it must be installed. There is no additional configuring to do once it is installed. APT should install and start the program, you do not have to "ltsp-update-image", the syntax:

Code:
 sudo apt-get install tftpd-hpa
*NEW Step 9(h) Update client image:

Code:
sudo ltsp-update-image --arch i386
Step 10 Boot your Thin Clients from the Ubuntu LTSP server.

First, using cat5e cables or similar, connect the second NIC to the switch and then the switch to the thin clients. Power on the switch and the thin clients.

If all is set up correctly you should see the Ubuntu LDM login screen on your thin clients.
You should then be able to login with your newly created thin client usernames and password(s).

Troubleshooting

If you made any changes to the DHCP file, or to the image that the clients boot from, then run these 3 commands, in this order:

Code:
sudo ltsp-update-sshkeys
sudo ltsp-update-kernels
sudo ltsp-update-image --arch i386
If that doesn't work, then restart the DHCP server:

Code:
sudo service isc-dhcp-server restart
Check the server status to see if it is running:

Code:
  sudo service isc-dhcp-server status
If you receive a “BusyBox” warning similar to this:

Busybox v1.18.4 (Ubuntu 1:1.18.4-2ubuntu2) built-in shell (ash)
Enter help for a list of built-in commands.
(initramfs)


then it is possible that your firewall may be blocking a port which is needed for the thin clients to function properly.

This error message will also be displayed if Steps 9(f) and 9(g) have not been carried out correctly.


Links
LTSP:
http://www.ltsp.org/

UbuntuLTSP:
https://help.ubuntu.com/community/UbuntuLTSP

The Fan Club:
http://www.thefanclub.co.za/how-to/h...t-thin-clients

Blackpool LUG:
http://blackpoollug.blogspot.co.uk/2...computers.html

Bristol Wireless:
http://www.bristolwireless.net/ltsp/
Posted in Uncategorized
Views 4983 Comments 0
« Prev     Main     Next »
Total Comments 0

Comments

 

  



All times are GMT -5. The time now is 03:21 PM.

Main Menu
Advertisement

Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration