| Close Window |
In this article you will learn how to turn a blank CD and an inexpensive USB keydrive into a powerful, portable, take-along operating system complete with modern applications like Firefox, a Web server, and multimedia tools. All this can be done using free Open Source Linux software.
We'll start with the latest version of a distribution called Damn Small Linux (hereafter referred to as DSL) and work through the steps of getting and "burning" an image, booting it, setting up networking and applications, and saving customizations and files to the USB media. You can do all of this even with an old PC from yesteryear, turning it into something snappy and new. One possible outcome is what you see in Figure 1.
The resulting bootable CD and USB keydrive storage work great without having to install, partition, reformat, or even modify the hard drive on the host system. This highly portable computer system based on DSL will enable you to walk up to almost any PC and boot into your very own familiar Linux desktop, get on the Internet, send e-mail, blog, play games, even listen to Internet radio, and save your work, shut it down, and take it all of it with you without leaving a trace. It will be lightweight, fast to boot, and can breath new life into almost any computer, old or new. You can even use this technique to create low-cost Internet kiosks and Web servers, as an alternative to carrying a laptop, or just to impress your friends and colleagues.
The DSL distribution of Linux has long set the standard for fitting maximum functionality into a small 50MB footprint. The discipline of keeping the entire distribution to this size has resulted in a compact and versatile Linux (derived from the venerable Knoppix, itself based on Debian Linux) that can run efficiently even on older PCs while recognizing a wide assortment of hardware. Through the innovative "MyDSL" subsystem, nearly unlimited customization and system expansion are possible.
There's a lot to look at inside this unusual little operating system, not all of it beautiful. This article will help you find the best of DSL and ignore the rest. Best of all, you'll discover how to shape and customize DSL into something useful and appealing, perhaps even something unique.
Getting Started: Obtain, Burn, Boot
Get the Latest DSL Image
Downloading the latest stable version of DSL is free and easy. If you have a high-speed Internet connection it can be done in minutes. Simply follow these instructions:
1) Visit the URL www.damnsmalllinux.org/download.html
2) Click on one of the mirror sites under "where to download"
3) Look for a directory called "current" and click on that to see its contents
4) Look past most of what you see and download the file "dsl-<version>.iso"
Where I've written <version> above you'll see something like "2.4" depending on when you read this article. The current stable version is 2.3. Save your download in a place where you can find it as you move to the next step.
Burn the ISO onto CD
The file you just downloaded has an "iso" extension after the ISO standard format used on CD-ROMs. Some operating systems - such as OS X - can mount an image file like this and show you its contents. We don't really have to do that but if you're curious go ahead and see if your computer can mount the disk. You'll need a writable CD-R disk and a CD burner for the next step. Use your favorite CD-burning software to create a disk from this image.
One important note here. The DSL disk image is much smaller than the CD's capacity and that's expected. At only 50MB you could fit about 15 copies of DSL on a standard CD-R. DSL was originally configured to fit on the smaller 50MB "business card" CDs that were briefly popular. This size constraint now offers great advantages for this little operating system. As you'll see, DSL is so small that the entire operating system can boot up into the memory on just about any PC without even accessing the hard drive.
When you burn your CD remember that you're dealing with a bootable ISO image. Rather than just burning a copy of this file onto a CD (which won't boot properly in the next step), you'll want to instruct your CD burner to recognize the ISO and burn a disk image.
Boot from CD (or Use a Helper Floppy)
This step could be as simple as putting your newly minted DSL CD into the drive on your computer and rebooting. You should try that first before reading any further. By the way, many people get nervous about doing anything experimental with a working computer and rightly so. In my experience I've seen no risk in booting a PC into DSL. This little operating system will detect much of the hardware attached to your computer including your network, but it will completely ignore your hard drive and data until you tell DSL to do differently. If you're still not sure, just dig out that old PC in the closet and try DSL on that first. An old machine running DSL may surprise you as it comes back to life. Now let's get back to the boot. If your PC recognizes the CD as bootable and begins a boot sequence, skip to the next section.
Most PCs can boot from a CD (the CD booting standard has been out for over 10 years), but they may not be configured to do so. To find out you'll have to get into the BIOS settings at boot time and check. As your machine starts up, look for a message that says something like "Press F-10 for BIOS Settings" and use whatever key you are instructed to press.
Next, while in the text-based BIOS menu system, look for a section on boot devices and boot order. Make sure that the CD-ROM is somewhere in the order of boot devices ahead of the hard drive (usually it goes in the order of floppy, CD, then hard drive). Find a way to put the CD-ROM in the boot sequence, save your changes then try a reboot.
At this point I should mention that one of the machines I used to prepare this article (and even write some of it) is a 10-year-old Pentium 150MHz with only 96MB memory. It can't boot from a CD so I used a helper floppy that can recognize and boot the CD. If you need such a thing, you can create one by following these steps:
1) Download the boot floppy boot image file for DSL
Download: bootfloppy.img
From Site: ftp://ibiblio.org/pub/Linux/distributions/damnsmall/current
Save As: boot.img
2) Create a boot floppy using a blank 1.44MB floppy disk
If running Windows
Download: rawrite.exe (or other suitable variant for your OS)
From Site: www.fdos.org/ripcord/rawrite/
Run Command: rawrite -f boot.img -d A
If already running a version of Linux:
Run Command: dd if=boot.img of=/dev/fd0 bs=1440k
Once your computer is booting from the CD (or a combination of floppy/CD) you're ready to begin exploring the world of DSL, customizing it to your liking, and creating a configuration that you can easily return to on your next boot.
Advanced Topic: Bootable USB Keydrive
(aka Pendrive, Flashdrive, Etc.)
You may have heard about bootable USB keydrives or know someone who has one. With DSL there are at least two ways to get your USB-capable computer to boot from a keydrive. The first works without having to reformat the keydrive. The second approach will dedicate the entire USB keydrive to running DSL by creating a boot partition and a data partition.
You can skip this section entirely or return to it later if you decide that booting from a keydrive is for you. Regardless of how you end up booting, the rest of this article will assume that you're simply booting from a read-only device and intend to use a keydrive for take-along storage. This way everyone can come along with or without a bootable USB drive.
Quick and Easy Install to Keydrive
(Requires Helper Floppy)
The simplest and least disruptive approach to booting from a keydrive is just to make the keydrive look like the CD you used to get started. I made this work by copying all of the files from the DSL CD (mounted as /mnt/cdrom) to the root directory of a keydrive (it will have to be mounted as /mnt/sda1, as shown below) already formatted with the MS-DOS file system. Of course you'll need at least a free 50MB on the USB keydrive before you copy the files.
If you don't know how to copy files in Linux, first bring up a terminal window by clicking on "ATerminal" on the DSL desktop. Next type the following:
$ sudo mount /dev/sda1
$ cp -r /mnt/cdrom/* /mnt/sda1
If you're allergic to the command line, these two steps can be carried out intuitively using the "Emelfm" file manager also available on the DSL desktop.
This approach to booting will preserve the data you already have on the keydrive. It won't make the drive into a genuine Linux boot disk (we'll do this in the next section), so you will need a helper floppy to get the machine booting from this USB keydrive. I made a USB boot floppy while running DSL itself. This is simpler than the manual approach described above but note that you'll need a different boot image (bootfloppy-usb.img) than we used before.
You can create a USB boot floppy with the pre-installed DSL floppy disk tools. Right-click in the DSL desktop to bring up the main DSL menu. Under "Apps | Tools | Make Boot Floppy" select "USB Boot Floppy" and follow the instructions using a blank 1.44MB floppy disk. Once you've created the floppy, leave it in the drive and reboot with the keydrive plugged in.
This new floppy will find the keydrive you've plugged into the USB port and try to boot DSL from it.
Genuine Install to Keydrive
(Still May Require Helper Floppy)
For this approach you
have to be prepared to erase and reformat the contents of a keydrive
for dedicated DSL use. A 256MB keydrive, which will do nicely, runs
less than $20 new. To create a dedicated bootable copy of DSL on a
keydrive, read on!
To get this to work you'll also have to know which USB boot standard is implemented in the BIOS of your computer. For computers that can boot from USB drives, the BIOS will support one of two formats. Bring up the BIOS setup utility again (as described above) to find out which, if any, your computer will support. With the setup utility try to put USB-HDD or USB-ZIP before CD-ROM and HDD in the boot order or your keydrive will be ignored when you reboot.
To proceed with the installation you'll need to boot back into DSL from the CD. With DSL running and your keydrive plugged in but not mounted (that just means don't do anything special with /mnt/sda1 after plugging it in) right-click in the DSL desktop to bring up the DSL main menu. Under "Apps | Tools | Install to USB Pendrive" you'll find two choices. These are "For USB-ZIP Pendrive" and "For USB-HDD Pendrive."
Choose whichever standard your computer recognizes and follow the instructions. When prompted for the device name for the installation use "sda." The program will proceed to partition and format the drive as /mnt/sda1 (with all of DSL) and /mnt/sda2 (an empty partition for your files using the remaining storage available on the keydrive).
In the case of my older test PC neither of the boot standards was supported by the BIOS so I created a USB-HDD install and combined that with a helper floppy. Many people have found getting a USB keydrive booting tricky even with a BIOS claiming to support it. If you get stuck making the keydrive boot on its own you can easily create a helper floppy using the instructions in the previous section. This helper floppy works for both forms of USB keydrive installation described in this article. Besides, having that helper floppy will all but guarantee an easy boot on an unfamiliar computer.
Getting on the Internet: Browse, Blog, E-Mail, Chat
By all accounts, DSL seems to do well with most LAN cards and adapters
on desktops, many PCMCIA LAN cards on laptops, and with a smaller but
growing number of PCMCIA wireless network cards. Both my test machines
have PCMCIA adapters (one is a Gateway Tower desktop, the other an IBM
Thinkpad laptop). With the Netgear FA411 10/100 Mbps network adapter
card I used, DSL was able to recognize the card, configure it, and
acquire an IP address automatically via DHCP through my router. I was
on the Internet before I even realized it.
Your best bet getting started with DSL is to walk up to a PC that is already wired to a working LAN configured to give out IP addresses using DHCP. If the machine can boot into some version of Windows and get on the Internet, chances are good that DSL will boot and do the same. For those of you who have a different setup (maybe dial-up or a wireless setup with an unrecognized adapter) I have included some helpful configuration resources below.
Check Your Network Connection
If your machine
boots right up and jumps onto a network with a direct "line" to the
Internet you'll be able to browse right away using the "Dillo" browser.
As a test, try to access www.google.com.
Assuming that works you can skip to the next section or read on and learn about some useful diagnostic tools included with DSL. If your first attempt to browse with Dillo didn't work, it could just mean that you're on a network with a proxy server. Check with an administrator or a working computer nearby to see if the browser needs to be configured with proxy settings. In Dillo you do this by clicking the "V" menu, select "Options," and click the "Network" tab to fill in your proxy settings.
To see if your machine can really communicate on a network right-click on the desktop to bring up the main DSL menu. Select System | Control Panel. Click the "System Stats" button and then click on the "Net" tab (see Figure 2). What you see here will be cryptic but informative. There should be a card and driver name followed by one or more "nameserver" entries, one per line. Name servers enable your machine to resolve names like "www.google.com" into real network addresses on the Internet. Further down you should see a section "eth0" containing your computer address listed under "inet addr" as a four-part number like "192.168.1.102." Further along in the same section of text you should find some statistics on the number of bytes transferred by the card since it was booted. This is further evidence of a working network.
On the other hand, you may not find the information described above. In that case your next stop is the "Hardware" tab of the "System Stats" window. This is where your network card, if it was recognized, will be listed. On my test laptop, for example, I see two entries for the hardware:
NETCARD_FULLNAME=''NetGear FA411 Fast Ethernet''
NETCARD_DRIVER=''pcnet_cs''
If you see your card listed but it's not reported on the "Net" tab, you can try using either the "Netcardconfig" tool for a wired network card, or the "Wlanconfig" tool for a wireless networking card. Both are available from the Control Panel. Troubleshooting through these tools is beyond the scope of this article but see Resources for more information:
Fire Up Firefox
Having made a successful test of
the Dillo browser (to http://www.google.com), try doing a couple of
searches to convince yourself that you're really on the Internet.
Before long you'll be ready for a more powerful browser. And you're in
luck. Try clicking on the "Firefox" icon on the DSL desktop to bring up
Firefox.
Figure 3 shows a screenshot of my DSL desktop running Firefox complete with RSS feeds and a favorite Web site.
You can see that I've been busy customizing the DSL "fluxbox" window manager with styles, applets, a background image, and extra applications. In the next section you'll learn how to do this, but - unless you're already too busy blogging - first why not check out a few more built-in applications for the Internet?
E-mail and Chat Programs
It seems like most people
do e-mail with a browser at least part of the time. I use
http://gmail.google.com, which has a rich user interface. This
application is a good test since it really gives Firefox a workout. Try
your favorite e-mail Web site. Or you can bring up and configure the
built-in "Sylpheed" e-mail client program.
DSL includes text-based applications for doing text messaging. These support three popular protocols: AIM, IRC, and ICQ. Other more full-featured chat applications are available in the MyDSL application repositories.
Access the MyDSL Application Directory
The MyDSL
package system for DSL really sets this little Linux distro apart. It
comes to you packed with as many applications as will fit in 50MB. With
MyDSL you can download and install (or set aside for later) as many
applications as you want or need. These can be saved to a keydrive and
brought along wherever your travels take you.
Access MyDSL by clicking the "MyDSL" icon on the DSL desktop. You're presented with a barebones window of buttons, each representing an application category (see Figure 4a). Click a button to get a list of applications in that category (see Figure 4b). Click an application to get a description. Click "Download" to put the application into a temporary (for now) directory and automatically install it in the "MyDSL" menu under the DSL main menu.
In the next section you'll learn how to keep these applications on a keydrive and even have them installed and ready to go the next time you boot up.
Saving for Next Time: Settings, Applications, Data
Accessing that Keydrive
When you insert a USB keydrive
into a computer running DSL its contents will appear under the
directory /mnt/sda1. The drive must be mounted before you can see your
files so don't panic if /mnt/sda1 appears to be empty. Just use the
mount tool on the DSL desktop. Click the button marked "fd0" until you
see "sda1" and then click the red "unmounted" button once. It should
turn green and read "mounted." That's all there is to it. Your keydrive
is mounted read/write and ready to use.
Note: if you did create a bootable keydrive, yours will have /mnt/sda1 and /mnt/sda2. Use /mnt/sda2 to save your work and MyDSL extensions since it's created for that purpose.
Next, bring up Emelfm (or a terminal window) and create the following directories under /mnt/sda1 (or /mnt/sda2):
Installing applications works the same way only these will appear under the menu called MyDSL. If you want to download some applications but don't want them installed every time you reboot you can create a subdirectory under /mydsl called /optional. When you save MyDSL applications to the "optional" directory they appear in a separate sub-menu named "Install Optional Extensions" ready to install.
Saving Other Data
Other files that you download or create
should be handled with care. You'll want to make sure to save on the
permanent storage of your keydrive rather than a transient directory
elsewhere. This is where your /myfiles subdirectory comes in handy.
Save to this directory and you can count on finding your files again on
the next reboot, even if you boot up on a different computer next time.
Taking it Along: Everything-To-Go with MyDSL
Restoring Customization and Saved Applications
Everything
you tucked away on your keydrive will be available next time you boot
up. This happens in part because DSL makes a backup of some important
system files and directories when you shut down. To make sure this
happens properly it's a good idea to do a manual back up before you
shut down the computer.
To back up, choose the following from the DSL main menu: System | Backup / Restore. Next enter just the device name where you want your backup saved. If you booted from a CD and have a keydrive inserted, use: sda1. If you have a bootable keydrive with a second partition for data use: sda2. Click "Backup" and wait for the program to finish before shutting down. This creates a compressed archive file called "backup.tar.gz" in the root directory of the filesystem.
When you boot up next time, DSL will search for and discover its backup archive on the keydrive and restore the files and settings back to the way you last saw them. Now any computer you boot up with your take-along CD/floppy/keydrive will seem like your very own.
Other Uses for DSL
Internet Kiosk
Let's say you want an inexpensive way to
convert some old PCs into a collection of Internet kiosks for an art
gallery, business directory, or school project. Running DSL with
Firefox would make this easy.
First, you can make Firefox start up automatically at boot time. Just edit the file called ~/.xinitrc and insert this command:
/usr/local/bin/firefox http://your.home.page &
For a kiosk it would be good to disable extraneous menus and applications and limit the scope of the browser. For more information on building Linux-based kiosks, there are a number of how-tos available (Google: "linux kiosk"). Once you've got one kiosk working, it would be easy to duplicate the contents of its keydrive onto others to create more kiosks.
Web Server (System | Control Panel | MonkeyWeb)
For fun I
turned my bootable keydrive into a portable library of e-books hosted
on a Web server. It runs a MonkeyWeb server - included with DSL - to
serve out electronic books that I downloaded for free from Project
Gutenberg (www.gutenberg.org).
First I copied a number of classic e-texts into the /dsl/Share
directory. Then I started up the MonkeyWeb Web server (included with
DSL) from the System | Control Panel menu. Now users can access these
books from any computer on the network by browsing to
http://192.168.1.102/Share. With a few changes this machine can be
configured to automatically serve out e-texts from a better-named URL
every time it boots.
Remote Desktops
Another handy trick is to make DSL
available remotely from another computer. To do this I downloaded VNC
(called "vncserver") from MyDSL. VNC is a remote desktop program. Many
client programs exist for Windows and Mac. I use the popular "Chicken
of the VNC" (Google: "vnc chicken") for OS X to access my "headless"
DSL (i.e., no monitor). Once you've installed "vncserver" from MyDSL,
select MyDSL | vncserver | vnc4x0 and connect to your DSL machine using
its DNS address, e.g. 192.168.1.102. When running full screen, the
PowerBook appears to be running DSL.
In summary, I've found this take-along operating system to be a great companion for doing most of what I need from a computer. Once your keydrive is configured the way you want, it will seem like you can take your computer everywhere without really having to take your computer anywhere.
Resources
© 2008 SYS-CON Media Inc.