Tuesday, April 13, 2010

Solving screen resolution nightmare in Ubuntu 9.10

Have u ever spending days nights to figure out setting the best resolution for your screen in Ubuntu? Since i have had that nightmare, searching forums all over the internet, trying various methods, but were able to solve that only after wasting 2 days. :) My VGA supports resolutions like 1600x1200, but in Ubuntu, by default it comes with only 800x600 and 640x480 options.


So, thought of sharing how to configure those with you all.


The problem is that Ubuntu ( Im using 9.10 ) doesnt detect your monitor by default, compared to some other OSs like CentOS, where you can select the monitor easily, which is not the case in Ubuntu. ( Actually im quite new to Ubuntu, so may be there s a way for Guru s to select the monitor, but i couldnt find a way)


And my Graphic Adapter is Intel 82865G. You can check the type of your VGA by this command

$ lspci


Here s what i did. ( Many thanks to the folks who have documented various methods.. bt this i found most useful for mehttp://www.arunviswanathan.com/node/53 )


( In many forums they were talking about the xorg.conf in /etc/X11 . But in my machine i couldnt find that file under /etc/X11 )

Following command will display current display settings
$ xrandr

Output ( My default settings - only displays
800x600 and
640x480 )
---------
Screen 0: minimum 320 x 200, current 800 x 600, maximum 2048 x 2048
VGA1 connected 800x600+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
800x600 60.3*
640x480 59.9


Then u should add the resulotion you need as a new mode, but before that you need to get other parameters required for this, unless the new mode will not be added properly. Therefore, execute the following ( The resolution you need to achieve, here for me its 1600x1200 with the refresh rate 59.9)

$ gtf 1600 1200 59.9

It generates the following output :
# 1600x1200 @ 59.90 Hz (GTF) hsync: 74.40 kHz; pclk: 160.69 MHz
Modeline "1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync


Now add the new mode with above generated parameters as follows

$ xrandr --newmode"1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync

Then add the above mode to your desired output ( In my case its VGA1 , as given by executing xrandr command. For you it may be different, so first execute xrandr and verify your output and use that output to execute the following command)

$ xrandr --addmode VGA1 1600x1200_59.90

Thereafter chose that as your resolution
$ xrandr --output VGA1 --mode 1600x1200_59.90

If everything went successfully, above resolution must be selected automatically now. :)

Even if you are successful, you need to go thru one final step to persist the changes so that its available at system startup ( otherwise vanishes after you logoff)

$ sudo gedit /etc/gdm/Init/Default

Look for the following lines
PATH=/usr/bin:$PATH
OLD_IFS=$IFS

Add the following lines below them (The mode you created above)
xrandr --newmode "1600x1200_59.90" 160.69 1600 1704 1880 2160 1200 1201 1204 1242 -HSync +Vsync
xrandr --addmode VGA1 "1600x1200_59.90"
xrandr --output VGA1 --mode "1600x1200_59.90"


Save and Exit. Logoff and Log in .. now you must be able to use your new resolution :)

Sunday, April 11, 2010

ADSL Connection setup in Ubuntu (9.10)

Have you ever came across with any issue in setting up ADSL connection in Ubuntu?
if so here s the solution.

PPPoE package should be installed before. To verify that the package is intalled, type
$ dpkg -s pppoeconf

If it is installed you should see the output on the package where two lines show this:

Package: pppoeconf
Status: install ok installed

If the package is not installed, insert your Ubuntu CD and in a terminal type:

sudo apt-get install pppoeconf

If the package cannot be found, you may have to add your Ubuntu CD to the list of software repositories. To add your CD, make sure it is inserted in your CD drive and in a terminal type:

sudo apt-cdrom add
After successfully installing PPPoE package,

$ sudo pppoeconf

And a text based interactive menu is prompted. Provide the relevant information, and your connection is
set up now.

To start your ADSL connection on demand, in a terminal type:

$ pon dsl-provider

To stop your ADSL connection, in a terminal type:

poff dsl-provider