MikeyP.com MikeyP.com

Linux on ThinkPad X40

Why Linux

As long as I don't run any major background apps such as Desktop Search or Anti-Virus, WinXP works pretty well on my circa 2004 ThinkPad X40. My company uses Exchange server with Outlook for all corporate communication and scheduling, and the Thinkpad + XP works as a fine client for this system.

However, on a laptop, responsiveness is key, and XP loves to "hang" when encountering issues with network connections. Since I'm fairly mobile with my laptop (the actual point of having one, no?), net connection "hangs" happen to me frequently. Compared to XP, Linux is quite adept at handling network issues. So in hopes of better performance, I installed Linux on my ThinkPad.

Installing and Configuring Linux

Linux laptop installations have come a long way in the past few years. I grabbed my favorite distro, ZenWalk 5.0, and partitioned the drive for dual-boot. Amazingly, ZenWalk installed without any major issues for me. Within 30 minutes, Linux with X was running fine. I had to make sure to install the optional Intel ipw2200 WiFi drivers to get wireless to work, but once installed, WiFi worked automatically. Impressive.

More effort was required to get the system to act like a laptop, however. This included getting the system to respond to the built-in ThinkPad hotkeys and managing battery life.

ACPI support in the latest 2.6 kernels is quite robust, and along with the included thinkpad_acpi kernel module, captures all of the ThinkPad button events. I just watched the ACPI logs as I pressed every button, closed the lid, and undocked from the docking station. I then added those events to /etc/acpi/events, and set them to launch appropriate standby/suspend/undock scripts. ZenWalk 5.0 includes a very nice standby/suspend script that worked perfectly once I figured out all of the power management issues (see below). I also installed a handy app called ThinkPad Buttons, aka tpb. tpb monitors the ThinkPad ACPI events, and draws overlayed volume graphics and screen brightness graphics in X, similar to what you would see in Windows.

Battery life and power management were a bit more tricky. The ThinkPad includes various power management features such as Intel SpeedStep, WiFi power adjustment, screen brightness control, and audio power saving. To take advantange of SpeedStep, I added the included acpi-cpufreq kernel module. I then added the following commands to /etc/rd.d/rc.local:

# power management tips from thinkwiki.org
echo 5 > /proc/sys/vm/laptop_mode
echo 0 > /proc/sys/kernel/nmi_watchdog
echo Y > /sys/module/snd_ac97_codec/parameters/power_save
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
# disable wake-on-lan
ethtool -s eth0 wol d
# lower wifi power level ("BATTERY" level)
iwpriv eth1 set_power 7

# launch thinkpad buttons (for OSD)
# needs /dev/nvram to be writeable
chmod 666 /dev/nvram
/usr/local/bin/tpb -d

And added the following line to lilo.conf:

addappend = "hpet=force usbcore.autosuspend=1 acpi_sleep=s3_bios,s3_mode"

The very latest kernel (2.6.24, as of this writing) was required for best battery life. After my changes, I used the included XFCE CPU Frequency Monitor and Battery Monitor apps to unscientifically measure Linux battery performance to be within 10% of XP's battery life. Fine.


My company requires the use of a Cisco VPN to log in remotely as well as log in to the local wireless network. The open source vpnc client app worked perfectly with our VPN server, requiring only two lines in the config file, and the addition of the included tun kernel module.

Using smbmount, I could map and log in to file shares on the corporate network.

The included web browser IceWeasel (FireFox) ran fine, but I replaced it with Opera. Opera is significantly faster than FireFox on the ThinkPad. Opera also includes a usable mail client, so used it instead of the slower IceDove (Thunderbird) mail client. Unfortunately, we use Windows Server-based Wikis on our corporate network, which require NTLM [WikiPedia] authentication. While the Windows version of Opera supports NTLM, the Linux version does not. Fortunately, FireFox does have Linux NTLM support.

MS Office is a superb application suite that I use frequently. I rarely use MS Word these days, but often use PowerPoint and Visio, and constantly use Excel. For me AbiWord is a fine enough replacement for MS Word, and Inkscape, Xara, and Scribus are all suitable (and maybe superior) alternatives to Visio. But without a VBA-compatible scripting environment (or even conditional formatting) Gnumeric is not a replacement for Excel. I never tried any alternatives to PowerPoint, nor did I try using the external monitor connection. I also didn't bother trying the latest version of OpenOffice.

And alas, there is not even a suitably close replacement for Outlook/Exchange on any platform, let alone Linux. Novell/Gnome Evolution is a cute visual imitation of Outlook, but isn't anywhere near the same level of performance and feature set, with very primitive (and often broken) Exchange support. Exchange Outlook Web Access is functional, but the 2003 version my company uses has a terrible UI, and as with most browser apps, poor/non-existent integration with host environment. I tried installing Outlook in CrossOver (WINE [WikiPedia]), and was shocked that it actually worked. But it was incredibly slow - far too slow to be usable.

I considered running XP in a virtual machine with VirtualBox, but abandoned the idea upon recollection of how slow a VM runs on older single-core CPUs.

Terminal, not Client

I realized that without MS Office and Outlook, Linux cannot operate as a suitable client on our corporate network. However, by using rdesktop, a Windows Terminal Services client, I could remotely access and control my corporate desktop machine from Linux. rdesktop is fast and stable, with the only noticeable downside being that it doesn't render fonts with anti-aliasing (at least that I could figure out). Linux + rdesktop allows the ThinkPad to be a solid terminal on the corporate network, which, at the end of the day, provided a solution for my XP network connectivity issues.


While Linux mostly works fine on the ThinkPad, it was a bit too much work to get it up and working. And although it works as a fine Terminal, I prefer to be able to work offline with local applications. So for now, I'm still running XP most of the time, and dual-booting over to Linux whenever XP starts to frustrate me.

But this laptop is near the end of its days. I'm anxious to see how things work on my next laptop [macbookair, macbookair, usingthemacbookair].

Read more stories like this one...


comments powered by Disqus

When you use smbmount do you map with IP address or netbios name?
I'm a Zenwalk user myself using vpn-connect to connect to my workplace, but I still haven't got the servershares to work.

posted by: Sigg3.net | URL: sigg3.net

I mapped the drive via the server name, but I also had to specify the actual shared volume, such as:


In addition, I had to pass my domain/username and password via the mount command line.

posted by: MikeyP | URL: www.mikeyp.com