📜 ⬆️ ⬇️

How I implemented Linux in school



The described project has been implemented and used for five years. It's time to tell how everything was and share the experience.

A long time ago I worked as a technician (something like a laboratory technician, but more narrowly specialized) in one of the educational institutions of secondary vocational education of our vast country. I watched the classes, saw how careless students and teachers treated the 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 install this software package, but we still don’t know the audience ”and on and on.
')
I was not quite happy with the state of things. It seemed to me that everything should be simpler, easier, more graceful and in general work almost by itself (familiar feeling?). As a result, an explosive mixture of youthful maximalism, student inexperience and a desire to change the world created a “perfect” picture in my head, as it should be.

Under the cut there are a lot of text with pictures, technical details, one heavy gif and 6-minute video presentation.

And 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 I was fully aware of the lack of familiar teacher programs and / or educational materials on open counterparts. As far as I knew, many implementations broke about these problems. But I thought of everything! It was necessary only to sit down, quickly write everything and universal happiness would come. Are such little things as human habits and unwillingness to learn something new can stop a meticulous student? In general, they could have stopped, but the authorities favored my enthusiasm, for which I thank him very much. While I was busy with writing my bikes, about which in our country, in the field of education, they began to struggle hard against illegal software. Here my ideas came in handy.

In addition to the purely selfish “to facilitate the work of myself,” I sincerely wanted to make studying 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, is “soap-making”. Such a transition simplifies the life of accountants and lawyers, and the attendants both ran from computer to computer and continue to run (well, maybe a little less). Actually, here is a list of problems that I set out to solve. And he 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 not anymore: the monotonous work scares me. Here the package system of installation was very useful. I assembled the package, put it in the repository, and on computers I registered an update at boot time. The repository from Ubuntu downloaded completely and placed on the local network. Some packages replaced, some added. Wrote several scripts to build packages and copy the updated repository to the server.

Now, if you need to update the software, just throw the package into the repository and restart the computers.

Beautiful, light appearance without the ability to change it


Students love to show their individuality and twist the appearance of public computers for themselves. Sometimes they get it not quite politically correct, then teachers resort in a panic, because through the pseudo-security policies of the “most popular OS”, the menu for changing wallpaper is blocked. This circumstance does not frighten students at all, they are in fact aware of what picture needs to be replaced ... And further on in the same vein. The fantasy of the younger generation and the desire to "stand out" knows no barriers. That is, did not know.

Being a KDE fan, I would love to share the joy of using this wonderful environment, but here the legendary KDE-shnaya customizability is not needed at all, so the choice fell on the window manager OpenBox and pypanel. And almost everything. Here is such a minimalism. Such a bunch worked and it turned out that Lazarus (Delphi clone) and some programs from under wine are not friendly with OpenBox.

The final version, which still works today, was built on the KWIn window manager and the tint2 panel. KWin can draw and “modern beauty” through OpenGL, and “in the old fashioned way” to work without problems on the old hardware, which at that time had a place to be.



The attentive reader has already noticed the missing component in this “desktop-description” - the desktop itself, on which icons are drawn. That's bike number one. I wrote the “desktop” myself. I had specific requirements for this component, and it is easy to write it. You only need to assign the correct X11 flags to the window, and these flags quickly look in the KDE desktop implementation (here it is, the power of open source!). My desktop was supposed to be extremely simple: to be able to display .desktop files (similar to .lnk on Windows, only text) from a specific folder and display “non-boring wallpapers” from a specific file. But he had to launch programs not independently, but via DBUS (this is such an IPC) through the “management client”, which is described below. The latest version of the desktop was rewritten using QML, and everything became quite fun and animated.

Safety and health to all computers!


Many students and teachers relate to these concepts according to the principle “not mine is not a pity”. Such an attitude of users is extremely frustrating for service personnel. I thought a little and made “student terminals” of student machines returning to their original state when a user changes or restarts. This was done using a regular bash script that cleans up home and tmp. Simple and effective.

Your data everywhere or our personal cloud


If you just erase all student work and force them to do it all over again ... That would be awesome! Probably, the speed and quality of their work would greatly increase, and by the second course 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 filesystem. Posted She worked for a while, but then I got tired of messing with her. I wrote a script on the bash, which, when the user exits, selectively compresses files from the home directory and throws it to the server via rsync, and at the entrance loads and unpacks. Side effect: students are no longer tied to specific computers and classrooms. Hooray!



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 series is also periodically updated without the knowledge of the staff responsible for the legality of the established programs.

To begin with, I approached the solution of this question classically: everyone will work from under a limited account. That's all, both students and teachers from under one ordinary account, instituted on all machines. This, as well as the self-deleting data, and Linux itself, make the installation of third-party unapproved software difficult.

Whips without gingerbread can not be introduced


Now you can limit everything and everyone and feel like a real villain. But there was no such task, so it was necessary to do something nice ... First, the teachers and the educational process. For the sake of this good purpose, I wrote the "Control Panel" computer class. Why write your own when there are already some good and even open solutions? I wanted a web interface. It's so great to go from any computer (smartphone, tablet) and drive a computer class. And the teacher is not tied to a specific machine.



The "control panel" is a server that receives a command from the web interface and sends it to all selected computers. I combined the HTTP and IPC network server in one program (now I wouldn’t do that, it’s not scalable at all) for the convenience of event handling and shared memory.

I installed the client for the server on all Linux machines. The client connects to the server when the computer is turned on and waits for commands. Most commands just run bash scripts.

Student focus


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 logins and passwords and see an empty desktop. The teacher sits 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 checking the checkboxes, the programs that the teacher needs for the class are selected. Icons of the programs chosen by the teacher appear on the students' desktops. Now students can start the programs by clicking on the icons, or the teacher himself can start the necessary programs on all or on the students' computers from her computer.



This magic works as follows. The server sends the "set application_name" command 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 lists the packages for installation, the main files and directories of the application, etc.

When the desktop file loads, the client will try to install the packages listed in it and set the read / launch permissions for the specified application files. If the teacher decides that there are enough students to work with one of the allowed programs, he removes the tick in the “Control Panel”. Clients receive the “delete application_name” command, the program is closed, the desktop file is deleted, read and execute permissions are removed from the specified files. Installed packages remain intact. Reinstall every time too expensive.

While the program is installed and configured, a semitransparent application icon bounces cheerfully on the desktop.
When a new interesting program comes out, I throw the package into the repository, and a program available for selection by the teacher appears on the desktop file and in the Control Panel.

Supervision of work


Student machines once every few seconds, send a reduced screenshot of the desktop to the server. This picture is shown to the teacher in the “Control Panel”. But this is not enough. All competitive solutions are able to watch and control a remote desktop. And 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 distribution slowed down a lot when 25 screens were connected, and even at 10 it was already uncomfortable. Saved the position TurboVNC, which showed acceptable performance. I added two more buttons to the “Control Panel”: “View desktop (and manage)” and “Show selected to all”. When you press, the command goes to the server “Show computer X to computers Y1..Yn”, and the server already indicates to whom to launch the VNC server, and to whom the viewers, the control panel is a usual web page and it’s difficult to communicate directly with other computers.

Internet restriction


When students see a browser, thoughts about studying leave and tabs justify social networks and other non-learning entertainment resources. Well, okay, back to the dictatorial measures and introduce white lists. Just let the teachers run them. They want, let everything be allowed, but it is necessary, so indicate the allowed addresses. Added another button in the "Control Panel". When clicked, a dialog opens where you can add a URL.



These sites are stored in the teacher profile, and are available in the list of programs from which they are easily assigned to students by checking the box. When assigning a URL to selected computers, a command comes in: add the specified address to the list of allowed ones and reconfigure the tiniproxy installed on each machine.

The structure of 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 work incorrectly. Therefore. when the “add allowed URL” command comes, the site is downloaded, parsed, links to scripts, styles and images are removed from it and added to the allowed ones. It works not always correctly, but it's better than nothing.

Some applications need access to certain sites to work correctly. For such cases, in the desktop file, I added a parameter listing sites. When the teacher selects the application, the sites specified for it are automatically resolved. If all or some students need to be allowed full access, the teacher selects “Full Internet access” in the list and the restrictions are removed.

Examine operating systems or virtual machines


At first, when I started all this, I reassured the teachers with the presence of the “most popular XP OS” in the virtual machine. Looking ahead, I will say that this option is no longer available and we have it smoothly, not without stress, but the environment has been 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 entire system - I do it once and replicate for everyone. In the “Control Panel”, the section with applications is now listed with FreeDOS (do not ask why), and ReactOS, and the same Ubuntu Linux with root access. These pseudo-applications launch a script that loads a virtual machine image from the server and puts it into the cache. If the image has not changed and is already in the cache, it will not be re-downloaded. 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.

What about Gnome and KDE?


Teachers want to show students different "working environments", they say, there is not only one Start button (which is, it does not exist). At first, I followed a simple path and prepared several virtual machines with Linux: one for KDE, the other for Gnome. But in this mode, these demanding environments worked very unhurriedly. And when I had a free minute, I wrote scripts that “just” launch 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. Quick and convenient!

Anonymous login


In computer labs sometimes events with third-party participants (presentations, courses, competitions, etc.) take place. To create a login and password for each of the guests is not interesting, so the panel has an “Anonymous Login” button. This is a very convenient and important button! Clicking on it will open on selected computers a clean desktop without a single icon. If you then select everything in the “control panel” from the list and click “to start the tedious process of launching the same programs or opening sites, it will be replaced with a few clicks.

Limit it to the full


Also in the “Control Panel” there is a “Lock Screen” button. She launches a self-signed blocker with an animated lock (yes, because I wanted an animated lock) and locks the screen to selected students.



Flash drives are disabled by prohibiting reading / media. Previously, the method was more radical, more correct and more efficient, but it stopped working after the next update of Ubuntu. The teacher may allow students to use flash drives by selecting “Removable Media” in the list.

Installation of the distribution should be very simple


All the components of the system I collected in the repository. Now, to set up the workplace of my dreams, you need to perform three simple steps: install Kubuntu, connect the repository, command apt-get install integration-client. And so on each machine. This is long and tedious, especially when computers are 100+. Therefore, I took advantage of the wonderful distribution SystemResueCD. He has a simple guide for rebuilding and adding scripts to autorun. Now to install the distribution, you need to boot from the flash drives or disk I have prepared, select the type of network (DHCP, NAT or general), specify the audience number and computer number, select the installation type: on one machine or mass installation in the whole class (the network boot server will rise) . When all parameters are entered, the script marks the disk through parted, mounts the directory with the system’s pre-prepared image on the samba, unpacks it to the hard disk via fsarchiver and installs the bootloader. The whole process takes 5-10 minutes depending on the computer's power and network load, and, most importantly, it does not require special technical skills.



For those who have reached these lines and have another six minutes of free time, there is a presentation of the project described that is full of 3D effects, which I prepared for one specialized conference. Unfortunately, naively, I emphasized that Linux is good, and not Linux is bad, but I had to step back from the sacred warrior and just showcase my work. But if you look with a certain amount of irony, it is quite funny.



Why it was impossible to do the same thing on the "most popular OS"?


In principle, it is possible, but much more complicated. Will have to develop a lot more. For many tasks solved in a single line on Bash, Windows will have to write a full-fledged program (PowerShell was not in those days). And the most important thing is to implement the described mass installation for most Windows programs legally fail. In the text of licenses, this approach is often explicitly prohibited. And if we confine ourselves only to open source applications, then why even Windows? Regarding compatibility with hardware, the Linux distribution looks much better. For many years, upgrades in computer classrooms gathered a zoo of motherboards, videos and other cards. Ubuntu without problems and additional settings is put on almost all machines (taking into account the update of the installation image of the system every two years). Installing a class on Windows and that would all work immediately - this is a very rare case, and you have to do it on duty over each machine separately.

findings


To the question whether the quality of education has improved or deteriorated after the implementation of all 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 training and maintenance processes of the computer park have become much more convenient, cheap, 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 to you tablet, study well ... I've seen such a scene many times ... What are these parents thinking at all ?!)

PS About the games. Quite by chance it turned out to be an interesting experiment. When I just deployed the first version of the system, there were no available gaming applications 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 recently, adamant Conter Strike fans played chess with the same enthusiasm? Students gathered at the computer (unfortunately, there was no network mode), shouted, waved their hands while playing this game!

PPS Developments for the project here: http://sourceforge.net/p/int/code/ci/master/tree/ . Attention! A lot of scary student code and stupid architectural solutions, JS cannot be looked at without tears. Maybe someday I will still return to this project and rewrite it as it should (dreamily).

Source: https://habr.com/ru/post/239519/


All Articles