Automatically enabling numlock in an X11 session, *without* a window manager

I just spent a whole day on this, so I wanted to share it with some people who would understand the struggle. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The Scenario:You have some remote users who need to securely access your application, delivered in plaintext over SSH. To do this, they get a thin client delivered to them, fully set up. However, most of these users have very limited computer knowledge, so they need the application to be as simple and responsive as possible. The Solution: The thin client needn’t have Windows on it. Also Windows is slow (wimpy thin clients), prone to fickleness (“have you tried turning it off and on again?”), and insecure (no antivirus or even security updates are installed on the thin clients). In fact, these users are so limited they shouldn’t even have a window manager at all. No need to resize, copy & paste, or multitask – a single application window would be ample. So let’s install just a plain edition of Debian, then run sudo apt-get install xinit, to get the barest of essential graphical libraries. The Challenge: Set up our thin clients, based on a Linux install, such that it boots quietly and quickly, automatically logs in as the user, waits for the network, and launches a Putty window. When the user quits Putty, they should only have two options: launch a new Putty session, or shutdown the computer. The Yak: Because there’s no window manager, every Putty window is launched in its’ own session. A new X11 session has number lock disabled by default. The standard answer for controlling numlock, a program named “numlockx”, works just fine – however, because there’s no window manager, you can only send a single command to the X11 session. Thus, you can *either* turn on NumLock, *or *you can launch Putty. Shaving the Yak: 1) Create the file ~/putty This file contains the lines: numlockx on & putty -load {your saved session} 2) Launch the file with: xinit ~/putty $* -- The End: Now you can set up your silent boot (/etc/sysctl.conf -> kernel.printk), your automatic login (/etc/system/system/getty(a)tty1.service.d/autologin.conf), and your auto-start locked-down profile (~/.profile) with other tutorials available on the internet. (PS they boot in about ten seconds, and our guinea pig testers love them) Eric

On Thu, 9 Jul 2015 16:34:02 +1200, Eric Light wrote:
... however, because there’s no window manager, you can only send a single command to the X11 session.
Remember that, on a command-line system, “only one command” is like “only granted one wish”. What do you wish for? More wishes, of course. ;)

Haha that's a pretty good synopsis, Lawrence One of the biggest things was figuring out how to use numlockx from the CLI to start with. Once I got that working with the xinit session it was only a little more playing around. But getting to that point was a nightmare. None of the guides I found online even came close to doing the trick. Eric -------------------------------------------- Q: Why is this email five sentences or less? A: http://five.sentenc.es On Thu, Jul 9, 2015 at 4:59 PM, Lawrence D'Oliveiro <ldo(a)geek-central.gen.nz
wrote:
On Thu, 9 Jul 2015 16:34:02 +1200, Eric Light wrote:
... however, because there’s no window manager, you can only send a single command to the X11 session.
Remember that, on a command-line system, “only one command” is like “only granted one wish”. What do you wish for? More wishes, of course. ;) _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

On Thu, 9 Jul 2015 17:14:38 +1200, Eric Light wrote:
One of the biggest things was figuring out how to use numlockx from the CLI to start with. Once I got that working with the xinit session it was only a little more playing around.
But getting to that point was a nightmare. None of the guides I found online even came close to doing the trick.
Here are the first two things I tried, a minute ago: root(a)theon:~ # man -k numlock numlock: nothing appropriate. root(a)theon:~ # apt-cache search numlock gkrellm-leds - Keyboard LED monitor for GKrellM numlockx - enable NumLock in X11 sessions

I'm not sure what your point is, Lawrence? Knowing that numlockx exists wasn't the problem; it's certainly the top result on Google. My post was regarding using it in this situation, which I assure you was more difficult than just finding the name of a well-known application. E On Thu, 9 Jul 2015 17:14:38 +1200, Eric Light wrote:
One of the biggest things was figuring out how to use numlockx from the CLI to start with. Once I got that working with the xinit session it was only a little more playing around.
But getting to that point was a nightmare. None of the guides I found online even came close to doing the trick.
Here are the first two things I tried, a minute ago: root(a)theon:~ # man -k numlock numlock: nothing appropriate. root(a)theon:~ # apt-cache search numlock gkrellm-leds - Keyboard LED monitor for GKrellM numlockx - enable NumLock in X11 sessions _______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

Hi Eric, With regard to thin-client solutions then I wonder if you are aware of the Linux Terminal Server Project. http://www.ltsp.org/ Here is the wiki... https://en.wikipedia.org/wiki/Linux_Terminal_Server_Project The performance of the network to the remote clients would be the major factor in how to implement LTSP. If the network performance is poor then, since LTSP V5, there is support for "fat" clients, so it should still be possible for a client to boot in, say, 10 seconds. I've got some old thin client PC's if you'd like to use them to experiment with LTSP. cheers, Ian.

Hi Ian! Thanks for the suggestion. I had actually done some experimentation with LTSP a few months ago, but opted not to use it in this situation. Part of the reason I chose not to use it here was the specific desire to not have a window manager, combined with our (but maybe not permanent) requirement to use Putty instead of any other/better/native SSH terminal emulator. That said, I'm seriously considering it for some internal thin clients - that's a longer term plan though :-) What type of thin client do you have spare? E On 9/07/2015 9:56 pm, "Ian Stewart" <ianstewart56(a)hotmail.com> wrote:
Hi Eric,
With regard to thin-client solutions then I wonder if you are aware of the Linux Terminal Server Project.
Here is the wiki...
https://en.wikipedia.org/wiki/Linux_Terminal_Server_Project
The performance of the network to the remote clients would be the major factor in how to implement LTSP. If the network performance is poor then, since LTSP V5, there is support for "fat" clients, so it should still be possible for a client to boot in, say, 10 seconds.
I've got some old thin client PC's if you'd like to use them to experiment with LTSP.
cheers, Ian.
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug

Hi Eric (...and anyone else interested in LTSP thin clients),
What type of thin client do you have spare?
If anyone would like to have a play with thin client PC's, then I have a couple of HP T5735's. HP Quickspecs. For local booting they came with Debian Linux 4.0 with Kernel 2.6, so they are from around 2007. The BIOS supports PXE booting to so they can download their OS and applications image from a Linux Terminal Server (LTSP). Possibly the easiest way to set up an LTSP server is to use the Edubuntu distro. These thin clients will then boot an i386 OS image from the server. However these days for a thin-client you might be better off to buy a LCD display with an HDMI input and bolt a Raspberry Pi to it. The Raspberry Pi can be setup to boot from the LTSP server. There was a Raspi-LTSP project which has evolved and become the PiNet project. I like the way they used the Motorola lapdock 100's as the human interface for the Raspberry Pi. cheers, Ian. PS: If you'd like an 84 page guide to LTSP

Hi Eric (...and anyone else interested in LTSP thin clients),
What type of thin client do you have spare?
If anyone would like to have a play with thin client PC's, then I have a couple of HP T5735's. HP Quickspecs.
For local booting they came with Debian Linux 4.0 with Kernel 2.6, so they are from around 2007.
The BIOS supports PXE booting to so they can download their OS and applications image from a Linux Terminal Server (LTSP).
Possibly the easiest way to set up an LTSP server is to use the Edubuntu distro. These thin clients will then boot an i386 OS image from the server.
However these days for a thin-client you might be better off to buy a LCD display with an HDMI input and bolt a Raspberry Pi to it. The Raspberry Pi can be setup to boot from the LTSP server. There was a Raspi-LTSP project which has evolved and become the PiNet project. I like the way they used the Motorola lapdock 100's as the human interface for the Raspberry Pi.
cheers, Ian.
PS: If you'd like an 84 page guide to LTSP
Here's an idea, Ian. Would you mind showing off a working setup of LTSP at the next meeting? Then we can discuss setup issues and other such things. Cheers, Peter

Hi Peter,
Would you mind showing off a working setup of LTSP at the next meeting?
Yeah that's fine with me. For LTSP clients I could demo an HP T5735 PC and a laptop PC, but I don't have a Raspberry Pi. It would be good if someone could bring along a Raspberry Pi, keyboard and mouse then that should be enough bits to demo it as a LTSP client. The Raspberry Pi's output can plug into the video projector, but if you have a small HDMI monitor that's easy enough to bring along, then that's even better. I'd need to prepare a SDcard for the Raspberry Pi to be able to boot into the LTSP server. From what I recollect I'd need the Raspberry Pi's MAC address in advance in order to prepare the LTSP server. cheers, Ian.

On 11/07/2015 11:55 AM, "Ian Stewart" <ianstewart56(a)hotmail.com> wrote:
Hi Peter,
Would you mind showing off a working setup of LTSP at the next meeting?
Yeah that's fine with me.
For LTSP clients I could demo an HP T5735 PC and a laptop PC, but I don't
have a Raspberry Pi.
It would be good if someone could bring along a Raspberry Pi, keyboard
and mouse then that should be enough bits to demo it as a LTSP client. The Raspberry Pi's output can plug into the video projector, but if you have a small HDMI monitor that's easy enough to bring along, then that's even better. I'd need to prepare a SDcard for the Raspberry Pi to be able to boot into the LTSP server. From what I recollect I'd need the Raspberry Pi's MAC address in advance in order to prepare the LTSP server.
cheers, Ian.
Hi Ian, I can bring along my pi2 along with hdmi 2 vga converter. Pi works plugging into projector (did it this week at Hamilton computer club) Cheers, William

Would you mind showing off a working setup of LTSP at the next meeting?
Yeah that's fine with me.
For LTSP clients I could demo an HP T5735 PC and a laptop PC, but I don't have a Raspberry Pi.
It would be good if someone could bring along a Raspberry Pi, keyboard and mouse then that should be enough bits to demo it as a LTSP client. The Raspberry Pi's output can plug into the video projector, but if you have a small HDMI monitor that's easy enough to bring along, then that's even better. I'd need to prepare a SDcard for the Raspberry Pi to be able to boot into the LTSP server. From what I recollect I'd need the Raspberry Pi's MAC address in advance in order to prepare the LTSP server.
cheers, Ian.
Hi Ian, I can bring along my pi2 along with hdmi 2 vga converter. Pi works plugging into projector (did it this week at Hamilton computer club)
Great stuff, guys. I've scheduled a new meeting: http://www.meetup.com/WaikatoLinuxUsersGroup/events/223850397/ Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 858-5174 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/

Hi William,
I can bring along my pi2 along with hdmi 2 vga converter.
That would be great. Any chance you can e-mail to me its MAC address? Many thanks, Ian. PS: In one of my previous e-mail's a link the to PiNet is broken. The following is the link to the PiNet web-page... https://www.raspberrypi.org/raspi-ltsp-is-now-pinet/ ...scroll down and the first photo is of some Raspberry Pi's connected to Motorola lapdocks
participants (5)
-
Eric Light
-
Ian Stewart
-
Lawrence D'Oliveiro
-
Peter Reutemann
-
William Mckee