Ubuntu – How to set a monitor resolution that is not available in the Display Settings dialog


I just installed ubuntu 13.04 x64
My resolution is 800×600 and there is no other option.
I tried to install the nvidia driver 313 but still nothing.
I tried doing this

still no luck,
thank you

Best Answer

(1) Get Modeline for your desired resolution

Use cvt. Here is an example for 1280x1024 resolution. Note that the third parameter (frequency) is optional. If your owner's manual specifies a refresh rate frequency, you may use that as input to cvt, or you can just leave it blank to keep things simple.

$ cvt 1280 1024 60

The output will look something like this.

# 1280x1024 60.03 Hz (CVT) hsync: 63.81 kHz; pclk: 109.25 MHz
Modeline "1280x1024_60"  109.25  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

(2) Create a new xrandr modeline

Use the Modeline output from cvt to create a new mode for xrandr.

$ xrandr --newmode "1280x1024_60"  109.25  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync

(3) Determine which display we need to modify

After running the following command, notice that VGA1 is the currently connected display, in this example,so we will use it in step number 4, below.

$ xrandr
Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 32767 x 32767
VGA1 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1280x1024_60.00   59.9 +
   1024x768       60.0  
   800x600        60.3     56.2  
   848x480        60.0  
   640x480        59.9  
   1280x1024_60   60.0* 
DVI1 disconnected (normal left inverted right x axis y axis)
TV1 disconnected (normal left inverted right x axis y axis)

(4) Create a new xrandr mode

Use the display name from step 3. Use the mode name from step number 2, but leave out the quotes.

$ xrandr --addmode VGA1 1280x1024_60

(5) Change the screen resolution

Specify the display name and the mode name

$ xrandr --output VGA1 --mode 1280x1024_60

(6) Get the monitor to automatically adjust

If the monitor has an "Auto Adjust" button, press it to automatically center and scale the output. Otherwise, use the manual buttons on your monitor to do this.

(7) Create an xorg.conf file

If you like the resolution settings, you can make them permanent by specifying this information in an xorg.conf file.

Put the modeline from step 1 into the "Monitor" section. You may replace "My Monitor" with a descriptive name for your monitor, as long as you use the same name in the "Screen" section.

Note that the "Device" section is used to specify your graphics card/chip and the driver you are using; Identifier may be any name you chose, as long as you use the same name in the "Screen" section. But you must use the correct driver name for your graphics card/chip on the Driver line. You can use $ lshw -c video | grep configuration to get your graphics driver name.

Although I have not tested this, it may be possible to exclude the "Device" section, as long as you also delete the corresponding Device line in the "Screen" section.

$ sudo gedit /etc/X11/xorg.conf

Enter information into the file, save, and exit. Here is an example using the 1280x1024 modeline from above and an intel graphics driver.

Section "Monitor"
    Identifier  "My Monitor"
    Modeline    "1280x1024_60"  109.25  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
    Option      "PreferredMode" "1280x1024_60"

Section "Device"
    Identifier  "Intel"
    Driver      "intel"

Section "Screen"
    Identifier "Default Screen"
    Monitor     "My Monitor"
    Device      "Intel"
    Defaultdepth 24
    SubSection  "Display"
        Modes   "1280x1024_60"

Section "ServerLayout"
    Identifier  "Default Layout"
    Screen      "Default Screen"

If something goes wrong, you can boot into recovery mode and edit or delete /etc/X11/xorg.conf.

Finally, you can take a look at Ubuntu Wiki Resolution for more information.

Related Question