Friday, August 18, 2006

Ubuntu Revisited

Ubuntu LinuxI was able to get my hands on a currently unused Dell Latitude D505 laptop at work. I installed Ubuntu 6.06 on it. I continue to be impressed.

Most everything just works. You press the power key and you're prompted with a menu with options to Restart, Lock the screen, Switch Users, Logoff, Power Down, Hibernate or Suspend. You close the lid, plugged in, and the screen blanks & locks. You close the lid on battery and it automatically suspends. You want to modify the volume: Fn+PageUp/Down (just like Windows). You go on battery & a new icon appears with the amount of estimated battery time left. You move your finger up and down across the right side of the trackpad and windows scroll. I did have to work hard to make the wireless card work. It also took some effort to watch DVD movies & Youtube videos. Keep reading for more on that.

If I didn't already have a Mac, I'd take back my Inspiron 8600 from my wife and install Ubuntu on it.

But I do have a Mac. So, I'll continue to use it. But, I'm going to play with this laptop until it's needed at work again.

First, the wireless card. It's not Linux's fault that I have to jump through hoops to make this work. Blame Broadcom. Blame Dell. Blame Apple and Intel and all of the other vendors using or making hardware with no documentation and limited support for non-Microsoft or Apple Operating Systems. One of the main reasons I'm such a supporter for the OpenBSD project is their commitment to using and supporting documented hardware with non-blob drivers and firmware.

I found many how-tos (many on Ubuntu's forums) about getting my wireless card working. And, by following many of them to the letter, nothing worked. I download many of the linked Broadcom drivers. They just didn't work. I used bcm43xx-fwcutter to "cut" the firmware from the driver. No dice. I tried using ndiswrapper. No dice. Well, not at first.

I downloaded the latest drivers for my TrueMobile 1400 from Dell's Support site. Neither extracting firmware or using ndiswrapper, could I get the card to work. I got furthest with ndiswrapper, but I kept getting an ntoskrnl error in /var/log/messages.

Then, I had an epiphany. Try older drivers. So I found the oldest driver on Dell's Support site. It worked with ndiswrapper:

  1. Create and change to a temporary directory in Terminal

  2. Run: unzip [filename.exe]

  3. Run: sudo ndiswrapper -i bcmwl5.inf

  4. Run: sudo ndiswrapper -m

  5. Run: sudo modprobe ndiswrapper

  6. Assuming no network security, run: sudo ifdown eth1 ; sudo ifup eth1

But, the driver I tested with was from 2003. So, I downloaded all of the TrueMobile 1400 drivers under the D505 section for Windows XP. R94827.EXE worked for me. Between each test, I'd run "sudo rmmod ndiswrapper; sudo ndiswrapper -e bcmwl5" and then follow the process above.

Next came WPA (for my home network). Ubuntu comes with wpa_supplicant. Using documentation from Ubuntu's wiki plus some improvisation, I got it working. I ran wpa_passphrase to help creating my /etc/wpa_supplicant.conf file (with modification found through Google):
# allow frontend (e.g., wpa_cli) to be used by 'admin̢۪ group
  ssid="My SSID"

Then, I ran wpa_supplicant (with "-B -ieth1 -Dndiswrapper -c/etc/wpa_supplicant.conf"). It connected to my Linksys immediately, but did not automatically recognize the need to renew an IP address. "sudo ifdown eth1 ; sudo ifup eth1" fixed that.

To make these changes permanent, I edited the /etc/network/interfaces file (eth1 part shown):
auto eth1
iface eth1 inet dhcp
pre-up /sbin/wpa_supplicant -B -ieth1 -Dndiswrapper \
pre-up sleep 5

Then I rebooted to make sure it would work upon bootup. Success!

To make DVDs and Flash (for Youtube, etc) work, I referred to Ubuntu's User Documentation. It's pretty straightforward.

Finally, to fix one annoyance (click on tap), I edited my /etc/X11/xorg.conf so that the Synaptics Touchpad InputDevice section now looks like:
Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
Option "MaxTapTime" "0"
Option "MaxTapMove" "0"
Option "TapButton0" "0"
Option "TapButton1" "0"
Option "TapButton2" "0"

Another major think I like about the way Ubuntu works: sudo vs. root. The root account is, by default, disabled. To do things as root, you (as the first installed user & a member of the admin group) can run commands with sudo (eg. "sudo vi /etc/passwd"). New users are not added to the admin group by default. To give them the ability to run commands as root with sudo, add them to the "admin" group. Any admin type functions in the GUI prompt you for your password (like sudo).

One last comment about Ubuntu (for this article at least). For writing this document, I typed "man interfaces" to get the syntax for the file. See, on my machine the wpa_supplicant line fits on one line, but for this web page, I wanted to have it wrap across two lines with "\". So, "man interfaces" did what it should. It displayed the man page for /etc/network/interfaces. From my experience with Redhat, that is not always the case. No man page for ifcfg-eth0, ifcfg, ifdown or ifup. There were some files in /etc on my Ubuntu machine that did not have man pages, but many did. Many more, it seems, than Redhat.

Yes, that was a lot of work to get my wireless card working (especially). But, I could definitely see buying a known compatible laptop with a working wireless card, loading Ubuntu on it for my Mother-in-law. Once I got it set up, it'd just work. For everything she'd need. Firefox, Email, DVDs, Digital Pictures, ... Don't worry, family, I'm not going to rock that boat... yet.

Finally, I should add that I posted this from Firefox, wirelessly, from Ubuntu.


  1. How sad is it that I'm posting comments to my own posts. :)

    I made my life a WHOLE lot easier. I opened /etc/network/interfaces and commented out everything but lo. Then I installed "Network Manager". Rebooted and nothing worked!

    Nothing to fear though. I clicked on the new network icon on the upper-right part of the screen. I chose "Connect to Other Wireless Network". I entered my SSID, selected WPA and entered my passphrase. I also selected TKIP from the list. I was then, again, prompted for my passphrase and again choose TKIP. Then, I was prompted to password protect my Gnome Keyring (ala OS X). Then... I was connected. Much better than editing files (well, I don't mind editing files, but I'm sure my Mother-in-law wouldn't like it).

  2. So... I like talking to myself.

    I rebooted after doing all that in my first comment. It did not reconnect automatically. I went through the motions again and was then prompted for my keyring password. Then, I was connected.

    This is acceptable to me but I would like it to detect the network and connnect to it without my having to type my password like SSID & my password to my keyring.

  3. Well I'll talk to you! Tried the network-manager-gnome with _everything_ and nothing worked until I took the long, old route... just been having a slight problem with the pre-up line in the interfaces file bit that _should_ be the last hurdle!

  4. i have just got a d505 and put ubuntu on iy. almost everything works fine without me doing anything!! However I cannot get the DVD player to play movies.. I need kiddy step instructions as I am new to linux ..
    thanks ron ( I tried installing and running VLC player but no dice it just flashes a screen then nothing)