NOTE: This project is no longer maintained. These instructions are available here for archival purposes.

Optimal Ubuntu Graphics Setup for Thinkpads

Motivation

This setup, combined with thinkdisp will get you:
1) Multiple Monitors
2) Working 3D Acceleration on all displays (so compiz effects work)
3) Power saving when mobile (Nvidia card off)
4) Safe updating without killing the multimon setup
5) The ability to use VT-x (which has to be disabled in BIOS in discrete-only mode due to a bug)

If you’d like to learn more about how the graphics are wired and why these workarounds are necessary, check out Zachary Sunberg’s post here. None of this would have been possible without his original guide, which can be found in the sources at the end of this page. Additionally, if you’re running Arch Linux, check out Gordin’s adaptation of this guide for Arch.

For guaranteed success, you should follow these instructions to the letter. I’ve been able to successfully perform them multiple times on a clean install of 12.04 x64 on my W520.

Instructions

First, go ahead and install Bumblebee. This gives you the ability to switch the nvidia card on/off in Optimus Mode (make sure this is set in BIOS).

Once that’s done, reboot. Next, you’ll install some dependencies for later parts.

Now, patch and install the Intel Graphics Driver to allow it to support a virtual display. (Thanks to liskin for the patch)

Reboot again. At this point, if you execute xrandr in terminal, you should see two displays listed, one of them will be named VIRTUAL. This indicates that everything has installed correctly up to this point. Next, you’ll need to install screenclone, which copies the VIRTUAL display to your external display. (Thanks again to liskin, the developer of screenclone).

Now, as explained here, you’ll need to make the following modifications to /etc/bumblebee/bumblebee.conf:

You can see a copy of my bumblebee.conf for reference here. If everything seems to have installed without error, reboot one last time. Now connect your VGA or Displayport monitor and do the following: (thanks to RCSIRIUS in the comments below for confirming Displayport functionality)

A few seconds after running screenclone, you should have a functional external monitor! If you get a flashing cursor for more than about 5 seconds, something is wrong with your configuration files above, try following the guide again.

Next, we’ll hold the xserver-xorg-video-intel package so that you can update safely without killing your multimon setup.

Finally, to make this usable as a daily-driver, I suggest installing thinkdisp, an indicator applet I developed that automates display on/off, nvidia card on/off, and status checking. You can find the installation guide here (don’t worry, it’s much simpler than this).

Sources

http://zachstechnotes.blogspot.com/2012/04/post-title.html
http://zachstechnotes.blogspot.com/2012/01/tri-head-display-on-linux-thinkpad-w520.html
https://github.com/Bumblebee-Project/Bumblebee/issues/122
https://help.ubuntu.com/community/PinningHowto#Introduction%20to%20Holding%20Packages