January 7, 2010 · General · Email This Post

Sponsored Link
Xrandr is used to set the size, orientation and/or reflection of the outputs for a screen. It can also set the screen size. There are a few global options; the rest modify a particular output and follow the specification of that output on the command line.
Open the terminal and run the following commands

First you need to enter the following command

$ xrandr

This will display the allowed resolutions

Sample output

Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA1 connected 800×600+0+0 (normal left inverted right x axis y axis) 267mm x 200mm
800×600 85.1* +
640×480 75.0 60.0
720×400 70.1

If you want to add a mode with resolution 1024X768, you can enter the following command: (The output is shown following.)

$ cvt 1024 768

Sample output

# 1024×768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
Modeline "1024x768_60.00" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

Now you need to create a modeline

$ xrandr --newmode <Modeline>

copy the modeline of the previous output to the place mode line

$ xrandr --newmode "1024x768_60.00"   63.50  1024 1072 1176 1328  768 771 775 798 -hsync +vsync

Now you need to add the above mode using the following command

$ xrandr --addmode VGA1 1024x768_60.00

here for VGA1 you have to use what ever that was there for $ xrandr output

$ xrandr --output VGA1 --mode 1024x768_60.00

Running these would change your resolution but this is temporary.these steps were done to make sure that these commands work

Now we need to make these changes permanent

Now you need to edit the default file

$gksudo gedit /etc/gdm/Init/Default

Look for the following lines


and Add the the following lines below them

xrandr --newmode "1024×768" 70.00 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

xrandr --addmode VGA1 1024x768_60.00

xrandr --output VGA1 --mode 1024×768

Save and exit the file

Credit goes here

Sponsored Link

Related posts

121 Comments to “How change display resolution settings using xrandr”

  1. bud says:

    For those who see “cannot find output VGA1”: have a look at YOUR output of the first command in this article.
    The line “xy connected to…” tells you what to write instead of VGA1, on my system it reads “default”.

    (nonetheless not working here because of “Configure crtc 0 failed”)

  2. Pavel Nichkov says:

    Managed to set right resolution for Supra 32″ TV under Ubuntu 12.04: 1930×768 instead of 1024×768.
    However, could not automate the task. Does is use other configuration files?

  3. hykloud says:

    You can copy and paste xrandr command lines into user’s ~/.xprofile file, then they’re executed when you log in.

  4. Mike says:

    Thank you, this worked for me.

  5. Pavel Nichkov says:

    hykloud, thanks a lot!
    I have edited the hidden .profile file and it worked.

  6. Edward Coast says:

    This is very helpful! It’s important to add to tell the user to do a ‘xrandr’ command to see the name of their VGA. Mine was not VGA-1, but VGA-0.

  7. Eduardo says:


    u r a f…ing genius !


  8. RippingMyHairOut says:

    There seems to be a lot of answers for dual screens and monitors but these suggestions have actually now made my web book resort to a 640×480 resolution on which I can’t see a great deal, infact it’s impossible to read certain menu boxes due to there being no scroll bar. I had this problem at 800×600 let alone 640×480 but now I don’t even have the option to change it back. It will only display in 640×480 now. I’m looking for something in the region of 1024×768 plus. Can someone help?


  9. uranus says:

    do this:
    [email protected]:~# xrandr
    To see what xrandr sees. You’ll get some output like this:

    [email protected]:~$ xrandr
    Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 4096 x 4096
    DVI-I-1 disconnected (normal left inverted right x axis y axis)
    VGA-1 connected 1280×1024+0+0 (normal left inverted right x axis y axis) 356mm x 266mm
    1920×1440 60.0
    1856×1392 60.0
    1792×1344 65.0 60.0
    1920×1200 74.9 59.9
    1600×1200 75.0 70.0 65.0 60.0
    1680×1050 84.9 74.9 60.0
    1400×1050 85.0 74.9 60.0
    1280×1024 85.0* 75.0 60.0
    1440×900 84.8 75.0 59.9
    1280×960 85.0 60.0
    1360×768 60.0
    1280×800 84.9 74.9 59.8
    1152×864 75.0
    1280×768 84.8 74.9 59.9
    1024×768 85.0 75.1 75.0 70.1 60.0 43.5
    832×624 74.6
    800×600 85.1 72.2 75.0 60.3 56.2
    848×480 60.0
    640×480 85.0 75.0 72.8 72.8 66.7 60.0 59.9
    720×400 85.0 87.8 70.1
    640×400 85.1
    640×350 85.1
    TV-1 disconnected (normal left inverted right x axis y axis)

    Here my output VGA-1 is “connected”. The “*” asterisk denotes the active resolution and refresh rate.

    Then use “cvt” (or “gft”)

    [email protected]:~# cvt 1024 768 60

    to get a modeline for 1024×768 with 60hz refresh rate

    cvt will spit out something like this:

    # 1024×768 59.92 Hz (CVT 0.79M3) hsync: 47.82 kHz; pclk: 63.50 MHz
    Modeline “1024x768_60.00” 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync

    I’m using openbox wm with no display manager right now so I just put this in a .scripts folder in my ~/ to be called with .config/openbox/autostart.sh

    Replace my lines with YOUR modes or you might blow up your screen!!!

    —shell script—

    # screenres
    xrandr –newmode “1280x1024_85.00” 159.50 1280 1376 1512 1744 1024 1027 1034 1078 -hsync +vsync &
    xrandr –addmode VGA-1 1280x1024_85 &
    xrandr –output VGA-1 –mode 1280×1024 –rate 85

    Name the file something like screenres.sh .


    [email protected]:~# chmod +x screenres.sh


    [email protected]:~# ./screenres.sh

  10. Richard Goranflo says:

    I have Linux Mint 14 mate installed on a fit=PC2i SBC which has a DVI display interface to an acer 22* monitor with 1600×1299)_60.00 resolution,

    I was unable to get xrandr –addmode VGA1 1600x1200_60.00 to work.

    I entered “xrandr -q” command and it reported DVI-0 and not LPT1 as my Display Device,
    After entering “xrandr –addmode DVI-0 1600x1200_60.00 the command was accepted.

    The next command ” xrandr –output DVI-0 –mode 1000x1200_60.00 was also accepted and the display resolution changed.

    One strange effect was the desktop shows the original content overlayed by the same image at the new resolution but aligned at the top left corner of the display.

    That display content persists even after editing my “Init/Default? file and rebooting,

    Is this what I should expect to happen?

    Will there be any updates forthcoming to correct this problem?

  11. Richard Goranflo says:

    My apologies for typos in my earlier initial comment.

    The following has been corrected:

    I have Linux Mint 14 mate installed on a fit=PC2i SBC which has a DVI display interface to an acer 22* monitor with 1600×1299)_60.00 resolution,
    I have Linux Mint 14 mate installed on a fit=PC2i SBC which has a DVI display interface to an acer 22* monitor with 1600×1200_60.00 resolution,

    I was unable to get xrandr –addmode VGA1 1600x1200_60.00 to work.

    I entered “xrandr -q” command and it reported DVI-0 and not LPT1 as my Display Device,
    After entering “xrandr –addmode DVI-0 1600x1200_60.00″ the command was accepted.

    The next command ”xrandr –output DVI-0 –mode 1600x1200_60.00″ was also accepted and the display resolution changed.


  12. Sergio says:

    This worked perfectly, I went from having a 1024×768 resolution to 1600×900. The instructions are clear and concise. I’m new to Linux and this is one page I’m going to keep in my toolbox. Thank you!

  13. JIm Rivera says:

    And how about other resolutions? I just got done with the install and my Dell 2405 monitor with 1920×1200 res is aparently stuck at 1600×1200 max. Is there posibly an algorithm for calculating the modeline for other vslues of h & v resolution? A generic one perhaps.

    (Rant mode to on)
    Linux’s adaptability to oder hardware has long been a real strength in the marketplace of ideas. What is happening? There used to be a perfectly good auto-config for monitors that worked fine, why was it not used?

    Hopefully there is a better way, this looks like a shortcut team was on duty when this one was designed. Modelines??? in 2013??? I can & have implemented fixes like this, but I sould like to see this done right.

    (Rant mode off)

    At any rate we need a fix, someone please post some sort of a fix here if available.

    Thanks in advance.
    Jim Rivera

  14. Os says:

    Hi thanks for the post. I have a doubt is that when running xrandr I get nothing concerning VGA. I have a PC on table with a NVIDIA GeForce 7300 graphics card and a monitor with Ubuntu 12.04 HP w1907v
    The xrandr command output:
    root @ you: ~ # xrandr
    xrandr: Failed to get size of gamma for output default
    Screen 0: minimum 320 x 240, current 1440 x 900, 1440 x 900 maximum
    default connected 1440×900 +0 +0 0mm x 0mm
    1440×900 50.0 *
    1360×768 51.0 52.0
    1152×864 53.0 54.0 55.0 56.0
    1152×720 57.0
    1024×768 58.0 59.0 60.0
    960×600 61.0
    960×540 62.0
    896×672 63.0
    840×525 64.0 65.0 66.0 67.0
    832×624 68.0
    800×600 69.0 70.0 71.0 72.0 73.0 74.0
    800×512 75.0
    720×450 76.0
    680×384 77.0 78.0
    640×512 79.0 80.0
    640×480 81.0 82.0 83.0 84.0 85.0
    576×432 86.0 87.0 88.0 89.0
    512×384 90.0 91.0 92.0
    416×312 93.0
    400×300 94.0 95.0 96.0 97.0
    320×240 98.0 99.0 100.0
    root @ you: ~ #
    I want to fix this because I can not enter the TTY mode (CTRL + ALT + F1) and I can not play “Njam” (Pacman – like) because I get a message that says “Input signal out of range, change settings to 1440 x 900-60 HZ “Thank you.

  15. amc_oldsarge says:


    I have been messing around with trying to get my headless machine to display a particular resolution upon logon via VNC. It would only show 1024×768. My desire was to view at 1680×1050. Using your description as a template I was able to gain success. Here is what I did:

    I created a file called .xprofile in my home directory (/home/myusername/.xprofile or ~/.xprofile).

    I edited the file with the following text:

    # screenres

    xrandr –newmode “1680x1050_60.00” 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync &
    xrandr –addmode VGA-0 1680x1050_60.00 &
    xrandr –output VGA-0 –mode 1680x1050_60.00

    I saved the file and made it executable and rebooted.

    After the reboot, I logged on a my resolution was as I desired.

    Things I was missing in my .zprofile were: the 1st three lines and the ampersand (&) after the 4th and 5th lins.

    Thanks for the final push to success.

  16. Martin HAck says:

    Just used you instructions to change the resolution from 1024×768 to 1440×900. Everything worked perfectly, and now I have a perfectly proportioned screen.

  17. Tomo says:

    Hi there, thanks for this page, but Im rather confused. Correct me if im wrong. So the existing resulution is 1024×768 and the writer is showing how to add new modes, ie other resolutions. But bothfor “addmode” and “output”, the same 1024×768 figure is typed in. Is this right? Or am I to change the numbers to my preferred resolution figures in one of those places?

    Thanks again.

  18. Thamizh says:

    Workd Good., Really awesome Thanks…!!!

  19. ubuntu says:

    #xrandr –output VGA1 –mode 800×480
    #warning: output VGA1 not found; ignoring

    How to find VGA1, DVI-0 or something i have?
    (Notebook with Ubuntu 11.04)

  20. ubuntu says:

    … other info:

    #xrandr -q
    #Screen 0: minimum 320 x 200, current 800 x 600, maximum 800 x 800 default connected 800×600+0+0 (normal left inverted right x axis y axis) 0mm xx 0mm
    800 x 600 60.3*
    800x480_60.00 (0xeb) 29.5Mhz
    h: width 800 start 824 end 896 total 992 skew 0 clock 29.7KHz
    v: height 480 start 483 end 493 total 500 clock 59.5Hz

    Where VGA1 in this output?

  21. Peter Talbot says:

    I am also getting the “xrandr: Failed to get size of gamma for output default” error message. I’m running a Lenovo T-61 laptop with Nvidia graphics.

    It was working fine until I installed a system core security update.

  22. Peter Talbot says:

    Has anyone who’s had this issue found a solution? Thanks in advance!

  23. Steve says:

    Thank you ¡¡ Solved in Linux Mint 15 ‘Olivia’, but using mdm inside gdm as Display Manager. So, the gedit file instruccion must changed to mdm.


  24. Hannes says:

    I’m using Linux Mint 14 (Nadia) with MDM.
    I typed the xrandr commands in my terminal, and the resolution changed.
    Then I added them to etc/mdm/Init/Default
    After rebooting, the splash screen had the right resolution, but as soon as I logged in, the resolution went back to the old setting, just as stated in this post: http://forums.linuxmint.com/viewtopic.php?f=49&t=118472
    But my new resolution setting does not appear in the ‘Monitors’ control panel. How can I fix that?

  25. coding-green says:


    I was so annoyed about typing and remembering the commands of xrandr that I wrote a little script to simplify this a lot.

    Maybe it helps someone else to save time 😉


  26. kelly says:

    I amusing ubuntu on a laptop using a iso image cd that it boots to as i still have xp onhard drive. i have an acer monitor attahed to the laptop. the laptop resolutionis good. the acer monktor resolution is garbage. how do i change the resolution so that i can see the program on the acer monitor or what do i need to do to gdt the acer monitor to work like the laptop monitor does.

  27. hashem says:

    use “default” instead of “VGA1”

    you output name is default

  28. Ravikumar says:

    Thanks for the Article.
    It worked on my Ubuntu 11.10 installation.
    My monitor supports 1920×1080 but ubuntu was showiing only up to 1280.
    This worked like magic..
    Thank you

  29. Howard says:

    Before using the script “addmode” type in
    $ xrandr
    then it will list all of the available connections. So instead of writing VGA1, you would put your appropriate output display.

    Mine is showing LVDS1 as the laptop display, with VGA1 as the external monitor.

  30. jat says:

    dos it worked in VM ware .. m instal BT5R3-KDE .. m trying but it dos not worked … tel me something if u know something

Leave a Reply

  • Recent comments