Diskless Linux X Terminals

How to network-boot a Linux box that has no persistent storage and use it as a diskless X terminal.

The X terminal is not a new idea; companies such as NCD have been manufacturing them for 15 years or more. The thin client idea fell out of fashion during the late 1990s, however, as the price of PC hardware fell so low that there was no obvious cost advantage to using X terminals. Heated arguments ensued over the total cost of ownership (including both the cost of the hardware and administrative support) of thin clients vs. PCs, and the debate will not be resolved by this article. The objective here is simply to describe a technique that allows one to utilize some of the growing pile of obsolete hardware left in the wake of advancing PC technology to build X terminals.

The essential characteristic of any thin client is that it should have little or no persistent storage. Typically, a purpose-built X terminal has a small quantity of NVRAM used to store configuration options and nothing else. In practice, it usually is possible to put even these options in a configuration file stored on the server and downloaded by the terminal on boot. This article takes the purist view that an X terminal should have no persistent storage whatsoever.

PXE Booting

The PC has no hard, floppy or CD-ROM drive, so some other device must provide the bootloader and bootable image. X terminals are creatures of the network they inhabit, so the obvious choice is the network interface card (NIC). The NIC, therefore, must identify itself to the BIOS as a bootable device. If chosen, it must be able to download the bootloader from the network. This is not something most run-of-the-mill NICs can do. However, a standard for NIC boot ROMs called PXE (Preboot eXecution Environment, pronounced pixie) has been published by Intel and implemented by that company as well as by some other vendors in some products. Many newer motherboards with built-in Ethernet have PXE support.

In preparing this article, I tested five different kinds of NICs, all of which were advertised to support PXE: the Intel PRO/100+ (PILA8460BNG1), the 3Com 3C905CX-TX-M, the D-Link DFE-550TX, the Linksys LNE100TX and the SMC 1255TX (Tulip chipset). Of these five, only the 3Com card worked right out of the box. I was able to get a boot ROM separately for the SMC card, after which it also worked. The other three cards all had conspicuous but vacant sockets for boot ROMs, which were not shipped by default. Caveat emptor.

When the PXE NIC is chosen by the motherboard BIOS as the boot device, it broadcasts DHCP requests on the LAN and looks for PXE extensions in the responses it receives. If it receives a response containing some of these extensions, it then acknowledges and accepts the response. In particular, it respects the next-server and filename parameters in the server's response. These parameters specify the IP address of a TFTP server and the name of the file containing a bootloader that the client should download and start.

DHCP and TFTP

The Internet Software Consortium's version 3.0 DHCP server can be configured to advertise PXE extensions, and it is the DHCP server shipped with a number of Linux distributions, including Red Hat 8.0 and later versions. Listing 1 is an example of a DHCP server configuration file, dhcpd.conf, that generates DHCP responses with PXE extensions when the DHCP client identifies itself as a PXE NIC. With this configuration, the client downloads the file pxelinux.0 from the TFTP server, located at 192.168.1.1. Table 1 lists the options set in the configuration file.

Table 1. Definitions of PXE-Specific Codes in dhcpd.conf

CodeMeaning
1Multicast IP address of boot file server.
2UDP port that client should monitor for MTFTP responses.
3UDP port that MTFTP servers are using to listen for MTFTP requests.
4Number of seconds a client must listen for activity before trying to start a new MTFTP transfer.
5Number of seconds a client must listen before trying to restart an MTFTP transfer.

Obviously, the server at 192.168.1.1 must be configured to provide the TFTP service. It also must have a bootloader image called pxelinux.0, where the TFTP server process looks for it (usually in the directory /tftpboot). The TFTP server process usually is managed by one of the superservers, inetd or xinetd, so turning it on means messing around with one of their configuration files (/etc/inetd.conf or /etc/xinetd.conf, respectively).

The file pxelinux.0 is a bootloader that comes from H. Peter Anvin's SYSLINUX Project. Unlike generic bootloaders, such as LILO or GRUB, PXELINUX understands the PXE protocol and has the necessary networking functionality to pick up the boot process at this point by downloading the kernel and compressed RAM disk using TFTP. However, PXELINUX requires an enhanced TFTP server, one that understands the TSIZE option (RFC 2349). Fortunately, H. Peter Anvin also provides a modified version of the standard BSD TFTP dæmon, called tftp-hpa, that does support this option. The easiest thing to do is to replace the standard TFTP dæmon, often located at /usr/sbin/in.tftpd, with tftp-hpa.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Symbio Technologies' LTSP based diskless thin client solution

Diane Romm's picture

Readers who are interested in Linux-based diskless thin client technology should find the products of our company, Symbio Technologies, very compelling.

We offer a complete solution, based on LTSP, that can replace the PC on the desktop with low powered network terminals. We call the solution The Symbiont Solution. It includes:

1. The Symbiont Management Suite: Server based software that makes it easy to setup, configure, manage, and control a network comprised of diskless network terminals.

2. The Symbiont Boot Appliance: A device that boots the network terminals, directs them to the appropriate application server(s), and offers Internet-based access to setup, configure, manage and control the network. The SBA takes the place of a boot server and enables the efficient consolidation, management, and control of application servers.

3. Network terminals: These energy efficient units have no moving parts including no hard drives, no floppy drives, and no fans. They are guaranteed to work perfectly with our management suite and boot appliance.

Diskless Linux X Terminals and LTSP

stern's picture

Thanks Chip for a great article. It motivated me to do something usefull. I'm setting up a diskless machine for a friend which will boot off her partner's linux pc. She doesn't have enough disk to
setup a stand alone machine. I may not use pxe but expect to use etherboot via a floppy.

I think it a real shame that the "Diskless Linux X Terminal" article made no mention of the Linux Terminal Server Project! I followed the article and links and found it frustrating. (using SuSE 9.2) I downloaded the latest LTSP (www.ltsp.org) and had it all working in an
hour. The hardest part being getting the xdmcp to work. I would have found something explaining the differences between bootp, etherboot, and pxe really helpfull. Again the LTSP is very good at explaining this.

In the end I feel that as good as it was, the article had the
potential to be much better.

John Stern
Linux Specialist
RHCE

NVRAM? (I actually do need it....)

mhoskins's picture

I liked your article, however, I am one of the few, the proud, who need NVRAM information:

The essential characteristic of any thin client is that it should have little or no persistent storage. Typically, a purpose-built X terminal has a small quantity of NVRAM used to store configuration options and nothing else. In practice, it usually is possible to put even these options in a configuration file stored on the server and downloaded by the terminal on boot. This article takes the purist view that an X terminal should have no persistent storage whatsoever.

I need to save some bootup settings there, such as monitor settings, kernel params, etc., in a situation that I do *not* have a managed thin-client situation.

I have a customer who does *not* want this saved on a server, but who wants to boot through CD's -- no hard disk drives, no flash, no boot ROMs or PXES, no floppies, etc.! Only whatever-else-is-part-of-a-bare-machine and CD-R's are allowed, here....

I also have a great deal of hardware configs, from P-90's to P4-2.5GHz machines, and a wide range of video cards and monitors....

Unfortunately, I have found virtually no information for /dev/nvram. I have done several Google searches, but perhaps I'm not using the correct search criteria.

Can anybody help, here?

You really want to check out

Alex S.'s picture

You really want to check out the "A Temporary Internet Lounge" article in the same issue - build your Knoppix disk to contain the stuff you want and not the stuff you don't.

Re: NVRAM? (I actually do need it....)

mhoskins (cannot login)'s picture

I have built several custom Knoppix and Morphix (and BeatrIX) CD's over the last year and a half, or so. This is precisely why I need to save my settings somewhere. (I read the "Internet Lounge" article ahwile ago, as well.)

All I have in my customer's machines is CD-R media and I just need a place to hold a few bytes for settings. This is a unique situation where I have no hard disk, no USB device, and I can't save to/load from a server.

Saving it in NVRAM would be ideal. I need maybe 20-30 bytes, or so, but I've heard that NVRAM can do 64-128 bytes, perhaps higher.

Can anybody help?

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix