Seeds for Change - support for Social Sector Organisations

Linux X-Terminals - or how to use those old computers

X-terminals are computers that fetch all their data and programmes over the network from one or more central servers. The way this works is that you have one decent computer with all the programmes your group may need, and then all other computers can be slow old machines (486's or Pentium1's). These machines do minimal work (take input from keyboard and mouse, send it to the main computer (the server), receive info back and put it on the screen).

This means obsolete computers can be used, and is an excellent, easy and extremely cheap way of providing up to date software and fast internet access to users (typical cost - one fairly new machine [ free to as much as you want to pay ], as many old Pentium1's as you have users [ free to £100 each ], ethernet cabling [ about £1 per metre ], ethernet cards [ generally free second hand ] and a hub [ free to £50 ]. Compare this to the cost of providing one fairly new machine per user (plus a hub and cabling and ethernet cards) if you chose to run MS Windows).

Older computers find a new lease of life when used as a terminal for an application and file server. In this way the user can get the benefit of the speed and capacity of the server, but doesn't have to be physically sitting at the server, and several people can be using the same server. This is a simple, but extremely cheap and efficient way of using hardware.

I'd recommend a fairly new machine for the server (Pentium III or above, but anything that you're happy to use will do really), and as many Pentium Is as you have users, with all computers being able to connect through a working network.

386's and 486's will also work perfectly well as terminal servers, but you're more likely to be able to get graphics cards with more than 1Mb RAM for Pentiums - this helps a lot when you're running something big like OpenOffice or manipulating images.

How many terminals you can run off one server depends on what software you are running, and how powerful your server is. Generally a 1000MHz computer will comfortably serve between 10 and 40 terminals using fairly heavy software like OpenOffice and KDE.

If you're running more than a few X-terminals then you're likely to get network congestion (ie your network slows down so much you can't work very much). One way round this is to have a 100Mb connection from your server to your hub (which obviously has to be able to deal with 100Mb), the connections to the X-terminals can be 10Mb.

If you're not currently using Linux have a look at Linux - what and how? and Low Cost Computing for information about getting started with Linux.

In true Linux style there are lots of different ways of doing X-terminals / Thin-Clients. Below is described the way we use, but if you prefer to use terminals without hard-drives check out LWN's diskless Terminals distribution list - (Thinstation looks good).

back to top

Setting up the Server

Install Linux normally on your server, add all the programmes, users etc that you'll need. When asked during setup choose a graphical login (i.e. xdm, gdm or KDM), but not autologin (ie one user gets logged in automatically when you switch on).

Choose network addresses for all your computers. For this example we'll be using 192.168.1.1 for the server.

Find the file Xaccess - typically to be found in /etc/X11/xdm/
Open it up in your favourite editor and look for:

#*                 #any host can get a login window

uncomment this line (remove the #)
You can also put an (or range of) IP address in instead of the *: e.g:

192.168.1.*                #any host can get a login window

If you are using XF86 version 4.0 or above then edit xdm-config (in the same directory as Xaccess). Look for:

! DisplayManager.requestPort:   0

and make sure that it is commented out with an exclamation mark "!"

If you use xdm as a login manager then you should be finished with the server now. If however you are using the Gnome Login Manager (GDM) you will need to find the gdm.conf file (try /etc/X11/gdm/gdm.conf).
If you're using the KDE Login Manager (KDM) you will need to find the kdmrc file (try /usr/share/config/kde/kdmrc, /usr/share/config/kdm/kdmrc or /etc/X11/xdm). Once you've found it, look for the section

[xdmcp]

and make sure that in that section:

enable=true

or

enable=1

and NOT

enable=false

or

enable=0

At this point it's easier to restart the whole computer than try to workout which services should be restarted to get things going. So go ahead and reboot.

back to top

Setting up the Terminals

Now configure the the terminals so that they don't boot into the graphical interface. If you're putting a new installation on them then you'll only need X (no window managers needed, but feel free to put them on if you have room) and the basic system.

Make sure X isn't running, and on the commandline try:

X -query 192.168.1.1

You should get X-windows starting and the login manager coming up...

If you're looking at the login manager then congratulations - that's it. You may want the terminals to boot into this stage automatically, in which case you can add

X -query 192.168.1.1

to your /etc/rc.local (RedHat, Mandrake and co.) or make a script for it to start at whatever runlevel (Debian).

Another thing you can do is change the ctrl-alt-del function to shutdown instead of restart:

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

change this to:

ca::ctrlaltdel:/sbin/shutdown -t3 -h now

Now terminals can be shutdown by first doing ctrl-alt-backspace (to kill X), then with ctrl-alt-delete. If you don't change this users will have to logon to the terminal itself in order to close it down (or of course do ctrl-alt-del and switch the computer off manually when it starts to reboot).

Troubleshooting

If it doesn't work for you, here's some things to check:

  • Is the network working - can the computers ping each other?
  • Are the firewall or security scripts interfering? Try turning them off (after disconnecting from the internet!)
  • Is your terminal already running X before you issue the X -query 192.168.1.1 command? Try one or more of the following: type "init 3", "service dm stop" (in a Mandrake system above 9.1) or "/etc/init.d/kdm restart" (replace kdm with gdm and xdm if you are running another manager) or "killall X" as root and try X-query again.
  • Check that the terminals are listed in the server's /etc/hosts file, and vice versa.
  • Is your server up and running X with a login manager (KDM, GDM or XDM?
  • We've experienced problems when both the X-terminals and the server are running XFree86 version 4. You can tell that the problem lies with the MIT-Magic-Cookie, (which is a security measure) because the X-terminal will complain about it when it gives up trying to X -query. There are ways around the problem most of which seem a bit complicated, and difficult to automate.
    If you suspect you have this problem then first of all check you've got the MIT-cookie-problem by having a look at your error message when X -query gives up. If you get that, and your X-terminal is running version 4 of XFree86 (check by typing "locate XF86" - if you get /etc/X11/XF86Config-4 (note the -4 on the end) then you're running version 4) and you should try some of the following:
    • First try a different login manager (choose from KDM, gdm and xdm).
    • Downgrade your XFree86 to the 3 series (uninstall XFree86, then reinstall, but choosing XFree86-3.x). This won't work too well if you have new cards like NVIDIA, but for older cards it should be fine.
    • Failing that, re-installing (!) the X-terminal sometimes helps - this a completely over the top solution, there must be a better way of doing it, but if it works...
    • Just for the sake of completeness - the 'official' way of dealing with this is to mount the home directory using NFS. The MIT-magic-cookie is set in a user's home directory, and X will only work if the right cookie is found there. So by mounting the home directory, the server is able to both place and read the cookie in the right place, and everything is hunkydory. You can use this method (the Linux Terminal Server Project do it this way), but we find it overkill in this scenario, since we don't need any data to be held on the X-terminal, so don't see the need to remotely mount /home.
    If you have experience of this problem, and have found another way round it, please let us know!

If the terminals screen is choppy (heavy programmes like OpenOffice don't scroll smoothly, things seem jerky on the screen) then try a different video card in the terminal. A video card with 2Mb RAM should do the job fine - ask your local computer dealer for old cards (and make sure you know whether you need ISA or PCI - or even AGP).

back to top

Other ways of doing it

LTSP - If you are wanting to set up a dedicated network running in this way then have a look at the Linux Terminal Server Project which will set up this kind of system out of the box - and is a much better way of doing it if you can boot from your ethernet card..

  • This is a simple guide to setting up a basic LTSP system.
  • If you really want to get technical, have a look at the Embedded Terminal Server HowTo which explores clustering, server redundancy and soft failover (!)

Using several video cards and USB mice and keyboards you can have several users physically using the same machine - a tutorial is available at Linux Gazette

an interesting way of doing this using thin-clients and VNC is described in this article.
... and absolutely loads of interesting links explaining how to do remote boots, thin terminals, thick (fat) terminals, PXE, BOOTP......
ThinTux is a project for setting up X-terminals using floppy, CD, hard-drive, USB pen drive, DOC or DOM to boot the client.
the XDMCP-HowTo. More or less the same as described above, but with a lot more detail.
A nice article on using Debian based X-terminals with several X-servers using Chooser. By using Chooser you can link more than one server into the network to improve performance or increase the number of terminals.
This company uses X-terminals, and this is a detailed description of their experiences
How to have two screens,two keyboards and two mice on one computer. A little outdated, but should still work...
This way needs various commands typed in on the server and the client:

Client means the computer that will be the terminal (we're using the IP 192.168.1.2 for the client - change if necessary),
Server is the big computer where the programmes will run (we're using the IP 192.168.1.1 - change if necessary).

1.On the Client type: xhost +192.168.1.1

2.On the Client type: telnet 192.168.1.1

or 2. If you have telnet switched off (which you probably should have), use ssh: ssh 192.168.1.1 (and type your password for the server)

3.On the Server type: DISPLAY=192.168.1.2:0

4.On the Server type: export DISPLAY=192.168.1.2:0

5.On the Server type: xhost +192.168.1.1
back to top







Seeds for Change: a non-profit activist training co-op