How to use linbo-remote to manage school computers with little to no effort

Published by Stephan on

Linbo is one of the best features of linuxmuster.net – a free school server solution. I have already described an overview of what is possible with Linbo in one of my last articles. There I mentioned a command line program which is simply super for the administration of the school computers: linbo-remote. You can do almost anything else you would do with the Linbo GUI, e.g.

  • Partitioning and formatting computers, starting, shutting down, etc.
  • distribute new images in one room or throughout the school (in combination with Wake-on-Lan)
  • synchronize computers at any time and let the operating system of your choice start
  • Create images on a computer and upload them to the server
  • Combining linbo-remote with other scripts

Today I would like to describe how we use linbo-remote in our school and show what you can do with it.

Deploy new images with linbo-remote

At regular intervals we update our Ubuntu image, which we use on all our school computers. We do this mostly during holidays or when there are new major updates (e.g. Firefox, LibreOffice, important security updates). With the following command we deploy the image to all computers in a room:

$ linbo-remote -r room1 -p sync:1,halt -w 0

or

$ linbo-remote -r room1 -c sync:1,halt -w 60

A short explanation of what the individual parameters mean.

  • -r indicates the room. With -g you can also specify a group, with -i an IP or a hostname.
  • -w stands for Wake-on-Lan, i.e. linbo-remote wakes up the computers. Wake-on-Lan must be activated in the BIOS and it only works via a plugged in network cable (e.g. for notebooks). The number after -w specifies the seconds to wait for Linbo to execute the commands.
  • The difference between -p and -c is that with -p Linbo creates a file with the commands on the server. The computer gets this file as soon as it has booted to Linbo. -c tries to send the command directly to the computer via SSH. That’s why I entered a waiting time of 60 seconds, so that there is enough time for all computers to be woken up and booted.
  • after -c and -p you can specify different commands. Enter linbo-remote -h to obtain all possibilities. Almost all commands are followed by a colon after the command, followed by the number of the operating system. For example, if you have a dual boot system with Windows and Ubuntu, Windows gets the number 1 and Ubuntu gets the number 2.
    • sync:1,halt means that linbo-remote synchronizes the first operating system on the computer and then shuts down the computer.
    • format:1,sync:1,sync:2,start:2 means that Linbo formats and synchronizes the partition of the first operating system, then synchronizes the second operating system and starts it. When synchronizing, Linbo checks if there is a new image on the server, downloads it if necessary and copies it to the corresponding partition.

Automate administration of school computers

We have already seen above what is possible with linbo-remote. Connected to a cronjob, for example, we can synchronize and start all computers in the school or in a certain room every morning, so that all computers are “fresh” for use in class.

As root user you can create a new cronjob with

root@server$ crontab -e

and enter the following cronjob:

30 6 * * * * /usr/sbin/linbo-remote -r room1 -w 0 -p format:1,sync:1,sync:2,start:2 > /dev/null 2>&1

Every morning, at 6:30 a.m., every day of the year, Linbo now takes care of our computers in Room 1, synchronizing both operating systems and starting the second one so students can log on directly.

You can also use linbo-remote to shut down all computers booted to Linbo.

0 13,15,17,20 * * * * /usr/sbin/linbo-remote -r room1 -c halt > /dev/null 2>&1

At 1, 3, 5 and 8 pm all computers in room 1 that have booted Linbo will be shut down.

These cronjobs are a great help to create a reliable state on the school computers every morning. The disadvantage of this solution is that the cronjobs are executed every day, even on weekends or during holidays. But we can solve this problem 🙂

Combining linbo-remote with other programs

A member of the Linuxmuster Community has written a script that checks if today is a school day. Because the original script is written in German I’ve translated it. You can find it on Github and install it on the server as follows:

$ git clone https://github.com/cdscacth/linuxmuster-scripts.git
$ cd linuxmuster-scripts/school-day

In the files holidays.conf and exceptions.conf you have to enter the dates for public and school holidays like this:

# Public Holiday
20180301 Public Holiday 1
20181015 Public Holiday 2

# School Holidays
20171223-20180112 Christmas Break
20180319-20180417 Easter Break
20180625-20180813 Summer Break

Then you install the script with

$ sudo make install

If a school day is, the script returns a return value of “0”, otherwise e.g. “99” (for a holiday).

We can adjust the cronjobs above so that they are only executed on one school day:

30 6 * * * *  is-today-school-day && /usr/sbin/linbo-remote -r room1 -w 0 -p format:1,sync:1,sync:2,start:2 > /dev/null 2>&1
0 13,15,17,20 * * * * is-today-school-day && /usr/sbin/linbo-remote -r room1 -c halt > /dev/null 2>&1

Conclusion

Linbo and especially linbo-remote takes a lot of work off our hands. While we did a lot of “sneaker administration” in the first year, now linbo-remote does it for us. Gone are the days when we ran from computer to computer in school to provide them with a new image. Linbo is for me the best feature of linuxmuster.net and I have not yet got to know any other software that helps us to automatically create a defined state every day. Once the image is on the computer, it also works offline, i.e. the students can reset their computers themselves if something is “broken”.


Stephan

I'm a teacher and IT system administrator in an international school. I love open source software and I used it over a decade in my private and work life. My passion is to solve problems with open source software!

1 Comment

How To Set Up Scheduling In GRUB – CoinAffairs · April 3, 2018 at 1:04 am

[…] Ubuntu is started by default during the day, but during the night we let Linbo boot so that the computers can be updated or provided with a new image, […]

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *