H. Tin Kong

Arch

ThinkPad X200s -- Dualboot Windows 7 and Ubuntu 9.10 with ThinkVantage button preserved

(Update: I used the same procedure on a T400 with success)

Middle scroll button


Play DVD and other media files on Ubuntu


Flash problem on 64 bit Ubuntu


Comments

I just bought a ThinkPad X200s from a great Lenovo deal. The main reason of this purchase was Windows 7 yet the result was not too impressive nor satisfactory. As a Linux user for a while, I would like to use Linux on the blackbox. However, the biggest concern is the ThinkVantage button (one button recovery) which is the best part of ThinkPad. Especially X200s has no optical  drive, the blue button becomes critical.

In order to preserve the ThinkVantage blue button, it is very important to keep the Master Boot Record (MBR) intact. Do not modify the MBR in any case. Be sure to create a recovery media before you start in case you mess up. If for any reason you could not make the recovery media in the first time, ThinkPad will not allow you to create the second time.  In that case, call Lenovo to order a free copy of recovery DVDs if you are under warranty. That was exactly what I did.

Please do so as your own risk.

(1) Do a factory restore with the Lenovo RR tool and then uninstall all bloatware. This  
     step is not required tho I want to reduce the size of Windows 7 before the partition
     is shrank.

(2) Shrink the Windows partition to a desirable size (40 GB in my case). Right click
     computer and choose Manage. Go to Disk Management, you will the partition table.
     Right click the windows partition and choose shrink.
     I knew some people used some kind of Linux live CD (e.g. gparted) with success
     (update: I tried gparted on a T400 with vista and it did work perfectly). I did not
     want to fail at the very beginning, so I chose to use the built-in partition tool in
     Windows 7 (Probably Vista too).

(3) After the partition was shrank, I reboot to try the ThinkVantage button and it was
     working. Then I go ahead and create the Ubuntu 9.10 bootable USB. I used a tool
     called UNetbootin. It is an extremely handy tool for creating bootable USB. It
     even downloads the Ubuntu 9.10 ISO for you and then create the bootable USB
     automatically.

(4) Boot the X200s with the Ubuntu 9.10 bootable USB. Before you go to the
     installation, I suggest you backup the MBR. I did that by using the following
     command on the Live CD USB
dd if=/dev/sda of=mbr.img bs=512 count=1
        In case anything goes bad, you can restore the MBR by
dd if=mbr.img of=/dev/sda bs=512 count=1
     You can then start the installation process. Go throught the steps on the
     installation as usual. When you get the partition section, you need to decide how
     you want to organize your Linux. I created partitions for /, /usr/local, /home and
     swap. Copy down the device name of the / partition. In my case, my /
     partition is /dev/sda7.
     Since I would install some third party softwares such as Mathematica, I created a 
     seperate partition /usr/local/ for those. It is not necessary to make a partition for  
     /usr/local/, but I don't want to reinstall them everytime I do a clean install of
     Ubuntu.

(5) This is the most crucial part of the installation!! You need to tell Ubuntu NOT to
     install GRUB on MBR.
     After the partitions are setup, you will see a dialog box that shows all the
     installation setting and partitions setting. Do not click "Forward" at this stage yet!! 
     You will find an "Advance" button above  the "Forward" button. Click it and enter
     the device name of the / partition that you copied on step 4. That tells Ubuntu to
     install GRUB on the bootsector of the / partition so that the MBR will not be altered.

(6) After the installation, you should reboot to Windows 7. Again, I tried the blue
     button to make sure. Now, you need to use the windows bootloader to boot the
     Ubuntu. To do that, download and install EasyBCD. I used the version 2.0 Beta
     built 76 (you need to register before you can download the beta version) which
     worked fine with Windows 7.

(7) In EasyBCD, you can add an entry to the boot menu. Click "Add/Remove Entries"    
     button on the left panel, then choose Linux. On the "Type" pull down menu, choose
     Grub legacy. On "Name", choose Ubuntu. On "Drive", choose the partition that
     GRUB was installed i.e. the / partition. Note that the partition number here is
     different from the number of the device name on Linux. E.g. my / partition is
     /dev/sda7 but the partition number on EasyBCD is 6. I recognised the / partition
     by the partition size. You may ask why choose Grub legacy instead of Grub 2 which
     is what Ubuntu 9.10 suppose to use. Well, you are not alone. When I chose Grub
     2, the pull down menu of "Drive" show nothing. Anyway, Grub legacy worked just
     fine.

(8) Go to "Change Setting" to set the boot time as the default value is 0, and the
     default operation system. I set the default to ubuntu and boot time to 5 which
     means it will boot Ubuntu after 5 sec.

Everything is set. You can reboot and try the blue button. It should be working. You should see the windows boot menu. Choose Ubuntu to boot to Ubuntu 9.10. I install the startup manager from Synaptic to set the GRUB boot time to 0 for a smoother bootup. Now you have an incredible Laptop with two incredible operating systems and the incredible ThinkVantage blue button. Enjoy !!

Middle scroll button

To enable the middle scroll button, create a new file called /etc/hal/fdi/policy/mouse-wheel.fdi with the following contents:

<match key="info.product" string="TPPS/2 IBM TrackPoint">
 <merge key="input.x11_options.EmulateWheel" type="string">true</merge>
 <merge key="input.x11_options.EmulateWheelButton" type="string">2</merge>
 <merge key="input.x11_options.XAxisMapping" type="string">6 7</merge>
 <merge key="input.x11_options.YAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.ZAxisMapping" type="string">4 5</merge>
 <merge key="input.x11_options.Emulate3Buttons" type="string">true</merge>
</match>

Then remove the cache file fdi-cache by doing

sudo rm /var/cache/hald/fdi-cache
sudo /etc/init.d/hal restart
sudo /etc/init.d/gdm restart

Instead of restarting hal and gdm, I restarted the computer.

Play DVD and other media files on Ubuntu

Ubuntu does not play video DVD by default. The necessary package is libdvdcss2. I wrote a bash script to install it and the dependencies. Download the script here. Then change directory, chmod to executable and run it as root.

sudo ./playDVD

If you want to install other codecs for music and viedo files, you can download a bash script here. Do the same thing as above and then run,

sudo ./nonfreecodec

It will install pretty much all codecs you needed for movie files. Now your Ubuntu is multimedia ready. It also installs unrar and a flash plugin.  Nonetheless, if you are using a 64 bit Ubuntu, that flash plugin is problematic. It has control problem over flash webpage. This could be fixed by getting a 64 bit flash.


Flash problem on 64 bit Ubuntu

The flash plugin you got from the repository or the package above is 32 bits. If you go some flash webpage especially some game page, you will find trouble controling the page. It will have no response when you click on objects. I searched over the internet for while and finally I found a solution on the ubuntu forum. The solution is to remove all previously installed flash pluggins and then put libflashplayer.so in /usr/lib/mozilla/plugins/. There is a script on the forum that does all the things but the script does not remove the flash plugin from the non-free-codec as I mentioned above. Thus I made a little modification on the script to accommodate this issue. The modified script can be downloaded here. Again, run it as root

sudo ./Get64bitFlash

 
If you ever run nonfreecodec, you have to run Get64bitFlash afterward in order to overwrite the flash plugin.
hit counter

4    Comments


Thanks for the tips and enjoying my Thinkpad w/ Ubuntu.  Can you fix the permissions so I can download the scripts on your site?  I get a 403 Forbidden error.
Phil
-Sorry about that. It is fixed now.        Tin

I wished I had read this article before my attempt at installing a dual boot system on a Lenovo desktop with a Windows Vista Home Basic installation.

I can see the Windows partition in Ubuntu, but when I try to boot into the Windows Loader option in Grub2, Windows will hang. Do you have any suggestions?

rewarp
- The main idea of the article is to use windows boot manager instead of Grub2 to boot, so that the mbr can be kept intact. If you use Grub2 to boot, that means your mbr has been changed. Your blue recovery button probably isn't working now. To me, I would just backup all important files and restore with the recovery DVDs, since yours is a desktop. Then follow the article to install ubuntu.        

On the other hand, if you don't care about the blue recovery button, you can try to reinstall Grub2 to see if it can get the correct windows partition. You can go to the following link for instructions,


One last thing, try to see if there is another windows loader. It happened to me once, I had to scroll down the menu to see it.  

Good luck.            Tin
Thank you for the tips. I will give it a shot.
rewarp

I just tried the howto on getting HAL and GDM to play nice with lenovo's middle scroll key. And it worked like magic. I'd like to say thanks for the advice.

Unfortunately I'm sending my lenovo back to the shop because somewhere along the line I lost ThinkVantage functionality. I'm looking forward to your guide on installing Linux (I use Mint) and Win7 while retaining ThinkVantage functionality.

Franklin
- You are very welcome! The install guide should work for other Linux distributions.        Tin


:
:


-------------------------------------------------------------------------------------------------------
Mandated Disclaimer: The content and opinions expressed on this webpage do not necessarily reflect the views of nor are endorsed by the University of Georgia or the University System of Georgia.