How I implemented Linux in school
The described project has been implemented and has been used for five years now. It's time to tell how everything was and share the experience.
Once upon a time, I worked as a technician (something like a laboratory assistant, but more specialized) in one of the educational institutions of secondary vocational education in our vast country. I watched how classes are held, I saw students and teachers messing up with fragile software, participated in mass routine operations, such as: “reinstall some of the most popular OS on 30 or more different computers”, “oh, for the needs of the educational process we urgently need to deliver this software package, but we don’t know the audience yet, ”and so on.
I was not quite happy with the state of things. It seemed to me that everything should be simpler, easier, more elegant and generally work almost by itself (a familiar feeling?). As a result, an explosive mixture of youthful maximalism, student inexperience and a desire to change the world created in my head a “perfect” picture, as it should be.
Under the cut a lot of text with pictures, technical details, one heavy GIF and a 6-minute video presentation.
But the idea was simple, I put the Linux distribution everywhere, because everyone knows that they (Linux) are safe, beautiful and there are no viruses there. I am writing a small bike park to automate the routine ... Profit!
In fact, by that time I was familiar with Linux and open source software quite well and was fully aware of the lack of familiar programs for teachers and / or educational materials on open analogs. As far as I knew, many implementations crashed about these problems. But I thought it all up! All that was needed was to sit down, write everything quickly, and universal happiness would come. Are such trifles as human habits and unwillingness to learn something new can stop a meticulous student? In general, they could have stopped, but the authorities were supportive of my enthusiasm, for which many thanks to him. While I was messing around with writing my own bicycles, which are described below, in our country in the field of education they began to struggle with illegal software. Here my ideas came in handy.
In addition to the purely selfish “make your work easier”, I sincerely wanted to make learning in computer classes easier and more fruitful for both students and teachers. A simple replacement of the “most popular OS” with the Linux distribution, from my point of view, was “sewn to soap”. Such a transition simplifies the life of accountants and lawyers, and maintenance staff both ran from computer to computer and continue to run (well, maybe a little less). Actually, here is a list of problems that I intended to solve. And I decided.
Software in computer labs requires maintenance. It must be installed and updated on many machines.
I can put one program on one computer, on two - I can’t: the monotonous work scares me. Here, a batch installation system came in handy. I collected the package, put it in the repository, registered an update on computers on boot. Ubuntu repository downloaded as a whole and placed on the local network. Part of the packages replaced, part added. He wrote several scripts to build packages and copy the updated repository to the server.
Now, if you need to update the software, just drop the package into the repository and restart the computers.
Beautiful, light appearance without the ability to change it
Students like to show their individuality and tweak the appearance of public computers for themselves. Sometimes they do not get it quite politically correct, then teachers resort to panic, because through the pseudo-security policies of the “most popular OS” the menu for changing wallpapers is blocked. This circumstance does not frighten students at all, because they are aware of which picture needs to be replaced ... And then in the same vein. The imagination of the young generation and the desire to "stand out" knows no barriers. That is, I did not know.
As a KDE fan, I would love to share the joy of using this wonderful environment, but here the legendary KDE-based customizability is just not needed at all, so the choice fell on the OpenBox and pypanel window manager. And almost everything. This is such minimalism. Such a bunch worked and it turned out that Lazarus (a Delphi clone) and some programs from under wine are not friends with OpenBox.
The final version, working to this day, was built on the KWIn window manager and tint2 panel. KWin is able to draw both "modern beauties" through OpenGL, and "in the old way" without any problems working on the old hardware, which at that time was the place to be.
The attentive reader has already noticed the missing component in this “description desktop” - the actual desktop on which the icons are drawn. That's the number one bike. "Desktop" I wrote myself. I had specific requirements for this component, and it's easy to write. It is only necessary to assign the correct X11 flags to the window, and these flags quickly look in the implementation of the KDE-shny desktop (here it is, the power of open source!). My desktop was supposed to be extremely simple: be able to display .desktop-files (analogous to .lnk on Windows, only text) from a specific folder and show “boring wallpapers” from a specific file. But he should not run the programs independently, but via DBUS (this is such an IPC) through the “client for management”, which is described below. The latest version of the desktop has been rewritten using QML,
Safety and health for all computers!
Many students and teachers relate to these concepts on the principle of "not mine - not sorry." This attitude of users is extremely frustrating for maintenance staff. I thought a little and made “terminals” from student machines, returning to their original state when a user changes or reboots. This was done with a regular bash script that cleans home and tmp. Simple and effective.
Your data everywhere or our personal cloud
If you just erase all student achievements and make them do it all over again ... That would be cool! Probably, the speed and quality of their work would greatly increase, and by the second year they could ... But this plan to improve the quality of education was not destined to come true. Partly because I wanted to play with FUSE and write my caching file system. Wrote. She worked for a while, but then I got tired of messing with her. I wrote a script on the bash that selectively compresses files from the home directory when the user exits and throws them to the server via rsync, and downloads and unpacks them at the entrance. Side effect: students are no longer attached to specific computers and classrooms. Hurrah!
We want to indicate which software can be used
Most users are legally illiterate. It is very difficult to explain that a number of programs cannot be used in the educational process without paying a large amount, since this number is periodically replenished without the knowledge of the employees responsible for the legality of the installed programs.
To get started, I approached the solution of this issue classically: everyone will work from under a limited account. That's all, both students and teachers from under one regular account, established on all machines. This, as well as self-deleting data, and Linux itself make installation of third-party unapproved software difficult.
Gingerbread whips cannot be introduced
Now you can limit everything and everything and feel like a real villain. But there was no such task, therefore, it was necessary to do something pleasant ... First, the teachers and the educational process. For the sake of this good purpose, I wrote "Control Panel" by a computer class. Why write your own when there are already good and even open solutions? I like the web interface. It is so great to go in from any computer (smartphone, tablet) and steer a computer class. And the teacher is not tied to a specific machine.
“Control Panel” is a server that accepts a command from the web interface and sends it to all dedicated computers. I combined the HTTP and network IPC server in one program (now I would not do that, it does not scale at all) for the convenience of event processing and shared memory.
I installed the client for the server on all machines running Linux. The client connects to the server when the computer is turned on and waits for commands. Most commands simply run bash scripts.
The functionality of the "Control Panel" expanded gradually. But the first and perhaps the main “feature” was permission to use programs. It looks like this: students sit down at computers, enter their usernames and passwords and see an empty desktop. The teacher sits down at the computer, enters his username and password and sees the “Control Panel” icon on the desktop. When you click on the icon, a browser opens with the "Control Panel" page. On this page, from the list by installing checkmarks, the programs that the teacher needs for the lesson are selected. Icons of the programs selected by the teacher appear on the students' desktops. Now students can run programs by clicking on the icons, or the teacher himself can run the necessary programs from his computer on all or on the students' dedicated computers.
This magic works as follows. The server sends the command "set application_name" to clients. The client, having received the command, downloads the file "application_name.desktop" from the HTTP server. In this file, I added a few more to the standard fields, which list the packages for installation, the main files and directories of the application, etc.
When the desktop file is loaded, the client will try to install the packages listed in it and set read / run permissions to the specified application files. If the teacher decides that it is enough for students to work with any of the allowed programs, he unchecks the “Control Panel”. The command “delete application_name” comes to the clients, the program closes, the desktop file is deleted, read and execute permissions are removed from the specified files. Installed packages remain intact. To reinstall every time is too expensive.
While the program is being installed and configured, a translucent application icon bounces cheerfully on the desktop.
When a new interesting program comes out, I drop the package into the repository, and on the server the desktop file, and in the “Control Panel” a program appears that is available for selection by the teacher.
Student machines send a small screenshot of the desktop to the server once every few seconds. This picture is shown to the teacher in the Control Panel. But this is not enough. All competitive solutions are able to watch and manage the remote desktop. Why am I worse?
Then another “Wishlist” arose: the mode of showing one desktop to the whole class. There was such a task and thought that it would be nice to integrate this functionality. The usual x11vnc from the Ubuntu delivery was very slow when 25 screens were connected, and even with 10 it was already uncomfortable. Saved the position of TurboVNC, which showed acceptable performance. He added two more buttons to the “Control Panel”: “View desktop (and manage)” and “Show selected to all”. When pressed, a command goes to the server “Show computer X to computers Y1..Yn”, and the server already indicates to whom to start the VNC server, and to whom - viewers, the control panel is a normal web page and it is difficult to communicate directly with other computers.
When students see the browser, thoughts about learning leave and social networks and other non-learning resources of an entertaining nature are justified in the tabs. Well, okay, let's go back to dictatorial measures and introduce white lists. Just let the teachers manage them. They want it, let it be allowed, but it is necessary, so the allowed addresses are indicated. Added another button to the "Control Panel". When clicked, a dialog opens where you can add a URL.
These sites are stored in the teacher’s profile, and are available in the list of programs, from where they are easily assigned to students by checking. When assigning URLs to selected computers, the command comes: add the specified address to the list of allowed and reconfigure the tiniproxy installed on each machine.
The structure of the WWW is now such that the permitted site X most likely draws scripts, styles and images from other unresolved resources, and the pages look sad or do not work correctly. Therefore. when the command “add allowed URL” arrives, the site is downloaded, parsed, links to scripts, styles and pictures are taken out of it and added to allowed ones. It doesn't always work correctly, but it's better than nothing.
Some other applications need access to certain sites for proper operation. For such cases, I added a parameter listing sites to the desktop file. When the teacher selects the application, the sites indicated for him are automatically resolved. If you need to allow all or some students full access, the teacher selects the “Full Internet access” list and the restrictions are removed.
Learning operating systems or virtual machines
At first, when all this started, I reassured teachers with the presence of “the most popular XP OS” in a virtual machine. Looking ahead, I’ll say that this option is no longer available and we smoothly, not without stress, but the environment was formed exclusively from free software (in several computer classes).
Returning to visualization, I chose VirtualBox and implemented the management of virtual machines in the spirit of the whole system - I do it once and replicate it for everyone. In the "Control Panel" in the section with applications, both FreeDOS (do not ask why), ReactOS, and the same Ubuntu Linux with root access are now listed. These pseudo applications run a script that downloads a virtual machine image from the server and puts it in the cache. If the image has not changed and is already in the cache, it will not be downloaded again. The same script sets up VirtualBox and starts the virtual machine in snapshot mode, that is, the student can do anything with the running virtual machine, but everything will return to its original state.
But what about Gnome and KDE?
Teachers want to show students different "work environments", they say, there is not only one Start button (which is, that is, it is not). First, I went along a simple path and prepared several virtual machines with Linux: one on KDE, the other on Gnome. But in this mode, these demanding environments worked very leisurely. And when there was a free minute, I wrote scripts that “just” run the selected desktop environment on top of mine, and the teacher from the Control Panel can close KDE or Gnome at any time. Now you can change desktops without rebooting. Fast and convenient!
In computer classes, sometimes events are held with third-party participants (presentations, courses, competitions, etc.). It is not interesting to enter a login and password for each of the guests, therefore there is an Anonymous Login button in the panel. This is a very convenient and important button! Clicking on it will open a clean desktop on the selected computers without a single icon. If then you select everything in the “control panel” from the list and click “start the tedious process of launching the same programs or opening websites, associated with running from computer to computer will be replaced with a few clicks.
Limit it to the fullest
Also in the “Control Panel” there is a button “Lock Screen”. She launches a self-locking lock with an animated lock (yes, because I wanted an animated lock) and locks the screen to selected students.
Flash drives are disabled by read / media ban. Previously, the method was more radical, more correct and more effective, but it stopped working after the next update of Ubuntu. The teacher can allow students to use flash drives by selecting “Removable media” from the list.
Installing the distribution should be extremely simple
I collected all the components of the system in a repository. Now, to set up the workplace of my dreams, I need to perform three simple steps: install Kubuntu, connect the repository, command apt-get install integration-client. And so on every machine. This is long and tedious, especially when computers are 100+. Therefore, I took advantage of the wonderful distribution SystemRescueCD. It has a simple guide on rebuilding and adding scripts to autostart. Now, to install the distribution kit, you need to boot from the flash drive or disk that I prepared, select the network type (DHCP, NAT or general), specify the audience number and computer number, select the installation type: on one machine or bulk installation in the entire class (the network boot server will rise) . When all parameters are entered, the script partitions the disk through parted, mounts a directory on the samba with a pre-prepared system image, unpacks through fsarchiver to the hard drive and installs the bootloader. The whole process takes 5-10 minutes, depending on the power of the computer and the network load, and most importantly - it does not require special technical skills.
For those who have reached these lines and have six more minutes of free time, there is a presentation of the described project, full of 3D effects, which I prepared for one profile conference. Unfortunately, by naivety, I emphasized that Linux is good, and not Linux - bad, but I had to step aside from the sacred warriors and just demonstrate my achievements. But if you look with a certain amount of irony, it is quite funny.
Why couldn’t the same thing be done on the “most popular OS”?
In principle, it is possible, but much more complicated. Develop will have much more. For many tasks solved by a single line on Bash in Windows, you will have to write a full-fledged program (PowerShell in those days was not). And most importantly, to implement the described mass installation for most Windows programs legally will not work. In the text of licenses, this approach is often explicitly prohibited. And if you restrict yourself to only open source applications, then why bother with Windows? Regarding hardware compatibility, the Linux distribution looks much better. For many years of upgrades in computer classes, a zoo of motherboards, video and other cards has gathered. Ubuntu without any problems and additional settings is installed on almost all machines (taking into account the update of the installation image of the system every two years).
To the question - the quality of education has improved or worsened after the implementation of all of the above - the answer is this: nothing has changed. The quality of education, as it turned out, depends entirely on the qualifications of the teacher. However, the processes of training and maintenance of the computer park have become much more convenient, cheaper, protected and controlled.
Now many restrictions have lost relevance due to the abundance of mobile technology among students. Internet and games from educational computers are no longer needed, they are on tablets and phones. (Here’s a son / daughter, you have a tablet, study well ... Many times I saw such a scene ... What are these parents even thinking ?!)
PS Regarding the games. Quite by chance, an interesting experiment turned out. When I just deployed the first version of the system, there were no game applications available in it. A few days later, one of the teachers asked me to add at least some game. Well, I added ... chess. Have you ever seen how inflexible Conter Strike fans were playing chess with the same enthusiasm? Students gathered at the computer (unfortunately, there was no network mode), shouting, waving, playing this game!
PPS Project life here: http://sourceforge.net/p/int/code/ci/master/tree/ . Attention! There are a lot of scary student code and stupid architectural solutions, you can’t look at JS without tears at all. Maybe someday I’ll come back to this project and rewrite it as it should (dreamily).