Dec 23

Ubuntu Linux on the Lenovo U160

Category: Linux,Ubuntu   — Published by tengo on December 23, 2010 at 5:05 pm

Ubuntu Linux running on a Lenovo U160

Here is my log of what I did to get a decently running Ubuntu Linux install on a Lenovo U160 11" subnotebook.
Now with updates for Ubuntu 11.04 (scroll down)!

1. Display trouble - black screen on boot

As of this writing, a specific bug-fix addressing issues with the U160's display panel has not yet propagated into the main branch of Ubuntu 10.04 or 10.10. The main bug tracker for this is  here.

A quick fix is to disable i915 support by kernel switch. Do this on the grub boot loader menu: Press "e" to edit the current switches the boot loader passes to the kernel. Then add "i915.modeset=0" after "quiet splash". This will boot you into an X session with basic vesa compatibility mode only. The screen is distorted, but you are able to operate your system. You might add this hack to the /boot/grub.cfg file.

Still, a permanent fix is to get a patched kernel. At the moment, compiling your own is the only option to get one. But the procedure is not that complicated. I followed this guide here. And added Chris Wilson's patch from the freedesktop bugtracker.
As a side-note: the last steps in the compilation-guide, to update-initramfs and update-grub, were performed by the dpkg command automatically. The patch works flawlessly.

2. Networking

The wireless networking device built into the U160 is a Broadcom 4313. Ubuntu offers to install proprietary drivers, which work well. Be careful with disabling the Bluetooth feature. As I understand it, the Broadcom chip is a dual Wifi+Bluetooth solution. If you switch off Bluetooth, for example with the switch on the right side of the case (which is for all wireless networking, btw.), Wifi is disabled too. I haven't yet decided if that's a feature or a problem. But it's good to know if you think you are disabling Bluetooth alone but effectively turn-off your wireless LAN connection too.

Wired LAN connections are handled by an Atheros AR8131 gigabit ethernet device. I can't remember if it worked right after installing Ubuntu 10.04, but I remember a bit of trouble. I used an USB Ethernet adaptor to circumvent this during install and upgraded to Ubuntu 10.10 quite quickly after this. Not much later, I found the Atheros working okay and it does so without a problem or any patches/hacks under 10.10. Could be my Ubuntu 10.04 LiveCD was a bit dated and more recent LiveCDs, even 10.04, wouldn't make a single problem with AR8131 support.

Getting your head around the GNOME standard networking-manager might be a bit of a challenge, as it requires patience: Changes might not take effect immediately, Wifi networks available bubble up with a certain delay, etc.
But after trying guessnet halfway, reverting too soon as success seemed far away, I reverted to using the default networking-manager. Then, mixing in wifi-radar, which many think contradicts usage of the networking-manager, did not hurt. Actually, the current setup: networking-manager for most usage scenarios, wifi-radar for the occasional scan of who's around, works quite well so far.

Some useful commands to peek into the networking configuration and debug stuff are:

  • lshw
  • ethtool <device name, ex: eth0>
  • lspci |grep -i net
  • sudo iwlist scan

3. The integrated camera

Your U160's integrated webcam is not working? Remember: you need to switch it on first! In contrast to wireless networking there's no switch for that on the side of the case, but there's a keyboard shortcut to turn camera on/off. Press Fn+ESC and Ubuntu should report a new device being recognized. The IdeaPad reports the camera with "uvcvideo: Found UVC 1.00 device Lenovo EasyCamera" in dmesg.

Open a terminal and fire up gstreamer-properties. In the video tab, you should register your camera with the Video for Linux v4l2 driver. Pressing the "Test" button will bring up an image from the webcam (showing you! 😉 ) and the small LED beside the webcam should be lit, indicating its usage.

camorama is a nice tool to test-drive your camera. cheese might help you with the same task, but I found its GUI reacting a bit slower.

As a side-note: I am unsure how reliable the activation LED besides the camera is in indicating it is being used. And if the old "tape the camera to avoid someone peeking" is still needed.

cameramonitor is half-useful for me. It comes up in the task-bar when the camera is active, but is invisible when its not - so it doesn't help you in confirming that the camera is actually off. On the other hand, this behavior is less intrusive and should suffice for the less paranoid. Still, as the Lenovo has this little LED lighting up whenever cameramonitor comes up as well, it's doubtful if you need yet another camera-active indicator on the task-bar, especially as they seem to gather status-info from the same source, asking the device if it's being used or not. What would be useful is an indicator showing the user if the camera is actually there at all (being switched on via keyboard shortcut) or if it is not.

4. Multi-boot: Ubuntu, Windows 7 and OneKey Recovery all managed by grub

Your Lenovo U160 comes pre-installed with Windows 7, at least in my case. One of the first things for any Linux user is surely entering the BIOS, setting it to boot from external CD/DVD, plugging in a drive and then booting into a liveCD like Ubuntu offers them. I did it this way.

Then I used GParted to downsize the Windows7 partition, freing up space for the Ubuntu install.

What I've learned after this is that this partition resize will render the Windows 7 partition non-working and one should have a MS recovery disk at hand... Interestingly, Lenovo's OneKey Recovery is robust enough to stay instact. Essentially it is a small Windows Vista partition which might come in handy, so I kept it.
What I don't know - as I didn't dare to try - is what would happen if I would use it to "recover" my Windows 7. It says it would revert the system's partition to the original state. Would that mean resizing/deleting my added Ubuntu install?

Anyway, as the GParted documentation has hints on how to repair the "damaged Windows 7" partition ("14: After resizing my Windows 7 or Vista partition, my computer won't boot. How can I fix this?"), I chose this option and downloaded a recovery disk image from Microsoft.

Having multiple OSs on the machine does mean that each time the U160 boots a boot loader will come up. On newer Ubuntus that is grub 2 with its configuration in /boot/grub/grub.cfg and a slightly different config file format.
You can't really hide grub2's menu anymore, but you can ease this annoyance a bit by lowering the timeout to one or two seconds. Or you can disable the OS prober completely for now, as you might boot into Ubuntu anyway in 99% of cases. This blog post has the simple commands to do so. (Set GRUB_DISABLE_OS_PROBER to true in /etc/default/grub and run update-grub.)

5. This and that

Active protection System

IBM/Lenovo notebooks expose a feature called APS, which is short for Active Protection System. In case of sudden acceleration of the device, a sensor tells the harddrive to park its heads, to prepare for a drop or similar and protect the drive from being damaged.
All Windows installs come with a small software app which provides the needed link between the sensor and the drive, issuing the command to park hdd heads. On Linux, out of the effort of a small group of developers, there's a mainline kernel driver to provide a replacement under *nix OSs. It should be active under Ubuntu, but I haven't checked yet. You can read about APS support under Linux here.
In general, there are two flavors of APS support under Linux, the standard mainline kernel module - which might not work on newer machines - and the hdaps module. Although the HDAPS site lists an intimidating number of exceptions and workaround, as bottom line it seems to recommend using the module/driver offered by tp_smapi. So I've installed the related package as in this guide.
This guide provides some insight gained from an install on an 8.x Ubuntu including how to check if everything is working - I found most things mentioned there have changed names since then.

"Special Keys"

The special keys for brightness and volume were just working out of the box, including the display overlay - I think the BIOS adds these anyway. So no software/OS support needed here. The media keys on the F-keys, like "play", "stop" etc. are not working - but I don't need them. Adding the tpb package via apt-get was no use for me. It claims to be a "program to use the IBM ThinkPad(tm) special keys", but either I didn't try it correctly or it simply does not work on the U160.

The touchpad: MultiTouch, two-finger horizontal scrolling, etc.

The Synaptics touchpad on the U160 is completely supported under Ubuntu 11.04, 10.04 and probably earlier Ubuntus as well. Go to System > Prefences > Mouse > Touchpad to configure it the way you want. If you are tired of the default vertical-scroll at the right edge, you can easily set it to Mac OS like two finger scrolling for combined vertical and horizontal scrolling. I personally have disabled tapping for mouse-clicks as it lead to far too many unwanted folder moves in Nautilus... 😉

Related reading: Ubuntu docs Synaptics touchpads.

Displaying the battery status in percent, charge status, etc. (things related to battery & power)

Having the power plug plugged-in and then removing it brings up the Power GUI overlay and tells you how much battery remains in percent. Works out of the box. Still, what's missing is a feature to hover the mouse of the battery icon and getting this percent reading. You can only roughly estimate from the icon, if battery is empty, half full or more or less full. BTW: The default bat icon is shown through the notification applet for the GNOME panel, its settings are done in the Power Manager, including if the bat icon should show on the notification bar.

A great project called BatteryStatus addresses issues with the default applet and offers a replacement, although this is not yet in the main line. Install it with: sudo add-apt-repository ppa:iaz/battery-status && sudo apt-get update && sudo apt-get install battery-status. As great as it is, it will also inform you if you are using both icons, from Power Manager and battery-status, and offer you to remove the other from the Panel.

The little acpitool, available via packages/apt-getis a nice tool that summarizes everything up, but it's command-line only. Calling it with acpitool -e gives you a more verbose output, including an interesting readout of the "last full capacity" in relation to the battery's design maximum. It tells me that, so far, after about 2 charging cycles, I wasn't able to charge the bat to it's maximum - we'll see how this develops.

A more common solution to access this data - but also only via command-line - is to use acpi, also available via the repositories.After installing, calling it with acpi -ab will give you bat readouts, the -V switch is "everything".
Yet another bat tool is ibam, which claims to be more intelligent about its estimates.

As for command-line, I still have to decide which one is best. The clear GUI/ GNOME winner is battery-status!

Ubuntu 11.04on the Lenovo U160 (Natty Narwhal)

I waited quite some time to dist-upgrade my well-running 10.10 install to 11.04 Natty in order to make sure the dreaded display-bug would have been solved and I could use an off-the-shelf kernel.

Upgrading today (Aug 26th,  2011) the machine went through the upgrade without glitches and bootet properly with the display working out-of-the-box. As reported with all ab Kernel 2.6.38 or newer kernels. One thing that broke was wireless networking (see below) and the machine takes longer to boot (about +20 secs).

Getting Wi-Fi running on the U160 under Ubuntu 11.04

Wireless networking seems to be broken at the moment for the specific broadcom 80211 driver Ubuntu uses on the U160. It is releated to the acer_wmi kernel module that handles powering WLAN up and down in relation with acpi power management.

I was able to fix it quickly by blacklisting acer_wmi  as various sources suggested.

This worked for me (via):

sudo nano /etc/modprobe.d/blacklist.conf
Then add:
blacklist acer_wmi

So far I haven't run into random system freezes or crashes.
The following solution also blacklists the broadcom 80211 module which I remember my kernel complaining about anyway. I publish it here for completeness (via, relates to Fedora 15!, untested!):

Make sure you've got broadcom-wl and kmod-wl installed

Edit /etc/modprobe.d/acer_wmi:

blacklist acer_wmi
blacklist brcm80211
install wl /sbin/modprobe --ignore-install wl;  /sbin/rfkill unblock all; /sbin/modprobe acer_wmi; /sbin/rmmod acer_wmi;  /sbin/rfkill unblock all

11.04 Display trouble - black screen after the lid was closed

Having the screen safer come up doesn't seem to be a probem. So far the system came back every time. But it's a different story when you close the lid. Especially when the lid is closed for a longer time, when you open it up again the screen is black but the backlight is on - just like with the original U160 Ubuntu display trouble.

Related posts?
X freezing after lid closed
Fix: Screen Freezes
Acpi Screen Locks
No! At least Fix: Screen freezes didn't resolve my issue (switching compiz to not Sync to VBlank).

At least the developer community is aware of the issue. We'll see where it leads us and when this issue gets resolved. WIP!

Update Sept 05, 2011:
The same happens when you send the machine to suspend. So it is about the U160 not coming back after suspend! (Closing the lid obviously suspends the machine after a certain timeout). But it is still alive, kind of. It still sends signals to the external VGA port, so you can switch to one of the consoles with CTRL+ALT+F1, for example, and poweroff the machine or save files via CLI.

Does 11.04 burn faster through the battery?

This post indicates that Ubunt Linux11.04 uses more power than the previous release. I haven't yet confirmed this myself, but that would really hit me as the 2,5 hrs battery life of the U160 are on the lower end anyway.

Bring the task bar icons back

In it's quest to tidy up the desktop, Unity introduced a new regimen to the right-corner status bar icons like the network connection, rubbish-bin etc. There's a ruleset in gconf where you have to explicitly "whitelist" icons that are allowed to show up in the task bar. For example it "blacklisted" our little battery icon installed under 10.04. It's a bit of an annoyance. Maybe you'd like to do what I did: I just reverted to the "Classic" desktop by setting my default login to "Ubuntu Classic". Welcome back bat-icon. Bye bye Unity...

11.04 observations

I am unsure if this relates to the U160 or just my install of Ubuntu, but I had trouble with the wireless netwoking switch/toggle on the status bar. After every boot I had to manually switch WiFi on - it just wouldn't remember my last setting. Now, with 11.04, this issue is gone. Ubuntu even reports that it senses wireless networks around and if I had wlan switched on before my last shutdown, it remembers the setting after reboot.

A note to the Lenovo developers

The U160 is a great machine. Apart from some things which can't be made better in this class - like the 2.5 hours of battery life - there are other details that could've been designed better:

Why in the world is the touchpad textured??! After hourse of moving your index finger across, you might get a sore fingertip. Just make it smooth next time, please.

When working in complete darkness the display backlight is just too bright. Wouldn't it be great if the user could dim the display from 100% brightness to 0%?

The "Fn" key and - for example - "Volume +/-" are too far apart. When you operate the keys with just one hand it is not possible to decrease volume or dim the backlight.

A matte / non-glare display option - the U160 is only available with a glare display. A pitty.