Doug's Linux Notebook


Changing Screen Resolution

#This article is out dated, with the newer distro's simple tools can be found in the menus to set your screen resolution. #

One of the first problems many people encounter after a Linux installation is not being happy with the default screen resolution and not knowing how to change it. Unfortunately I haven't found a quick and easy way to fix this, but there a couple of options.

Since Xfree86 is the software that controls this, one option is to run xf86config. The problem with that is that you must go through the whole process of setting up the mouse, key board, monitor, and video card so you need to know what type of video card, how much video memory it has, and the monitor refresh rates. hopefully you have this info in the paperwork that came with the hardware. After the video card setup is the section where you can set screen resolution, place your desired resolution first in the mode lines. I usually set mine as "1024x768" "800x600" and leave the others out, notice that the 1024x768 is first, this is what I want as the default. after the mode lines are set the way you want select the desired default color depth then the config file XF86Config will be written.

Notice that Linux is case sensitive, XF86Config (note the CAPS) is the configuration file, and xf86config is the program you run to create a new config file

To run xf86config you should first save a backup copy of the XF86Config configuration file, which is can be found in the /etc/X11 directory, then as root run fx86config.

Remeber to watch the upper and lower case letters.

[root@linux] cp /etc/X11/XF86Config /etc/X11/XF86Config.bak
[root@linux] fx86config

Another option is to manually edit the XF86Config file using the editor of your choice, I use pico.

[root@linux] pico /etc/X11/XF86Config

Below is info I found in the Xfree86 home page on the internet which explains the settings and how to change them, don't forget to make a backup copy of XF86Config before you edit it. At the bottom of the page is the screen resolution section from one of my computers as an example.

------------------------------------------------------------------

Q.D2- My screen is too large. How can I disable the virtual desktop?

Two things influence the virtual desktop size:

In the Screen Section of your XF86Config file (normally near the end of that file), you may see a "Virtual" keyword
for every screen depth in that section. Comment that line (prepend a "#") or remove it. In the example below, the virtual
size was 1280x1024, while the largest mode is 1024x768, so even in that largest mode, you would need to scroll around
the display.

Section "Screen"

...

Subsection "Display"

Depth 8

Modes "1024x768" "800x600" "640x480"

# Virtual 1280 1024

ViewPort 0 0

EndSubsection

...

If not given in a "Virtual" line in the XF86Config file, XFree86 will automatically select the largest-resolution mode as
your virtual screen size. E.g.:

Section "Screen"

...

Subsection "Display"

Depth 8

Modes "1024x768" "800x600" "640x480"


ViewPort 0 0

EndSubsection

...

This will set the virtual screen to 1024x768 in 8bpp mode. If you only want 800x600, remove the "1024x768" Mode from the
list above.

In some installations, the first mode in the "Modes" line is the smallest one, as shown below:

...

Modes "640x480" "800x600" "1024x768"

...

In this case, the server will still select 1024x768 as virtual size (the largest mode in the list), but start up with 640x480 (the first

mode in the list). This will put you in a "scrolling" mode again. If you want 640x480 without scrolling, remove all the larger
modes. If you want the bigger display without the scrolling, use "CTRL ALT +" or "CTRL ALT -" to switch to the larger
modes, or re-order the "Modes" line so that the server starts up in the mode you want.

Note that there is such a "Display" Subsection for every color depth, so you may have to repeat the same editing steps
several times.

---------------------------------------------------------

#**********************************************************************
# Screen sections
#**********************************************************************


#Any number of screen sections may be present. Each describes
# the configuration of a single screen. A single specific screen section
# may be specified from the X server command line with the "-screen"
# option.
Section "Screen"
Identifier "Screen 1"
    Device "Intel 810"
    Monitor "My Monitor"
    DefaultDepth 24

    Subsection "Display"
        Depth 8
        Modes "1024x768" "800x600"
        ViewPort 0 0
    EndSubsection
    Subsection "Display"
        Depth 16
        Modes "1024x768" "800x600"
        ViewPort 0 0
    EndSubsection
    Subsection "Display"
        Depth 24
        Modes "1024x768" "800x600"
        ViewPort 0 0
    EndSubsection
EndSection

Back to the Main Page