jordan | grep thought*

I recently switched to the awesome window manager in my Ubuntu 12.04 installation. It is a fantastic tiling window manager! I decided to avoid as much gnome as possible, which means certain things that worked in Unity (like my suspend hotkey) need a bit of tweaking. Here is how I got the suspend hotkey working (modified from this answer):

  1. Run acpi_listen in a terminal
  2. Press hotkey (e.g. Fn+F4) and see what the result is. In my case:

    ibm/hotkey HKEY 00000080 00001004
    
  3. Run sudo vim /etc/acpi/events/sleepbtn and change:

    event=button[ /]sleep
    action=/etc/acpi/sleep.sh
    

    to:

    event=ibm/hotkey HKEY 00000080 00001004
    action=/etc/acpi/sleep.sh
    
  4. Finally, sudo service acpid restart

Read More

TL;DR One method of getting external monitor support in Ubuntu on Lenovo W520 with Nvidia Quaddro 2000M:

  1. Install the lastest Nvidia drivers from “X Updates”

    sudo apt-get-repository ppa:ubuntu-x-swat/x-updates
    sudo apt-get update
    sudo apt-get install nvidia-current
    
  2. Switch to discrete graphics in your bios

  3. When the grub bootloader displays, type ‘e’ to edit the boot options and add the nox2apic option to the kernel. Type Ctrl-X to boot

  4. If Ubuntu boots correctly, permanently change your kernel boot options in /etc/default/grub: sudo vim /etc/default/grub Change (for example):

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    

    to:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nox2apic"
    
  5. Update /boot/grub/grub.cfg by typing:

    sudo update-grub   
    

The Long Version

My laptop is a Lenovo W520 with switchable graphics based on the Nvidia Optimus technology. Recently, I installed a 240 GB SSD and replaced my CD-ROM with a second hard-drive bay for my old HDD. Instead of ghosting my old Win7 OS onto the new drive, I opted to upgrade to Win8 and dual boot with Ubuntu 12.04 (Precise). The installation went fine and everything worked in Ubuntu, except that the OS would not detect additional screens when I put the laptop on my docking station. A brief search came up with the obvious reason: Ubuntu was using the integrated Intel graphics card by default and the discrete Nvidia card must be used for external monitor support on this particular machine (at least with HDMI or DVI; didn’t try VGA).

At first, I tried simply installing the proprietary Nvidia drivers to see if that would solve the problem. Had I done some research first, I probably could have saved myself some trouble! There are reasons why projects like bumblebee exist – there is no native support in Ubuntu for Optimus. Installing the Nvidia drivers, running sudo nvidia-settings, and rebooting just resulted in a 640×480 desktop and a lot of error messages. To fix THIS problem, I removed the xorg.conf file from /etc/X11/ and ran sudo service lightdm restart from a virtual console. This got everything working normally again.

After much searching, I came across a blog article that described a similar scenario, only with the Lenovo W530. Before following the instructions there, I purged the proprietary drivers with sudo apt-get purge nvidia*. Then:

sudo apt-get-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current

I rebooted, went into the bios and selected “Discrete Graphics” under Config -> Display -> Graphics Device, hit F10, booted into Ubuntu and ….. there was nothing. No splash screen, no text, no cursor…just purple.

I won’t bore you with the multitude of things I tried after that. I did manage to find the solution in the comments of the previous tutorial. Because of a bug in the Thinkpad BIOS, the nox2apic kernel boot argument has to be provided. So, I first tested by hitting ‘e’ when the grub bootloader came up, added the argument, hit Ctrl-X and Ubuntu loaded without a problem! The resolution was even correct! I then put the laptop on the dock and it was able to detect the external monitors. To make the kernel boot parameter permanent, I edited /etc/default/grub and added nox2apic to GRUB_CMDLINE_LINUX_DEFAULT. Then ran:

sudo grub-update

This solution requires me to constantly switch the graphics card in the BIOS when I go between my Win8 and Ubuntu systems, which is a bit frustrating. There is a possible solution with bumblebee that I will try soon. I’ll let you know how that goes.

Read More