UPDATE - LTSP HAS STOPPED WORKING IN 16.04 - - AGAIN!
SO, THIS TUTORIAL IS NOT NOW WORKING - - AGAIN!
Steve Cook - 16/008/2016)
How to install PNP LTSP on Ubuntu Mate
Since discovering Ubuntu Mate, I am reminded of why I came to Linux several years ago. For this reason, I am basing this instructional on Ubuntu Mate. Having said that, it will likely work for any other Ubuntu Variant. I should also say, I am a reasonablly knowledgable user of Linix, but am by no means a power user. Thus, the following tutorial has been written by me for people like me. There may well be other, more efficient (and certainly more knowledgable) methods of installation. But, this one works, and that's good enough for me and so I am putting it out there for anyone else who may find it useful.
What is LTSP?
Linux Terminal Server Project (LTSP) is a free and open source terminal server for Linux that allows many people to simultaneously use the same computer. Applications run on the server with a terminal known as a thin client (also known as an X terminal) handling input and output. However, it is also possible to run a client in “fat” mode. This is where, although the image is still stored on the server and is still fully served up to the client when the client boots up, much of the work of the client is then subsequently done by itself during a given user session. This leads to more efficient use of network resources and, in the case of a user wishing to experience high-quality, full-screen, streaming video on the client, a fat client set-up is essential.
The main advantages of LTSP over other forms of networking are both cost and administration. In terms of cost, it allows for the continued use of machines that would otherwise be deemed to be too old to run the latest software and/or operating systems (because, in the case of thin clients, the vast majority of the work in any given user sessions is carried out by the server). However, given the above, it should be obvious that the server needs to be as modern and powerful as budgetary constraints will allow for. In terms of administration, given that the client image is stored in a single location on the server, updating network software is vastly less cumbersome than having to update many copies of that image on each individual client machine's hard drive as would be the case with more conventional network set-ups.
As has already been alluded to, the traditional way of installing LTSP has been to create a client image on the server that stands quite independent of the server installation itself. That is to say, software can be installed on the LTSP image by a process called “chroot”. Thus leading to a client image which may be quite different in terms of functionality to the server image. If you know what you are doing, this is certainly a very versatile method of installation. I have included a link to Ubuntu's main LTSP page where you can follow the instructions and also the links contained therein for more details on this traditional LTSP set-up:
The above method is also, however, in my experience prone to many pitfalls unless you have a fairly high skill set in Linux administration generally and in Linux networking in particular. Although I have previously installed LTSP in the traditional way, for all of the reasons I have outlined, I have elected to make the following instructional for new version of LTSP, which is called PNP LTSP and which is now the only version of LTSP I use myself.
What is PNP LTSP?
PNP, in the context of this instructional stands for “plug n' play”. This method of installation and maintenance is vastly easier than the traditional method. But at some cost of versatility. Though, in my view that cost is minimal and is largely mitigatable in any event and so the benefits far outweigh the costs.
In terms of those costs, for example, unless you can guarantee that all clients will have 64 bit (amd64) architecture, you will need to install the 32 bit (i386) version of Ubuntu Mate on the server. The reason being that in PNP LTSP, the client image is directly built from the server installation. Thus, if you have a server that has a 64 bit physical architecture and is using the 64 bit version of Ubuntu Mate (and so any LTSP image that will be built from it will also be 64 bit), any client whose physical architecture is 32 bit will not load the image. On the other hand, all clients, whether their physical architecture be 64 bit or 32 bit, will load the 32 bit image. However, you should not be overly concerned about installing 32 bit Ubuntu Mate on a server whose physical architecture is 64 bit since the latest version of Ubuntu 32 bit is able to utilize RAM up to 64 Gb in any event. Also, a huge benefit of the image being directly derived from the server installation is when is comes to installation of software. That is to say, you only need to install it once on the server. Then, every time you update the client image, it simply copies whatever it finds on the server. Having said that, an administrator may wish to make some programs unavailable for client users. This is easily achieved via entries in a config file where disallowed program details are stored (more on this later), Thus, the client image will not include them in its build.
Another advantage of using PNP LTSP is that the use of fat clients/thin clients is done with a single image whereby if the client has enough resources of its own , the sever will automatically serve up a fat version of that image to it. But, if its resource are low, then the server will automatically detect this and serve up a thin version of the image instead. Furthermore, given that the image is directly derived from the server installation, administrators no longer have to go through the rigmarole of having to install a similar desktop environment on the client image as that which appears on the server (the traditional default desktop for an Ubuntu LTSP client image is Unity). Instead, the client image simply matches whatever the server has installed, including its desktop environment.
When I said this method of LTSP was easier than the traditional method, I wasn't joking!
Installation of PNP LTSP
The following instructions are based on my own preferred set-up and should be easily replicated. It's assumed that you've installed Ubuntu Mate 14.04 LTS 32 bit without LTSP, e.g. using the desktop CD. Also, this installation of LTSP will only require one Ethernet card instead of two as is the case with a typical LTSP installation. This installation is also unusual in that it makes use of standard electrical network ring mains (your 240volt plug sockets are part of this ring). This ring mains, via the use of power line adapters (allowing the ring mains wires to be used as an Ethernet cable) will be used to both connect the server to the internet (via a router connected to the internet) and also provide the means by which to transmit the LTSP image to client machines. For clarity, this physical arrangement of network components should be as follows:
I have only shown one client on the above diagram. However, you may connect as may clients as your plug sockets and server capacity allows for. Also, you should note that the power line adapters will not work if straddled over two or more plug rings. That is to say, you will typically find that different floors of a building may utilise separate plug rings. In which case, you should utilise only the one ring for the LTSP network and extend it to the other floor in order to have clients on that other floor as well. However, you do not actually need to use power-line adapters (I just use them because I find them fantastically convenient). In which case, you would need to connect the components up in the following way using standard ethernet cabling, meaning you can simply site your clients where you wish with no other regard:
I should also note, there is no need to actually have any clients connected at installation (the server, of course, must be connected at installation). I have just included them in the diagram for completeness of understanding of the architecture of a working LTSP network. All clients will get their internet access directly from the internet router via the same wired connection they are using for the LTSP network. It is this direct internet connection , rather than having the internet served up second hand from the server, that makes for excellent, full-screen streaming media on the clients, as compared to more traditional methods of LTSP networking. Indeed, this is my primary reason for using PNP LTSP.
As suggested earlier, you should at this point install on your server any programs that you want to make available to your clients.
You will need to add a repository for this particular version of LTSP. Also, for the duration of the initial installation of the requisite LTSP software, you will need to temporarily disable the Ubuntu network manager. In order to do the above, execute the following commands in a terminal:
sudo service network-manager stop
sudo add-apt-repository --yes ppa:ts.sch.gr
Then, execute the following commands in the terminal:
apt-get --yes --install-recommends install dnsmasq ltsp-server-standalone ltsp-client ldm-ubuntu-theme
echo 'IPAPPEND=3' >> /etc/ltsp/update-kernels.conf
Generating the client image
After the initial installation, and also any time that you have server updates (new software etc) that you want to push to your clients, you need to run the following command:
ltsp-update-image --cleanup /
As mentioned previously, if you need to, you can exclude some of your server files or directories from the generated image by editing “/etc/ltsp/ltsp-update-image.excludes”. You simply type in the name of the programs to exclude and they will be excluded the next time you update the image.
An lts.conf file is necessary for the purpose of specifying running conditions of the clients. For example, when this file is generated, it contains a single entry “ LDM_DIRECTX=True”. This significantly increases thin client graphics performance at a security cost. If you don't want it, comment it out by prefixing it with the “#” symbol
To create an initial lts.conf, execute in a terminal:
To edit the file, execute in a terminal:
sudo pluma /var/lib/tftpboot/ltsp/i386/lts.conf
Finally, you need to activate something called the DNS server. There are several ways to do this, but I have found by far the simplest is to execute the following in a terminal. Don;t worry if you don't understand this. Neither do I! Just know that if you execute exactly what is below, it will work:
sed 's/^dns=dnsmasq/# Commented by ltsp-pnp: dns=dnsmasq/'
sed 's/^port=0/# Commented by ltsp-pnp: port=0/' -i /etc/dnsmasq.d/ltsp-server-dnsmasq.conf
service network-manager restart
service dnsmasq restart
The next thing you will need to do is add a user on your server. This will give allow you to log into a client machine without having to use your own account (though you could, if you wished).
To do this, you need to go to System/administration/Users and Groups and follow the instruction for adding a user.
That's it for the initial installation of PNP LTSP. However, when you re-boot your server, you may find that if you try and fire up a client it will fail to boot. If this happens, go to a terminal and put in the following commands in turn:
sudo service network-manager restart
sudo service dnsmasq restart
Then, try and connect a client to the network (make sure you have gone into its BIOS and set to boot from network instead of from its local hard drive), you will find it now boots to the LTSP network. The two command, above, having been executed at the start of a session will be good for the rest of that session on the sever.
There is quite a bit of other stuff you would be well advised to use to maintain and your LTSP network efficiently and I will be writing further tutorials to that end shortly. But, for the moment, this tutorial will get you up and running.