Tuesday, March 04, 2008

(Portable) Ubuntu for Programmers

I've been trying over the past several weeks to find the best fit for Linux on a USB pen drive so that I can boot into my own operating system and get to my files no matter which computer I'm using. As you might notice from my other posts, I tend to spend quite a bit of my computer time in programming and browsing the Web, so the things I'm most interested in are a web browser (Firefox), support for wireless cards in several computers, and a variety of command line programming tools (gcc, python, vim, etc.). It should be possible to take one of the standard Linux distributions and install it on a USB drive (provided the drive is large enough), but I wanted to use a one gigabyte drive that I had, and with my simple needs I should really be able to get all of the necessities in under one gig. Along the way I've tried Puppy Linux, Slax, Feather Linux, DSL, and others, but I decided in the end to roll my own solution based on Ubuntu.

I'm a big fan of Ubuntu, but the standard desktop install is far too large for installation on a one gig drive. For a while I was using the live CD booting from a pen drive with a partition for my files. I used the instructions I found on Pen Drive Linux to set up the pen drive with the image from the live CD (only 750 megabytes). The only problem with this set-up was that all of my files were in a seperate partition and my home directory was wiped out each time. Since many Linux programs store settings in your home directory, this turned out to be a bit incovenient. I tried a few different options, but finally decided to go with a stripped down Ubunutu foundation and add the things I wanted.

I began with Ubuntu Server 7.10 and installed it on my USB drive using some of the recommendations in the installation instructions for low memory systems. During the installation process I selected guided partioning and I did not choose to install any of the software configurations in the "software to install" menu. After installing, I rebooted and added the following packages using sudo apt-get install:
lynx (optional)
screen (optional)
gcc (optional)
If you are using a laptop, you will likely want to install the following modules:
With the above installed you can check the battery's charge, remaining time, etc. by running acpi on the command line. For the graphical desktop window manager, I chose iceWM. I installed it by adding:
In the past I've worked quite a bit with Fluxbox as a window manager, but it seems like iceWM is easier to configure, especially under Ubuntu. The liQuid theme looks quite nice.

This set up boots into a text only command line mode because it is based on Ubuntu Server, to enter graphics mode, you simply run startx. I connected to my wireless network using wpa_supplicant and running iwconfig.

One of the benefits of working on a lightweight system on a flash drive is the bootup speed. In twenty seconds the computer boots from a cold start, connects to my wireless network, and enters the graphical desktop. I'm quite happy with my little portable operating system, and you probably won't be suprised to hear that I wrote this post using it.
Post a Comment