Linux Linux screen resolution issues

Him Her

VIP Member
VIP Member
Joined
Dec 23, 2011
Messages
8,145
Reaction score
6,435
Location
North Yorkshire
Video drivers in pretty much any OS are areas of potential grief as they are a pain in the ass to write and operate at a low level. As a result they often cause problems, even in Windows. One of the most common issues with Linux is that the full range of screen resolutions are not properly discovered and you can end up with a boring low resolution when your hardware is capable of much more.

All the documentation I've found is very techie and you have to plough through a load of guff just to get to a simple answer - press this! This simpler version should help resolve common problems such as resolutions not detected/lost after upgrade(s).

First, find out what your hardware is capable of. The monitor is easy, read the model, Google. The graphics card is not so easy as you may have to pull the machine apart first, unless you do this:

Code:
You don't have permission to view the code content. Log in or register now.

All this does is dump to screen what has been detected on the PCI bus, the output is piped to 'grep' which finds and outputs the VGA element. Mine produced this:

Code:
You don't have permission to view the code content. Log in or register now.

My graphics card is an Intel 82945G/GZ. I know this can do 1270x1024 at 70Hz so I'll use xrandr and gtf to do this as Xorg.conf is deprecated. These should be available by default on most distributions.

First, use xrandr to ensure your frame buffer size allows the resolution you need:

Code:
You don't have permission to view the code content. Log in or register now.

I got this:

Code:
You don't have permission to view the code content. Log in or register now.

Now use gtf to generate a modeline (resolution):

Code:
You don't have permission to view the code content. Log in or register now.

The syntax is 'gtf horizontal-resolution vertical-resolution refresh-rate'

The output I got was:

Code:
You don't have permission to view the code content. Log in or register now.

Which gives me the values I need for xrandr, first add a new mode:

Code:
You don't have permission to view the code content. Log in or register now.

Now, run xrandr without any arguments to determine the display name:

Code:
You don't have permission to view the code content. Log in or register now.

From the above output mine is VGA1 so we add the new mode to this screen:

Code:
You don't have permission to view the code content. Log in or register now.

Activate the new mode by:

Code:
You don't have permission to view the code content. Log in or register now.

If you used values supported by both graphics card and monitor the new resolution should now be active. You'll probably lose this after a reboot however...

I just created a file and placed it on the desktop like this:

Code:
You don't have permission to view the code content. Log in or register now.

Give it a .sh extension and add the execution bit with a 'chmod +x' and you can just run it after the system has started. Alternatively, put this at the end of the /etc/rc.local file like this:

Code:
You don't have permission to view the code content. Log in or register now.

Remember to make the script executable with a 'chmod +x' as it doesn't run by default.
 
Back
Top