LTSP Server with Ubuntu 16.04

Reading time ~4 minutes

LTSP Server with Ubuntu 16.04

LTSP Server with Ubuntu 16.04

1 Introduction

LTSP allows computers of a LAN to boot through network from a single server. One of the benefits of this is for example to cut down the administration and maintenance time of a classroom of computers (instead of installing, configuring and updating each of them, we do it only once).

Some details about how it works are described in this article (in case that you are curious): https://ubuntuforums.org/showthread.php?t=2173749

The Edubuntu LTSP Live is the most easy way to run a classroom with Edubuntu LTSP. But it is a bit outdated (based on ubuntu-14.04). However it is not so difficult to build a LTSP server with the latest Ubuntu desktop.

In my case, all the clients are decent machines with 2GB RAM, and the server is just like them, so I decided to follow the ltsp-pnp approach for fat clients, which is also the most easy to implement. In this method the server is used as a template for the clients, so that almost all the programs, configurations, users, etc. that are installed on the server will be made available to the clients as well (through the network).

Also, the gateway/router of the LAN provides automatic network configuration (DHCP) as well, so I don't have to and I don't want to introduce another DHCP server on the LAN (which may potentially be a source of network problems).

2 Preparing the server

I started by making a standard installation of Ubuntu 16.04 desktop on the server PC, followed by some standard updates/customizations, like:

apt-get update
apt-get upgrade
apt-get install chromium-browser
etc.

I tried to install all the programs/tools that should be available on the clients. In particular, one of them is epoptes, which allows remote desktop control for the clients:

apt-get install epoptes epoptes-client
gpasswd -a ${SUDO_USER:-$USER} epoptes

Then, I set a fixed IP address to the server by adding these lines to /etc/network/interfaces:

auto enp0s8
iface enp0s8 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8 8.8.4.4

3 Installing LTSP

3.1 Install packages

I installed the package ltsp-server (not ltsp-server-standalone) and the other related packages:

add-apt-repository --yes ppa:ts.sch.gr
apt-get update
apt-get --yes --install-recommends install dnsmasq ltsp-server ltsp-client ldm-ubuntu-theme

3.2 Update kernels

echo 'IPAPPEND=3' >> /etc/ltsp/update-kernels.conf
/usr/share/ltsp/update-kernels

3.3 Create lts.conf

The command:

ltsp-config lts.conf

creates the file /var/lib/tftpboot/ltsp/i386/lts.conf or /var/lib/tftpboot/ltsp/amd64/lts.conf (depending on the architecture of the server). I did not customize it.

3.4 Configure dnsmasq

The command:

ltsp-config dnsmasq

creates the configuration file /etc/dnsmasq.d/ltsp-server-dnsmasq.conf.

I had to fix a few things in it:

  • I don't want this server to give IP configuration (DHCP), so I commented out this line: dhcp-range=192.168.67.20,192.168.67.250,8h
  • The line port=0 breaks the name resolution (DNS) in Ubuntu-16.04, so I commented it out as well.

Then restart dnsmasq:

update-rc.d dnsmasq enable
service dnsmasq restart

Note: If you don't have a DHCP server on your network, then don't comment the dhcp-range above. But make sure that the fixed IP (set in the previous section) and the DHCP range are in the same network (for example address 192.168.11.1 and dhcp-range=192.168.11.50,192.168.11.100).

4 Creating the client image

The command:

ltsp-update-image --cleanup /

generates the client image. It may take some time.

When it is finished, then you can start booting clients from the network. This is usually done by pressing F12 when the computer is just powered on, but it may be different on different computers. Sometimes you may need to enable booting from network on the BIOS (it is usually called PXE booting).

5 Installing Edubuntu programs

Edubuntu programs can be installed like this:

apt-get install edubuntu-desktop

Or like this:

apt-get install ubuntu-edu-preschool ubuntu-edu-primary ubuntu-edu-secondary ubuntu-edu-tertiary

The first one installs everything about Edubuntu, including the desktop, how it looks etc. The second method installs only the additional educational software that usually comes with Edubuntu, without changing the existing desktop etc. I prefer the second way because it is more flexible (for example I would like to skip the preschool tools, which are mainly games for small children).

Now that we have installed new packages, we have to update the image as well, in order to make these changes available to the clients. It is the same command as before:

ltsp-update-image --cleanup /

6 Installing additional desktops

In Linux we can install several desktops and let the user choose which one he prefers. For example this article shows how to install the MATE desktop, this one how to install XFCE, etc. They can also be installed by installing the packages xubuntu-desktop, lubuntu-desktop, kubuntu-desktop etc. Then you need to update the client image again.

Attention: When you install another desktop, it is possible that it may replace the Display Manager (the login window) with another one. Make sure that you always keep lightdm as display manager, not something else (for example mdm), because the tools that automate the configuration of LTSP work well only with lightdm.

7 Adding more users

All the users of the server can also login from each of the clients. So, to add more users we just add them on the server. No need to update the client image on this case. Also, everything that the users change is saved on the home directories on the server.

Date: 2017-01-07

Author: Dashamir Hoxha

Created: 2017-06-01 Thu 08:29

Moodle For Every School

Moodle For Every SchoolMoodle For Every SchoolTable of Contents1. Abstract2. Introduction3. Installing Moodle4. Moodle as a Service5. Ins...… Continue reading

Building SSH Tunnels

Published on March 25, 2017