Raspberry Pi Classroom infrastructure – Raspi-LTSP

For installing and getting started, check out the new project site including all the documentation – http://pi-ltsp.net

Raspberry Pis are great for schools, they act as a sandbox for teaching kids Linux, electronics (using GPIO pins) and programming using awesome applications like Minecraft Pi or Sonic Pi.

The Raspberry Pi recommended operating system, Raspbian, has been designed to be run standalone and come packaged with just about all you need to get started. Just download the image and stick it on an SD card, simple right?

The problem…

Simple until you decide to go all in and get a classroom set of Raspberry Pis. Now you have got 20-30 Raspberry Pis, but also 20-30 SD cards to maintain! How do you deal with it if you have more than 20-30 students? Few options.

  1. Give them each an SD card. This can have a few issues though if all the students in your school will be using them.. 100, 200, 300 SD cards to maintain!?!?!
  2. Have multiple user accounts on each Raspberry Pi, but make sure none will ever be needed at the same time.
  3. Just use builtin Pi user on a set of 30 SD cards, pupils save their work to their pendrive. This brings the problem of having to plug a pendrive in at end of every lesson, if you want to save stuff in the class, you also need a (powered) USB hub.

All of the above options are a bit rubbish, there is no single perfect answer.

One big issue though with all of the above is, what if an SD card or pendrive fails?……..

What if? If using any of the above options, it is gone… All that students work is gone, lost forever! This makes none of those options suitable for use with important coursework (GCSE or A-level CS)

At the Raspberry Jamboree last year, this point was brought up. The suggestion was the “magic pendrive”. The Raspberry Pis were configured to dump all the students work onto a special pendrive when it was plugged into the computer. This sounds simple and like a good solution, but when it needs to be done at the end of every lesson, it starts to get a little less viable.

This is what led me to start looking into a better way.

 The better way

At the time I watched the Jamboree panel, I had been playing around with LTSP (Linux Terminal Server Project).

It is a project that brings together a number of base packages from the Debian/Ubuntu software repositories plus a pile of custom scripts, to create a system that allows full Linux clients to boot off a network, aka not using the machines own hard drive. It supports 2 main types of clients

    1. Thin clients – These are clients that are basically dumb terminals into the server, no processing is done on these clients, all processing is done on the server. For Raspberry Pis this would for example let you run non Raspberry Pi software, or operating systems (like Ubuntu) but does not have access to Raspberry Pis GPIO or camera port, it also requires a powerful server for a classroom. A client for the Raspberry Pi already exists, called BerryTerminal
    2. Fat (/thick) clients – These are clients that just really use the server as a hard drive. All the processing is done on the Raspberry Pis, you have full access to the GPIO pins and camera port, but are stuck with the usual Raspbian OS. It also does not need a powerful server.

At the time when I was looking into this, there was no instructions for using LTSP with Raspbian fat clients or Raspberry Pis in general as fat clients.

After plaguing some developers in the LTSP IRC channel, we eventually figured out how to get LTSP to build clients for the Raspberry Pi. Then started the long laborious process of properly building Raspberry Pi Raspbian OSs.

How hard could building Raspbian be?

In short, quite…

The Raspberry Pi foundation make a lot of changes to a default Debian build… They do this through a tool called spindle by Alex Bradbury. The main issue for me with Spindle is it contains a lot of unneeded stuff for my system, seeing as LTSP does a large chunk of the build. I also didn’t want all the changes they made, mainly because some broke LTSP so had to be careful what a picked.

By the 25th February, 2014 (just in time for the Raspberry Jamboree) I had got a rough basic clone of Raspbian working, this wasn’t enough though, as the system had to be easy and complete as many tasks a teacher would need as possibly, with a press of a button.

Raspi-LTSP back on 25th of June, not many features...
Raspi-LTSP back on 25th of June, not many features…

So then new features like full Epoptes integration, Picontrol integration, NBD compression, student work collection system, auto installing software and a few others were added.

This brings us to the stage we are at now, a stable (ish) usable system designed to be easy to use for teachers.

Raspi-LTSP now full with features and options allowing teachers to really easily customise their Raspbian install
Raspi-LTSP now full with features and options allowing teachers to really easily customise their Raspbian install!

Yeah, but how does it work?

It actually isn’t too complicated.

Few prerequisites though.

  • Raspberry Pi is connected to the server via a switch or network hub
  • A router handling IP addresses (DHCP) is on the network or you set one up on the serverThe
  • Raspberry Pi has the boot files on its SD card, these are autogenerated when the server installs Raspi-LTSP and are tied to the servers IP address.
  • Raspi-LTSP is installed on the server and the server is turned on.

As long as all those are met, then the below sequence of events should occur

  1. When powered on, the Raspberry Pi loads the kernel, initrd, cmdline.txt file and config.txt file
  2. Kernel reads the config options and loads the initrd.
  3. An initrd (also known as an initramfs) is a simple, very small Linux filesystem used to chainload other filesystems, in our case a filesystem over the network
  4. The LTSP scripts in the initrd grab an IP address and try and contact the server
  5. If successful, it mounts the Raspbian filesystem off the server, as COW (Copy on Write)
  6. Copy on Write is a special setup that is similar to read only, but the OS is able to change the files. When it reboots though, these changes are lost.
  7. Once mounted, it runs some more LTSP scripts to finish setting up the client. These include setting up NBD swap. This is compressed swap in case the Raspberry Pi runs out of RAM.
  8. Finally LDM (LTSP Display Manager) loads up, allowing the user to log in

    The login screen for Raspi-LTSP powered by LDM
    The login screen for Raspi-LTSP powered by LDM
  9. Once the user logs in, their home folder is then mounted. Their home folder is stored at /home/user on the server.

So why should I use this?

A few reasons

  1. Centralised operating system – The operating system for the Raspberry Pis is stored on the server, centrally. This means if you want to make a change to it, say update a package or a configuration file, simple, just modify it on the server.
  2. Centralised users – The user accounts are stored on the server, not the Raspberry Pis. This means any student can sit down at any Raspberry Pi in the classroom, log on and get access to all their files.
  3. Centralised files – The pupils home folder of all their work is stored centrally. This means only a single folder (/home) has to be backed up, and all the students work is instantly backed up.
  4. Work collection – Raspi-LTSP contains a simple but effective system for collecting work from students, they just place it in a folder in their home folder called handin. Then the teacher selects an option in Raspi-LTSP and it goes and collects the work from every student, placing it in a single folder for the teacher to mark.

I want to see videos of it in action!

Well lucky for you, Ben Smith (@ManchesterBudo), a computer science teacher based near Blackpool has been trialing the system for a number of months now and has created some videos of it in action.

I am sold! How do I get started?

As mentioned above, a few prerequisites.

  • You need a network switch. It must have at least a single gigabit port (10/100/1000mbit), also sometimes called a stacking port. It is fine if the rest of 100mbit (10/100mbit). These can be picked up off ebay for less than £20, example1
    A single gigabit port is essential as the server must plug into it.
  • You need a classroom set of model B Raspberry Pis.
  • You need enough Ethernet CAT5 Ethernet cables to reach from your switch to Raspberry Pis
  • An old router or a DHCP server installed on the server machine to manage IP addresses on the network
  • A server machine – this can be an old desktop machine, it does not need to have large amounts of processing power, should have at least 2gb of RAM and at least 70gb of hard drive space. You will be formatting this machine. Finally, it must also have a gigabit Ethernet port.

The setup process is very simple, but requires internet to build Raspbian. Once it is finished, it won’t need an internet connection, unless you want to update or install new software.

For installing and getting started, check out the new project site including all the documentation – http://pi-ltsp.net

If you have any issues with the project, feel free to leave a comment below, post an issue on the github page or drop me a tweet @gbaman1

15 thoughts on “Raspberry Pi Classroom infrastructure – Raspi-LTSP”

  1. Andy,
    Would it be possible to host your LTSP server itself on a Raspberry Pi? Obviously performance would be reduced, but for a small system <5 clients, maybe this would still be acceptable with an external USB hard disk for the storage?
    Would the server run on Raspbian, or would it still need Debian Wheezy? I guess it might take a while to run the setup scripts on the Pi server, so could an image be created externally and then transferred to the Pi server for hosting, if this was a problem?

    1. Hey Kevin. No, running it on a Raspberry Pi would not go well. The Pi has a very slow network port (100mbit) meaning you may be able to run 1-2 clients? Maybe?
      I did try to run the installer a while back on a Raspberry Pi with little success. Some packages also weren’t available last I checked for the Pi.

      Raspi-LTSP is now no longer officially supported under Debian Wheezy (although I still try my best to support it). All new builds are tested on Ubuntu 14.04 as it is a much easier to OS for beginners.

      My suggestion would be find an old desktop machine, does not need to be powerful, and stick Ubuntu on it. Is always old machines laying around everywhere.

  2. Hi,

    Great project. I will most likely try to get this going this weekend. I do however have one question: the PDF file seems to be damaged. For example, page 16 seems to be missing graphics…not a major problem I can figure out what to do at that point. The other thing that is puzzling is that I seem to be unable to copy any text out of your PDF. The text on screen appears fine (I tried mainly with links to website) but when I try to paste it somewhere else, I get garbage. Has anyone else reported this problem?

    Thanks for the great project and write up.


  3. Is the audio port available on each raspberry pi? I heard the problem with the berry terminal software is that in that scenario you can´t have the audio port working on each raspberry client. Would it be with this app?


    1. Raspi-LTSP fully supports all hardware on the Raspberry Pi.
      BerryTerminal is only designed for thin clients, aka all the software is actually running on the server, but Raspi-LTSP is fat client, so all processing it done on the Raspberry Pi.

  4. Hello…I followed all the steps and now I have the RPI working , I mean I see the desktop and it seems to be working fine except for the sound part. I have no sound at the RPI side. I have headphones connected to the audio port so I was wondering if maybe the sound was going trough the HDMI output. Is it possible? If it is, how can i force it to go troug the audio port?


  5. I do not have the time that you took to put everything in place so I have been waiting for over 2 years now. Thank you so much for putting all this together. I will test this out on a desktop with the Raspi’s but eventually I plan on building a laptop as a server. The reason for using a laptop is because I want to take it into 3rd world countries. I have lots of challenges ahead but you did all the heavy lifting for me. Thanks again!

  6. I have installed the server in a virtual machine, but when I copy the files onto my SD card something goes wrong, he I plug the SD card in my Raspberry Pi nothing hapends!

  7. I didn’t read the comments before I started the install using Edubuntu 14.04. It seems to be going well, and now I see why. Is there a mailing list, group or forum that we could use for sharing idea/asking questions?

    Thanks for what looks like a great product. 🙂


    1. Hey Jim,
      I have not tested it before on Edubuntu although see no reason it wouldn’t work exactly the same. Glad to hear it is going well. A mailing list is in the works and currently most people just post on the Raspberry Pi forums for Raspi-LTSP stuff. If you do intend to though, I would suggest posting in “Using Raspberry Pi in the classroom” section – http://www.raspberrypi.org/forums/viewforum.php?f=48&sid=84be7236ffb8299dc1ae6f51175a3b8e

      If you have specific questions or need a hand with something Raspi-LTSP related, do feel free to drop me an email – http://pi-ltsp.net/support.html

      Finally, we do have a twitter account that posts info on the project, mainly updates etc. @RaspiLTSP – http://twitter.come/RaspiLTSP

  8. Why not use LDAP for authentication? This would be a great opportunity for LDAP to become more standard (and easier to use as development proceeds on it) for multi-workstation installs for Linux Labs.

    1. Raspi-LTSP was designed from day one to be really simple and easy to use for educators. Integrating LDAP would be rather complicated on my side (and I already have a huge todo list for Raspi-LTSP) but also is unnecessary for all the schools with a single set of Pis (95%+). For those with more Pis, they are much more likely to have better support staff able to try and integrate it themselves.
      LTSP (which Raspi-LTSP is based off) was designed to use Linux user accounts and I left it as is.
      It is certainly something on my todo list though to look into at some point.

Leave a Reply to gbaman Cancel reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.