Linux DevCenter    
 Published on Linux DevCenter (http://www.linuxdevcenter.com/)
 See this if you're having trouble printing code examples


Installing and Configuring Ubuntu on a Laptop

by Jeremy Jones
11/17/2005

I recently decided to buy myself a laptop. This is the first laptop I have ever purchased, and the first computer I've bought in about five years. I shopped around and tried to get an idea of what options are available, the average price for the feature set I wanted, and (most importantly) which models have successfully seen Linux installed on them.

The topic of Linux on the desktop has captured much media attention lately. While running Linux specifically on a laptop has attracted less attention, everything that applies to Linux on a desktop also applies to laptops. Why Linux, and why Linux on a laptop? Linux, because:

And on a laptop, because I need to not be bound to a computer in one location, be it my home in general or my bedroom specifically. (Yes, my computers live in my bedroom.)

I spent a fair amount of time on the Linux on Laptops and TuxMobil pages investigating manufacturers and specific laptop models. After a bit of research, I decided that the features I really wanted were:

Related Reading

Linux Desktop Pocket Guide
By David Brickner

The Dell Inspiron 9300 met all of my "needs," but the $1,500 starting price tag for the entry model kept me looking for a different laptop. When my boss pointed me to an online coupon that dropped the price another $300, I jumped on it. My $1,200 bought me:

Let me first say that while I am thoroughly enjoying the new laptop, I am not terribly pleased with Dell due to:

Installing Ubuntu

I decided to install Ubuntu because it builds on the mature foundation of Debian and has a large (and growing) user base and strong community support through web forums and IRC. I have been running it at work for a few months now and thoroughly enjoy it.

When I received the laptop, Hoary was the current version of Ubuntu. I have since upgraded to Breezy. I popped in the Ubuntu Hoary install CD (disk 1 of 1) and powered on the machine. Of course, I had to set the BIOS to boot from CD. The installer came up and started asking me questions.

Note that the Ubuntu installer is a non-GUI, text-based installer. It's not pretty, but it is very functional. Because it asks so few questions in order to install, I'm not sure how much benefit a GUI installer would provide other than eye candy.

The first questions were about region and language; English was the natural choice. Then came hardware detection (not a question--just an install action). Next, I had to select which of my two network devices to use as the primary. This was good news that it seemed to see both network interfaces. I chose the wired one as the primary ... well ... just because.

Even though I had the wired interface plugged into my router, it failed to get an IP address via DHCP the first time. I told it to try again, and it magically worked. As I'll mention later, I've installed Ubuntu numerous times on this laptop since that first time. DHCP has always (to my recollection) failed the first time, but magically works the second time. I haven't bothered to search the Ubuntu community documentation to see if this is a known issue, because it's self-resolving.

Next, it was time to pick a name for the machine. My recent computer naming convention has been to choose characters from sci-fi novels. I already have ender and valentine (both from Ender's Game by Orson Scott Card) and pham (from A Deepness in the Sky by Vernor Vinge), so I chose to name this laptop qiwi after Qiwi Lin Lisolet, also from A Deepness in the Sky.

Next up was partitioning. Here is how I setup my filesystems:

For some reason, I am paranoid about my /boot partition. If something goes really wrong with /boot, I want to be able to boot up with something comparable to a Tom's Root boot disk and fix the problem. Last time I checked, Tom's didn't support reiserfs. This paranoia is probably unwarranted, given the number of really good CD-bootable Linuxen such as Damn Small Linux, Ubuntu Live, and Knoppix, all of which can mount reiserfs (I think), but old habits die hard. Setting up a separate /home partition saved me a tremendous amount of time, given the number of times I've installed Ubuntu on this machine. More on that later.

After setting up the partitions, the installer installed the base system and started copying packages to the hard drive. Because I figured it was going to be a late night with my new toy, I took this lull as my cue to make a couple of shots of espresso. By the time I tamped down the grounds and filled the reservoir with water, the files were 71 percent copied. Nice. By the time I had frothed some milk and combined the milk and espresso, the copy had finished.

The next question was the time zone. I've never set up a machine to use Coordinated Universal Time (UTC), so I decided to not start now; instead I selected U.S. Eastern time.

Next, I added a user account. Unless I'm just missing something, the installer allows adding only one account during the install. While you can add users afterward, it would be nice to be able to add a few while you were adding the main account. Something that often confuses people new to Ubuntu is that Ubuntu doesn't activate the root account initially and doesn't ask for a root account during install. After installing and booting into the new system, you have to do a sudo passwd root to set the root password.

The New System

The only steps left were for the installer to test its ability to connect to the package repositories, install grub, reboot, and install the packages it had copied over. These remaining steps progressed pretty quickly. Now it was time to explore my new system!

Video

After rebooting and installing the remainder of its packages, Gnome came right up. The first thing I checked was the screen resolution. The installer automatically configured it to 1,920 by 1,200 at 60Hz, and it is beautiful. While Ubuntu automatically configured the ATI Radeon X300 Mobility card at install time, it didn't use hardware acceleration. This hasn't been a big problem, as I am not much of a gamer. However, I feel the necessity of trying to get the video card fully functional just for the sake of doing so. With the Ubuntu installation configuration of the video card, TuxRacer was nonplayable and BZFlag was jerky.

Some posts that I read mentioned using the fglrx driver, so I fired up the Synaptic package manager, searched for fglrx, found xorg-driver-fglrx, and installed it. I then changed the line in my xorg.conf file from Driver "ati" (the open source ATI driver) to Driver "fglrx" (the closed source ATI proprietary driver), added Option "MonitorLayout" "LVDS, AUTO" directly above the previously mentioned line, and restarted X. This caused glxinfo to show direct rendering: Yes rather than direct rendering: No.

After this modification, TuxRacer worked. I even downloaded the Unreal Tournament 2004 Demo for Linux and it worked ... for about 2 minutes of game play before locking up my laptop. Oh, and the fglrx drivers killed DVD play. I can still play them, but they are unwatchably choppy in full screen.

The ATI web site has drivers for Linux. For the Mobility cards, though, it referred me to my laptop manufacturer, so I checked Dell's site for drivers. Earlier, I mentioned that I could not find Linux drivers on Dell's site. Video drivers were no exception. Being adventuresome, I decided to install version 8.14.13 of the drivers from ATI's web site, the current version at the time of my Hoary installation. Unreal Tournament is fairly playable at a limited 1,024-by-640 resolution. It doesn't lock up any more, but it can get a bit sluggish. DVD playback is much better, but still not as good as with the open source ati driver. DVDs are a bit blocky using the fglrx driver compared with the ati driver. Also, X and xine consume about three times as much CPU while playing DVDs using the fglrx driver than they do with the ati driver.

I tried to contact ATI multiple times about the poor performance and quality of DVD playback relative to the open source driver and the future of its Linux support, but I received no response.

Wireless

The next thing I checked was the wireless interface. For a while, I wasn't sure if Ubuntu saw my wireless card correctly. When I checked the network in the Gnome network configuration applet, it showed the network interface, but activating it didn't do anything. It didn't see any networks. I modified my router to disable WEP and enable ESSID broadcast in order to try to diagnose the problem I was having. Nothing. It turns out that at some point, I had hit Fn-F2 and turned off my wireless card. Hitting Fn-F2 again turned it on and allowed me to configure the wireless network (which included turning WEP back on and broadcast ESSID back off).

After recovering from a little bit of embarrassing user error, wireless worked beautifully. I was able to configure WEP at home and work and switch between wired and wireless. However, the network configuration applet that comes installed with Ubuntu (from Gnome, I think) doesn't work too well. The biggest problem is with the Location feature. The applet appears to support multiple locations, presumably for the purpose of configuring your network for different places that you happen to go. On boot-up, no specific location comes up, which is fine. However, the ESSID (and presumably the WEP key) get swapped around among different locations. I wound up pasting in the WEP key whenever I changed locations--not exactly ideal behavior.

To alleviate this problem, I downloaded gtkwifi. It does a fabulous job of storing WEP keys for various access points and automatically connecting to what it refers to as "preferred networks" as it finds them. The only problems I have with it are:

A problem I experienced with my wireless connection is that it kept on disconnecting and failed to reconnect unless I rebooted the laptop. I did some Googling and found some references to Ubuntu Hoary packaging outdated ipw2200 drivers. I downloaded the latest drivers, compiled them, and installed them. I first had to remove all trace of the old drivers:

root@qiwi:/root # find /lib/modules/2.6.10-5-686 -name "*ipw*" -exec rm {} \;
root@qiwi:/root # find /lib/modules/2.6.10-5-686 -name "*80211*" -exec rm {} \;

before installing the new drivers from source. After installing the ipw2200 driver (which was at version 1.0.4 at the time of my Hoary installation), I haven't had a single problem with wireless connectivity--not with Hoary, anyway, but more on that later. I really don't like installing different versions of applications and drivers for which there are Ubuntu packages, but I make exceptions when they are broken (as was the case with the fglrx driver and the ipw2200 driver). I'm sure this will be a headache when Ubuntu packages newer versions of fglrx and ipw2200.

Gnome

Gnome itself has been the source of my biggest problems. First of all, I never used to like Gnome. It always looked like a toy to me. It always seemed bloated. It never "felt" like a usable desktop. I actually intended to install Kubuntu on the laptop so I would get KDE out of the box. The main reason I didn't was that my Kubuntu CD was a bad burn. After tinkering with Gnome for a bit and seeing the simple (but thorough) configuration utilities, the consistent look and feel, the apparent ease of creating applications for it, and the fact that it just "feels" right, I've come to appreciate it more and actually enjoy it.

That doesn't mean that Gnome is without problems. I had the infamous "Gnome locking up at startup" problem. I Googled and found various solutions, but nothing worked. For about two weeks, I reinstalled Ubuntu every two or three days. Because none of the suggestions were helping, I was convinced that I had a library conflict and that something I had installed overwrote something that Gnome needed to work properly. I kept reinstalling in order to track down what I had installed that could have caused this particular problem. (At least I had a /home filesystem separate from the other filesystems and didn't lose any user data.) I could not consistently produce the freeze-up, nor could I track down what I had installed to cause the problem.

One day when the freeze-up occurred again, I decided to follow a piece of advice to start gnome-control-center from a fail-safe xterm and disable sound on startup. When I brought up a fail-safe xterm and tried to start gnome-control-center, the command I issued just sat there, and gnome-control-center didn't start and wouldn't return me to a shell prompt. I tried it several times and it just wasn't working. I either went to get some coffee or worked on something else, and noticed that after a while, gnome-control-center had started. That gave me a hypothesis and an idea. Maybe Gnome was trying something that wasn't working and "freezing" until it timed out. I tried to start Gnome (which didn't come up) and just let it sit. I didn't time it, but after five or ten minutes, Gnome finally came up. I haven't had a freeze-up since, so it probably was something that just needed to time out once.

Multimedia

With a 1,920-by-1,200 17-inch display, I just had to try to get some of the multimedia capabilities of this laptop working. The laptop wouldn't play a typical DVD (say, from Blockbuster) with out-of-the-box Ubuntu, so I had to install the libdvdcss package to allow Xine to decode it. It wouldn't play QuickTime files either, so I had to install the w32codecs package. After that, I haven't had a problem playing any multimedia file format.

One thing I wasn't sure I would like when I got the laptop was the presence of seven multimedia keys on the front of the laptop. I really thought those keys were just tacky fluff, like some keyboards' web browser button or email button. But I've actually come to enjoy them. I configured my system keyboard shortcuts to recognize them all. The only thing the systemwide keyboard shortcuts appear to do is control the volume. In order to get individual media applications to become "multimedia key aware," I had to configure the keyboard shortcuts for each specific application. So far, I have configured both Xine and XMMS, and they work beautifully.

Touchpad

The base features of the touchpad worked without any effort. The only nonworking feature I would like to conquer is the vertical scroll area. I found a reference on a Ubuntu forum that indicates the touchpad drivers may be broken. I haven't felt like compiling the drivers and getting it working yet, though.

DVD+/-R

So far, I have burned only a couple of CDs and data DVDs. Both work very well from Nautilus (Gnome's filesystem explorer). I even noticed when I right-click on an .iso file within Nautilus, it displays a "Write to disc" option. I will have to try that out one day.

FireWire

FireWire did not work initially, giving me a "Could not open device raw1394" error. After a bit of Googling, the answer was so obvious that I should have at least guessed the problem. The permissions on the file /dev/raw1394 were 600 with an ownership of root:video. My user was in the video group, but /dev/raw1394 was not group-writable. I did a chmod 666 /dev/1394 (overkill, I know) and it started working. Because that worked, I put the same command in /etc/init.d/bootmisc.sh.

Suspend

I read the web site of someone who has suspend to RAM working on this exact laptop, but it isn't working for me. His modified ACPI scripts seem to suspend my laptop, but when I try to restore, I just get a black screen staring at me and have to reboot. When I get a little more time and a little more motivation, I'll hack his scripts and see if I can get them working for my system.

I have tried suspend to disk only once. The Ubuntu suspend scripts shut the machine down and resumed to my desktop. Unfortunately, networking was totally hosed, and nothing I could do would bring it back to life. I guess that is another thing to add to my to-do list.

Sound

I've had several situations where an application would fail to put out sound, but would work once I had killed the esd process. I have disabled sound at startup from the Gnome control center. Since doing that, I have had no problems with sound under Hoary.

Upgrading to Breezy

When Breezy (final) came out, I decided to upgrade. I'm typically a delete-and-reinstall-everything type of person, but this time I decided to live dangerously and do a system upgrade. I changed all references of hoary to breezy in my /etc/apt/sources.list, did apt-get update followed by apt-get dist-upgrade, and then just let it run. There were a couple of packages I had to uninstall manually because they caused my dist-upgrade to hang--one of which, if I remember correctly, was a wxPython package. Other than that, the upgrade process went very smoothly.

Having to uninstall one or two packages manually was a much cleaner upgrade path than I was hoping for. Still, I was nervous about booting into my "new" system. My nervousness quickly passed when I logged in to the beautiful Gnome 2.12 desktop. I was perhaps most excited about the new Removable Drives and Media Preferences settings that are new in Gnome 2.12. Rumors even suggested that my Canon Digital Rebel XT would have support. (By the way, it does, but it doesn't work exactly right.) Overall, the desktop experience is still excellent; even an improvement over the previous and excellent Gnome version.

Video was still at a stunning 1,920 by 1,200. AVIs played, and the quality was even better than it was previously. Somewhere between my initial installation of Hoary and this upgrade to Breezy, I had reverted to the Ubuntu repository version of the fglrx video drivers, so I upgraded with this upgrade attempt.

Sound didn't work exactly right. I was getting sound for some applications and not for others. Then, as I mentioned earlier, I remembered that I had shut off sound support at Gnome startup. I decided to change that and let Gnome manage my sound once again. After I did that, I haven't had a problem with sound--well, no worse a problem than is par for Linux sound. Sound is definitely an area where Linux needs some improvement. One problem I regularly encounter with sound is that I have to kill ESD if I want to use Audacity.

The wireless network works, but it restarts if I use BitTorrent or FTP large files from or to my laptop. One upside is that Intel has some folks working on the driver, an open source project for the driver, and a Bugzilla database; they appear to be making steady improvements in the driver. The other upside is that I no longer see the open bug description of the symptoms that I am having, so they may have fixed it.

Overall, I am extremely pleased with the upgrade. My system has no hint of the brokenness that I have previously associated with OS upgrades. Perhaps the reason that I typically choose to reinstall rather than upgrade is my experience with broken systems after upgrading. As an aside, Ubuntu is an excellently usable Linux distribution. I use it every day as my primary desktop at work and rarely find myself wishing for more.

Final Analysis

Overall, this is a great laptop. The price was extremely reasonable; it had the features I was looking for; and most features worked with little or no effort. Dell, however, has some room for improving its relations with the non-Windows community.

Jeremy Jones is a software engineer who works for Predictix. His weapon of choice is Python.


Return to the Linux DevCenter.

Copyright © 2009 O'Reilly Media, Inc.