Reviving your old PC with Linux, Part VI: Building your own lightweight remix

In the previous article of this series, I covered a variety of “remix” distributions of Linux aimed at older computers, and posed the question “why not build our own”? In this article, we’ll look at doing exactly that.

Our goal will be to set up a basic desktop system, using only the necessary components, such that it will run reasonably well on a roughly ten-year-old computer.

Respin? We used to call that “installing”…

Yes, “back in the day” it was standard practice to install a minimal CLI Linux environment on a computer, then painstakingly build up the rest of the system one piece at a time. Then along came installation wizards, Live CD’s, and fully-baked desktops that were ready-to-rock with zero tweaking; and admittedly, this is a great thing.

Distros like Arch Linux have revived the venerable art of building a system from the ground-up; not only is this an educational approach, it’s also a winning strategy for working with older, slower hardware. Many distributions are suited to this approach, including Arch, Slackware, Debian, and, yes, even Ubuntu1; but to keep things simple and short, we’ll be building with Debian stable.

Following along at home

If you’re following along at home, you’ll need the following items:

  • An old computer, preferably of late-Pentium III or later vintage, with at least 128 MB of RAM, a >10GB HDD, and a working optical drive.
  • A wired (ethernet) Internet connection with reasonable speed (i.e. not dialup)
  • A Debian stable (version 7, at the time of writing) installation CD. Either CD #1, the netinstall disc, or the “business card” disc will work here.
  • A general idea of what you want your OS to look like and be capable of.
  • A passing familiarity with bash, any console-based text editor (nano, vim, emacs, etc), and Debian’s aptitude package manager.

Got all that? Good; let’s get cracking!

Let’s build it!

Install the base system

Rehashing the whole Debian install process would be a tedious exercise, especially when a quick search for “Debian installation” turns up many text and video resources for those who want some hand-holding. I’ll make a couple of notes specific to our goals here, in the order you’ll encounter them:

  • Disk setup: Pick “manual” when you get to disk setup, and consider the following:
    • If the system’s HDD is 20 GB or less, don’t bother with multiple partitions or LVM; one big partition is fine.
    • If it’s bigger than 20GB, maybe break it into root (“/”) and /home. Depending on how much software you plan to install and the drive size, assign 6 to 20 GB to / and the rest to /home.
    • Of course, you’ll need a swap partition. Make it equal to the RAM size, but no more than 1 GB; honestly if the system is swapping more than that, you won’t want to use it anyway.
    • Definitely do not encrypt your filesystems. Too much CPU overhead.
    • Ext3 is a safe choice for the filesystem. JFS or XFS might do better2. Ext4 and BTRFS are aimed at modern hardware and really offer no advantage to the dusty old PC. Ext2 is likely to corrupt if you have a power failure during a disk write (very possible with an old PC).
    • When setting up your partitions, select “Mount options” and add the noatime flag to your partition(s) to save overhead on file reads. If you don’t set this, the system has to update the access time metadata on files every time you read a file.
    • Set the boot flag “on” for your “/” partition. Some older hardware requires this.
  • Software Installation: When you get to the software installation screen:
    • Make sure Debian desktop environment is not (as in NOT) selected. We want to configure this manually.
    • If you have a laptop, go ahead and select the laptop option.
    • Un-select print server as well. We’ll set this up manually if it’s needed.
    • Basically, only Standard system utilities and possibly laptop should be selected.

When you’ve finished and rebooted, you should be looking at a terminal login prompt. Login as root, run aptitude update, and let’s start building this thing!

Sound system

ALSA provides basic sound support for modern Linux systems. If you want audio on your system, install the alsa-base package, which will give you sound card drivers and the basic sound framework. You should also install the alsa-utils package, which provides a selection of command-line utilities for testing and configuring your system’s sound.

ALSA by itself is probably adequate for a simple desktop that will occasionally play multimedia files; but plain ALSA tends to have trouble when mixing multiple audio sources (e.g., playing system alerts over a movie). For this reason, you can optionally install a service that sits on top of ALSA and handles mixing sources and other high-level tasks. Many such systems have come and gone, but PulseAudio seems to be the clear front-runner currently. The downside of PulseAudio is that it requires more resources and introduces yet another layer of complexity to the system.

For a lightweight system, I’d recommend sticking with just ALSA unless you run into problems processing multiple audio sources.

Peripheral support

Printing

CUPS (found, appropriately, in the cups package) is pretty much the de-facto standard printing system for modern Linux distros. It comes at a cost in disk space and system resources, however, so only install it if you actually plan to do printing from your system. Once installed, CUPS can easily be configured via its browser-based interface that will be running at http://localhost:631.

Of course, actually configuring a printer will require that you have some drivers:

  • The foomatic-filters and printer-drivers-gutenprint packages provide drivers for a wide range of printer hardware
  • If you have an HP printer, the hplip package provides drivers for various laser and inkjet printers.
  • Some printer manufacturers (e.g. Brother, Canon) require you to install special binary packages to make the printer work. Consult the manufacturer’s website3 or your favorite search engine if you can’t get your printer working using the distro-provided drivers.

If you have minimal printing needs, a postscript printer, and don’t want the bulk of CUPS, a lighter option is the lpr package, which provides the old BSD LPR print spooler.

Scanning

Scanning support on Linux comes from the SANE project, which can be installed with the sane package. You’ll also want sane-utils for some command-line troubleshooting utilities and xsane for a rudimentary scanning GUI. SANE is mostly self-configuring and drivers are included by default, so it shouldn’t require any special configuration if you’ve got a simple locally-connected (e.g. USB) scanner. There are a few special cases:

  • For HP scanners, you might need hplip
  • For other scanners, such as those from Canon or Brother, you may need a proprietary driver from the manufacturer.
  • For scanners with built-in network scanning capabilities, you may need a special package to work with the scanner’s custom protocol.

WebCams

Webcam support in Linux is pretty good these days, though with a really old PC performance may be choppy and limited to low resolutions. Depending on what you want to do with your webcam, there are a few applications you might find handy:

  • guvcview is a simple GUI for viewing and configuring your webcam.
  • xawtv is an even more bare-bones webcam viewer
  • fswebcam is a terminal application for grabbing an image from the webcam.
  • motion is a service that can turn your webcam into a security camera; it captures images and video whenever motion is detected.
  • Many graphics/video-oriented applications (gimp, vlc, etc) have built-in support for capturing from a webcam.

Laptop considerations

If you’re building your minimal system for a laptop, there are a few special considerations you’ll want to deal with. Of course, these may apply to a desktop system too if you want to save power or use a wireless card.

If you installed the laptop metapackage during installation, some (but not all) of these may already be installed.

Power management

In theory, installing acpi-support and acpid on your laptop should work out all those pesky power managment issues like putting the laptop to sleep when you close the lid or turning down the screen brightness when you’re running on battery4. Big desktop environments usually have built-in tools for setting up your power management, but in a minimal environment, you might want to install these tools:

  • pm-utils is a package of command-line utilities for managing power on your system. Among other things, it lets you suspend or hibernate your lappy from the command line.
  • cpufreqd is a service that can control the frequency of your CPU and step it down or up according to rules you define (e.g., “run at 1/3 speed when I’m on battery and less than half charged.”)
  • powertop is a utility for monitoring the OS for big power-wasters. It offers solutions to your more egregious uses of power, and is quite easy to use.
  • depending on your laptop or video card model, there are a number of packages in the repository for enabling special keys, brightness control features, etc on specific hardware. Might be worth a look.

Wireless

If your wireless works out of the box with no fiddling, congratulate yourself and go buy a lottery ticket because this is your lucky day!

More than likely, your wireless hardware is going to need a non-free firmware package installed before it will work. Use the lspci command to identify the wireless hardware in the laptop; then enable the non-free Debian repository, and search for a firmware package for your wireless chipset (many of the more common ones are found in the firmware-linux-nonfree package). If this (and reboot) doesn’t do it, consult your favorite Debian forum.

Connecting to wireless via the terminal isn’t fun5, especially if you’re accessing anything more modern than WEP security (and I sure hope you are). Fortunately there are a number of minimal graphical tools for connecting to wireless networks that you can incorporate into your minimal environment:

  • network-manager-gtk is a tray application that lets you control the NetworkManager service from a snappy little GTK GUI. This one is my go-to if all else fails, as it pretty much always works. It does require installing the NetworkManager service, which add complexity and resource usage to the system; but the worst con here is that (in my experience) it has perennial memory leak issues.
  • wicd is another option for simple systems. It works pretty well most of the time, though I don’t much care for the interface.
  • wifi-radar worked well for me “back in the day”, and might be a good choice on your system. I haven’t used it in a long time, though.

The desktop and graphics

So far, most of our choices have been between including functionality or leaving it out. When we get to the graphics and desktop level, though, we start to have some real options that can make a considerable impact on the resource requirements, capabilities, and look & feel of our system.

X11 server

The X11 server is the low-level graphics system that essentially talks to the hardware and makes it possible to run graphical applications.

Xorg, provided by the xorg metapackage, is the current default standard for most distributions, and provides fairly robust compatibility and capabilities across a huge range of hardware. It’s also a fairly heavy proposition for a 10+ year-old PC.

A slightly lighter option is the Xfbdev X11 server, provided by the xserver-xfbdev package. Getting it to work (especially in Debian) is a little tricky6, unfortunately, because it requires that you first enable framebuffer support7 and then do a bit of monkeying around to configure your mouse, monitor, and so forth.

There was once upon a time a project called TinyX which made a small, lightweight X server called XVesa; it’s no longer being developed, and not available in Debian, but some super-lightweight distributions still use it. If you are up for an adventure, and really want to lower your resource usage, you can attempt to locate and compile this for Debian.

Whichever server you use, a simple way to shave a bit of overhead from the graphics system is to lower the screen resolution and color depth. Consult the xorg.conf man page for details on how to do this.

Display manager

The display manager has a few jobs on the system, but most of us know it as the program that creates the graphical login screen. If you want a really light system, of course, you can forego the display manager altogether and just run startx from the terminal prompt. For those who want a real login screen, there are a few lightweight options:

  • XDM is simple, no-nonsense, feature-free, and ugly as sin. Still, if all you care about is logging in to a desktop, it does the job, and without a lot of outside depenencies or tedious setup. XDM is provided by the xdm package.
  • WDM, or the WINGs Display Manager, improves feature-wise on XDM with niceties like a session menu, actions menu, help. It still looks a bit like 1998 warmed over, but it’s light on resources. The wdm package provides this.
  • LightDM is a modern, themeable display manager with all the goodies you expect from a modern login screen. While it was initially designed for use with Ubuntu’s Unity, it has no desktop-environment-specific dependencies and makes a good DM for any desktop. The lightdm package provides it, and you’ll also need to choose a greeter package; go with lightdm-gtk-greeter as a good default.
  • Slim is a no-nonsense display manager with no desktop dependencies. It’ very popular on a lot of lightweight distros, but was removed from some past Debian releases for unsolvable security issues.
  • NoDM is not really a display manager, but a set of configurations that obviate the need for a display manager and take you straight to the desktop. Use this if you don’t care about things like security or switching user accounts.

KDM and GDM are the display managers associated with KDE and Gnome, respectively; I don’t recommend them on a lightweight system simply because they have too many dependencies with their associated desktop environments (neither of which are appropriate for an old PC).

Finally, if you want something between a stark console login and a full-on X11 display manager, qingy is a framebuffer-based login that can fire up terminals or X sessions. Configuring it requires working framebuffer support and a bit of init-system plumbing, but it’s a nice way to add a bit of sprucing to an old system while keeping startup minimal.

Desktop environment

And now, perhaps the most important decision: the desktop environment. Of course, if we’re aiming for lightweight, it is all to easy to suggest just installing lxde or xfce4 for a reasonably light, ready-to-run desktop environment8. But as long as we’re in the DIY groove, let’s piece together a simple desktop environment from parts.

A desktop environment can contain any number of things, but at minimum we’ll need (1) a window manager to allow moving and resizing of application windows, (2) a launcher of some kind for running our software, (3) some kind of task manager functionality for viewing and switching between open windows, and possibly (4) a file manager to provide us with the capability for desktop icons. There are any number of combinations of software we can do this with, so here are a few examples:

Example 1: A classic windows-style desktop

This desktop configuration hearkens back to the days of DOS-based Windows, and probably looks best on a convex CRT sitting next to a discolored beige box.

  • Install jwm and rox-filer. JWM will provide window management and a panel for program launching and task management. Rox-filer will give us a file browser as well as desktop icons.
  • You also need the menu package if you want application menus generated automatically.
  • At the command line, copy the default jwm config file from /etc/jwm/system.jwmrc to ~/.jwmrc. Open it in your text editor.
  • You can edit this file to your heart’s content, but at minimum make the following adjustments:
    • Find the entry for <FocusModel>. Change it from “sloppy” to “click”.
    • Find a <StartupCommand> entry in the file, and add the following line after it:
<StartupCommand>rox-filer --pinboard=$USER</StartupCommand>

Now run startx (or fire up your display manager and log in to the JWM session) and you’ll see a rather bland but serviceable desktop. You can, of course, set a desktop background; and with some liberal tweaking of ~/.jwmrc you can probably make this a decently attractive desktop which will feel familiar and comfortable to most long-time Windows users.

tb-reviving6-desktop1.png

Figure 1: My rather boring windows-esque desktop

Example 2: A more modern take on the desktop

This desktop will take some inspiration from the Mac desktop, while adding in some elements common to lightweight “Linux hacker” setups. Openbox will manage our windows, while Tint2 will provide task management and WBar will be our main launcher. PCManFM will draw our desktop icons.

  • Install openbox, pcmanfm, wbar, tint2 and of course menu. Note that pcmanfm will install a lot of dependencies, so if you want to keep your installation really small, you can use rox-filer as we did above.
  • Create the directories ~/.config/openbox and ~/.config/tint2.
  • Edit the file ~/.config/openbox/autostart and add the following lines:
pcmanfm --desktop &
tint2 &
wbar -above-desk &
  • Create a default tint2 configuration by copying /etc/xdg/tint2/tint2rc to ~/.config/tint2/
  • Edit ~/.config/tint2/tint2rc.
    • Look for the parameter “panel_position”. Change “bottom” to “top”.
    • Look for the parameter “wm_menu”. Change “0” to “1”.
  • Create a default wbar configuration by copying /usr/share/wbar/dot.wbar to ~/.wbar
  • Edit ~/.wbar
    • As you can see, and hopefully infer from the contents of this file, wbar is statically-configured. Each set of directives defines an icon that launches a command, with the first set configuring the bar itself.
    • Right now we don’t have any applications installed, so none of the default ones will work. Once you have applications installed, you’ll want to edit this file to add launchers for your applications to wbar.
    • In case you can’t figure it out, “i:” should be a path to the launcher’s icon, “c:” should be the command that’s run, and “t:” is the text that’s shown when you hover the icon.

Launch startx or login via your display manager to “openbox session”9. You should see a dark desktop that vaguely resembles OSX.

tb-reviving6-desktop2.png

Figure 2: My OSX-inspired desktop environment, after some tweaking. Yeah.

More possibilities

Obviously neither of those examples is going to win a (good) design award, but it should show you the kinds of things you can dig in and do with very little overhead if you hack together your own environment. Of course you don’t have to take the creative route; plenty of lightweight window managers are perfectly serviceable all on their own if you don’t mind a little learning curve: OpenBox, Awesome, WindowMaker, IceWM, i3, etc.

Applications

Our snappy little environment wouldn’t be complete without some applications to run. Now, what you plan to do with your dusty old computer is something you know better than I, and that will naturally dictate what you install. Keep in mind that it takes more than a slimmed down OS to make video editing happen on a Pentium 3, so keep your expectations in check.

But in case you’re scratching your head at this point wondering what to do with this revived relic, here are some suggestions on what to do and which applications to do it with.

Word processing

For the 99.9% of us who aren’t MS Office power users, the word processing problem has basically been solved since the 1990s. I mean, really, what do you want from a word processor: type words, change fonts, bold, italic, bullet lists, maybe a picture or a table. It doesn’t take much.

LibreOffice is not overly demanding by modern standards, but if your hardware struggles with it look no further than AbiWord. Abiword is lightweight, mature, and capable of handling pretty much everything that the vast majority of us need from a word processor.

If AbiWord is too heavy (Woof! you have some old kit there…), it might be time to hit the console with WordGrinder, a minimal terminal-based word processor. Or better yet, dump the word processor altogether in favor of a text editor and a simple markup language.

Communicate

Despite the rise of social media websites and mobile devices, email, chat and even the venerable IRC are still popular ways to communicate with other people. Even a “Senior Citizen” PC can be put to work easily on these tasks:

  • Claws is a popular lightweight email client, and features plugins for added functionality. If you need to go lighter, alpine is a super light terminal-based mail application that is nevertheless user-friendly (well, compared to “mail”).
  • Pidgin is a great instant messaging client that supports nearly all major IM services, and is suitable for even fairly old PC’s. If the GUI is too heavy, there’s also a command-line front-end called Finch. Ayttm is another option that is somewhat lighter than Pidgin. Depending on which service you like to use, you might find a client specific to your IM provider that runs even lighter.
  • IRC clients abound on Linux, from GUI apps like XChat and Smuxi to terminal-based clients like Irssi and weechat.

Light web browsing

One really has to qualify “web browsing” these days, since it can mean anything from reading a wikipedia article to streaming DRM-encrypted HD video or playing WebGL-accelerated shooter games. The web is quickly becoming something that can push your system to the limits, so while a slim OS and lightweight browser might enable you to look up holiday recipes or read the headlines, it isn’t going to lay the entirety of the modern WWW at the feet of your ten-year-old clunker.

To find out what your hardware can do, Midori is probably a good place to start; it’s light, simple to use, and based on the WebKit rendering engine of Safari/Chrome fame. If you prefer more of a “hacker feel” (and less browser chrome – which is nice on a low-res screen), Uzbl or LuaKit both provide a customizable, minimalist browser experience based around the same WebKit engine.

For the truly ancient piece of equipment, where any access to the web would be nice, links2 is probably the most usable text-mode browser. It even has an optional switch to enable graphics, which works in either an X11 session or on a framebuffer-enabled terminal. It’s limited support for CSS and JavaScript makes it only marginally useful on some websites, but it’s fast and responsive even on Pentium-II-era computers.

Learn to Program

For those interested in technology, one of the best parts of Linux is ready access to a wide range of programming environments, compilers, and other software development tools. It doesn’t take a powerful computer to get started in programming.

You’ll want to find an editor, and while I would heartily recommend Emacs or possibly Vim (which are still used to this day by millions of programmers), those who want a more conventional interface might do well with Geany.

Once you’ve got an editor, pick a language: C, C++, Python, Ruby, Java, PHP, ASM, Lua, Lisp, Perl, and pretty much any other programming language you’ve heard of10 are readily available from your distribution’s repositories. Debian’s repos even feature a few programming books that you can install for offline-reading, such as “The Ruby Book” or “Dive Into Python”.

Games!

For some people, the word “games” is defined as “A piece of software that costs at least $50, requires at least a $300 video card, a Steam account, and the fastest Internet connection on Earth; which fills my screen with high-definition images of zombies being exploded with unrealistic weapons by equally unrealistically proportioned women”. If this is you… you can skip this section.

If you’re still reading, it turns out that computers have been capable of providing humans with mild amusement for several decades, and much of the software involved is still around and requires no more computing power than it did during its heyday. Most distributions’ repositories (including Debian’s) have a sizable games section, filled with 80’s-style text adventures, card games, arcade-style games, role-playing adventures, puzzles, educational games, and other such things that run fine on the last decade’s PC.

If that ancient box of yours came with some DOS titles, you can take advantage of them using DOSBox, which (in my experience, anyway) will pretty reliably run any game designed for DOS, even on an old PC (Oregon Trail FTW!).

Music

If your music collection lives in iTunes, you’re probably out of luck here. But if you’ve got them in non-DRM files, good old CD’s, or just prefer the unpredictability of free Internet radio, your old box can be a music machine.

VLC is pretty much my go-to media player for any system; it plays anything, and has a variety of user interfaces (GUI, command-line, or web) to scale to any system. You might find mplayer or xmms to be a little lighter in some cases.

If you like Pandora, Pithos (GUI) or pianobar (terminal) are super-lightweight ways to listen without having to deal with a Flash-based website.

If you want to go totally terminal, MOC and cmus are friendly ncurses-style music players.

Something else?

I’ve touched on some of the common things people do with computers, but there are so many little oddball programs and utilities to be found in the repositories of your favorite Linux distro; tools for chemistry, astronomy, amateur radio, genealogy, Bible study, electronics, personal finance, home design, and tons of other things you can do with a computer. Sure, you can load these on your main PC, but sometimes it’s helpful to have a dedicated computer11 to help you focus on a task.

Spend some time exploring the repositories for these gems; who knows? you might start a new hobby or make a scientific breakthrough!

And that’s all he wrote, friends!

This article wraps up my series on reviving your old PC with Linux. After reading through this series you should have a good idea of the sort of computer you can install Linux on, the sort of Linux you can install, and the sort of things you can do with it once you do. Hopefully you have gained an appreciation for the sheer breadth of possibilities the world of Open Source Software has to offer your old hardware; and maybe – just maybe – you’ll keep that old beige box out of the landfill12 for a few more years.

Footnotes:

1

There are “minimal install” images available for Ubuntu, which give you something similar to a base Debian installation.

2

The debate about which filesystem performs best is rather more complex than one might wish, and it’s hard to point to a clear winner for performance. It comes down to nitty-gritty details like average file size, read vs. write operations, kernel parameters, etc. I don’t think you can go wrong with Ext3, in any case.

3

Hint: The European and Asian divisions of some manufacturers tend to be more Linux-friendly than the USA/North American divisions.

4

In actual fact, ACPI is a mess and for many systems you’ll need to tweak these things a bit. I’ll leave that as an exercise for the reader.

5

If your box is going to connect to one WIFI network and that’s it, configuring wpasupplicant isn’t that bad. But if you’re always “on the go” with your system, you’re not going to want to muck about with that every time.

6

In all honesty, I’ve never gotten it successfully working on Debian.

7

If you’re lucky, this is as simple as installing the v86d package, adding “uvesafb” to /etc/modules, and rebooting. Many older video cards are very hit-and-miss when it comes to framebuffer support, unfortunately.

8

If you want to use one of these but keep it light, install with the --no-recommends switch. This will avoid pulling in a lot of stuff you already opted to skip.

9

Openbox has two executables: openbox, and openbox-session. If you use the former, none of your startup scripts will be launched, so you’ll get no panel, desktkop, or wbar. You need to make sure openbox-session is being launched.

10

exceptions include a few proprietary languages from certain small (as in micro) soft ware companies that you didn’t want to learn anyway.

11

Read: a computer incapable of accessing Netflix, YouTube, Hulu, or your PC games collection…

12

Ok, you should be recycling old computer hardware when you get rid of it, because those motherboards can leak some nasty stuff when they decompose. But you get my point.

Leave a Reply

Your email address will not be published. Required fields are marked *