Sunday, December 20, 2009

Add Resolutions To Ubuntu 9.10


On older laptops or desktop machines with older monitors, sometimes Ubuntu will not be able to detect what resolutions your monitor supports.  On older versions of Ubuntu xorg was the way to add resolutions and it sucked. Ubuntu 9.10 doesn't come with a xorg config file. You can create one and edit it if you wish, but I found this guide and it worked like a charm. Just look up your monitor or laptop's supported resolutions online, then follow this guide to add the resolution you want.


By default Ubuntu 9.10 supports 1024×768 resolution, which is not enough for me. I needed to increase it to 1240×1024. To achive my desired resolution I run throughfew commands. Its easy, take a look.
Here I am trying to get 1240×1024 resolution, if you are trying to achive any other change it with 1240×1024
Use xrandr to find current mode used & output name.
e.g here 
VGA1 is used, it is easy to use current output name.
  1. xrandr  
  2. Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192  
  3. VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm  
  4.    1024x768       85.0*+   75.1  
  5.    800x600        75.0  
  6.    640x480        75.0     60.0  
  7.    720x400        70.1  
Run following command to find modeline details for resolution 1240×1024. Modeline is required for xrandr.
  1. cvt 1240 1024  
  2. # 1240x1024 59.93 Hz (CVT) hsync: 63.71 kHz; pclk: 105.50 MHz  
  3. Modeline "1240x1024_60.00"  105.50  1240 1320 1448 1656  1024 1027 1037 1063 -hsync +vsync  
Use modeline config with xrandr to add resolution mode.
  1. xrandr --newmode "1240x1024_60.00"  105.50  1240 1320 1448 1656  1024 1027 1037 1063 -hsync +vsync  
e.g output of command xrandr with new resolution
  1.  xrandr  
  2. Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192  
  3. VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 310mm x 230mm  
  4.    1024x768       85.0*+   75.1  
  5.    800x600        75.0  
  6.    640x480        75.0     60.0  
  7.    720x400        70.1  
  8.   1240x1024_60.00 (0x102)  105.5MHz  
  9.         h: width  1240 start 1320 end 1448 total 1656 skew    0 clock   63.7KHz  
  10.         v: height 1024 start 1027 end 1037 total 1063           clock   59  
Use following command to add new mode
  1. xrandr --addmode VGA1 1240x1024_60.00  
Use following to change output imidiately Or use System–> Preferenses –> Display
  1. xrandr --output VGA1 --mode 1240x1024_60.00  
Since above command is not permanent sollution to add new resolution, you need to edit /etc/gdm/PreSession/Default
Enter followings at the end of file /etc/gdm/PreSession/Default
  1. xrandr --newmode "1240x1024_60.00"  105.50  1240 1320 1448 1656  1024 1027 1037 1063 -hsync +vsync  
  2. xrandr --addmode VGA1 1240x1024_60.00  
After reboot this will enable one more resolution mode in System–> Preferenses –> Display
all you need to do is to select desired mode once.
if you wish to remove any mode
  1. xrandr --rmmode 1240x1024_60.00  

2 comments:

Ronald said...

It took me a good 10 times until I finally got that resolution set in my default.

Unknown said...

Did you think the instructions were confusing?