Kenneth Finnegan Gives Thin-Client Boxes a New Lease on Life By Booting Linux Over HTTP and Into RAM

With a small pile of thin-client systems and a desire to learn more about the Linux boot process, Finnegan's netboot approach is smart.

Gareth Halfacree
4 years ago β€’ HW101
A 1GB internal SSD isn't much - but it's more than enough for an iPXE environment. (πŸ“·: Kenneth Finnegan)

Booting a thin-client system over a network is a problem long solved, but when Kenneth Finnegan came into ownership of a selection of Dell FX160 machines he turned to a somewhat unusual approach: Booting Linux over the HyperText Transfer Protocol (HTTP) and running it purely from RAM.

"A couple years ago, one of my friends gave me a big pile of little Dell FX160 thin clients, which are cute little computers which have low power Atom 230 processors in them with the ability to support 3GB of RAM," Finnegan writes. "Being thin clients means they were originally meant to be diskless nodes that could boot a remote desktop application to essentially act as remote graphical consoles to applications running on a beefier server somewhere else.

"Fast forward to this year, and thanks to one of their network engineers hearing my interview for On the Metal, I've been working with Gandi.net to help deploy one of their DNS anycast nodes in Fremont as part of the Fremont Cabal Internet Exchange. The thing is, how they designed their anycast DNS nodes is awesome! They have a 10,000 foot view blog post about it, but the tl;dr is that they don't deploy their remote DNS nodes with an OS image on them. Each server gets deployed with a USB key plugged into them with a custom build of iPXE, which gives the server enough smarts to, over authenticated HTTPS, download the OS image for their central servers and run the service entirely from RAM."

Faced with only a conceptual overview of Gandi's approach, Finnegan decided to attempt to replicate it himself. "I'm trying to do something exceedingly weird here," he explains, "where there are no additional file systems to mount while the system is booting. There's plenty of guides available on booting Linux with an NFS or iSCSI root file system, but I'm looking at even less than that; I want the entire system just running from local RAM."

Finnegan's blog post then walks through his process of understanding the Linux boot process, generating a custom initial RAM disk (initrd), and convincing the thin client systems to download the result from an HTTP server via iPXE. "Given this custom iPXE ROM," he explains, "I manually booted a live Linux image on the thin client, used dd to write the ROM to /dev/sda which is the internal 1G SSD, and the box is ready to go!

"Now, when I power on the box, the BIOS sees that the internal 1G SSD is bootable, so it boots that, which is iPXE, which runs the embedded script we handed it, which configures the network interface, downloads our custom initrd file and the Linux kernel from my HTTP server, and boots those.

"Linux then unpacks our initrd file," Finnegan continues, "and runs the /init script embedded in that, which just mounts the virtual file systems like /proc/, /sys/, and /dev, and then doesn't try and mount any other local file system, and finally our /init/ script exec's /sbin/init, which in the case of Debian happens to be systemd, and we're got a fully running system in RAM!"

Finnegan's full guide, which is applicable to more than just the specific Dell systems investigated, can be found on his website The Life of Kenneth.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles