Get rid of a graphics problem in Ubuntu on Thinkpad A21P

by Peter Jaric

Update 2:

David Rees has filed a bug report of this issue: (see his comment further down).


I have updated this guide for Ubuntu 11.10 Oneiric Ocelot. These updates are marked with Ubuntu 11.10 where they occur.

I wanted to see if an old IBM Thinkpad A21P could be put to use and installed Ubuntu (9.10) on it. The installation went well, but when X started and displayed the login screen, the graphics were messed up.

Some googling finally solved this, but since I had to collect information from several sources, I thought I should sum it up in one post.

The problem is a known bug, and there even is a fix for the problem in the bug report, provided by Longwing. Add these lines to your xorg.conf file in the appropriate place (the Monitor section):

HorizSync 31-77
VertRefresh 50-77

Modeline "640x480" 27.96 640 656 720 864 480 480 485 501
Modeline "800x600" 43.68 800 816 928 1072 600 600 606 626
Modeline "1024x768" 71.39 1024 1040 1216 1400 768 768 776 802
Modeline "1152x864" 90.48 1152 1168 1384 1568 864 864 873 902
Modeline "1280x960" 111.82 1280 1296 1552 1736 960 960 970 1003
Modeline "1280x1024" 119.28 1280 1296 1552 1736 1024 1024 1035 1070
Modeline "1600x1200" 160.16 1600 1616 1968 2208 1200 1200 1212 1253
Modeline "1600x1200" 167.23 1600 1616 1968 2208 1200 1200 1212 1253

This is all very well if you know how to do that. I haven’t been editing the X configuration files for a while, so I actually had to look it up.

First off, we need an xorg.conf file. It’s probably located in /etc/X11, if it exists. It didn’t on my computer, but as I found out, it can be generated. In order to do that, X has to be shut down. Switch to a virtual console by pressing Alt+F1. Log in and stop gdm (the GNOME Display Manager, it manages the X displays) like this:

sudo /etc/init.d/gdm stop

In Ubuntu 11.10 it’s lightdm:

sudo service lightdm stop

Then generate the Xorg configuration file like this:

Xorg -configure

In Ubuntu 11.10 we get errors if we do not run with sudo:

sudo Xorg -configure

This generates a file called Open it in your favourite text editor and add the configuration lines from above to the Monitor section. Save it and then try it out with:

Xorg -config

In Ubuntu 11.10 we get errors if we do not run with sudo:

sudo Xorg -config

This will present a running X session, but it will probably not show anything interesting. We only need to check that the graphics problem is gone. You can easily exit the session by pressing Ctrl+Alt+Backspace. X should run nice now, but you need to make this change permanent by copying the configuration file to the correct place:

sudo cp /etc/X11/xorg.conf

Now just start gdm again and everything should be fine:

sudo /etc/init.d/gdm start

Hopefully this can help someone :)

Edit: added some clarification.