Sponsored Link
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
PATH=/usr/bin:$PATH
OLD_IFS=$IFS
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


Nice tip. However I’d rather put the permanent configuration in /etc/X11/Xsession.d/45custom_xrandr-settings.
This is what is suggested in http://www.thinkwiki.org/wiki/Xorg_RandR_1.2#Now_automate_it_on_login and it worked for me with Karmic.
(ThinkWiki is pointed by http://www.x.org/wiki/Projects/XRandR)
Michel
I’ve found in Karmic, regardless of where you put the permanent configuration, you need to then go in via System -> Preferences -> Display and choose the new setting THERE, otherwise on restart it seems as if the new settings get set, then get set back to whatever is set in Sys>Pref>Display
Linux will always follow windows because of issues like this. In windows the screen resolution can be changed & set in a few clicks. In Linux there are so many terminal commands needed, that no windows user, wishing to switch to Linux, would ever go thru with. Microsoft has just about eliminated the need for console or terminal commands. Windows users see the command promp as old school stuff, so Linux and the X Server are a very weak part of Linux.
Hi! I’m new to Ubuntu (and Linux, generally). Tried the code above, and below is what I get. Any other suggestions? Is it my lack of VGA that is the problem?
Much Thanks!
jennacj@Olivia:~$ cvt 1024 768
# 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
jennacj@Olivia:~$ xrandr –newmode “1024x768_60.00” 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 149 (RANDR)
Minor opcode of failed request: 16 (RRCreateMode)
Serial number of failed request: 18
Current serial number in output stream: 18
This didn’t work for me and quite frankly, I agree whole heartedly with Fred and I have been using Linux for a long time. With Win7, stuff just works and it doesn’t require a degree to get it to normal things. I NEVER thought that I would say this, but I am really thinking about switching.
FWIW, I am trying to get Ubuntu 9.10 to default to 1920X1080 for my new monitor but it won’t, at least not with the above and I have been very careful to follow the above directions.
I haven’t decided where the best place to make my changes permanent is yet. Many work, but there seems to be controversy on where the proper place is now that xorg.conf is gone.
@Jenna
You get that error sometimes when your syntax is a little off. I’m no pro, but I’ve corrected it. Check to see if you already have a mode created with that name in the “”, You can make this whatever you’d like. It also could be a bad value in there I believe. Not good enough to know for sure.
@Fred and Randy
I would agree that Windows is still more intuitive for the average user, but I would never say “In Windows, stuff just works.” The monitor I’m using has a rather awkward modeline that took me FOREVER to figure out (CVT and such could not give me the correct one) and Windows didn’t work with it either. Point being, that I can correct it easier with Ubuntu than with Windows, and I didn’t know what to do either, but I could figure it out.
I just love the way Linux of several distros run so cleanly and efficiently on my laptop, and even old laptops. These days, you buy a brand new laptop, and it comes with Windows and the thing can barely handle it, and I have yet to figure out what I am getting in return over Linux for my headache. Linux is free, and all the software you need to use Linux for anything is free. And in my opinion, even if its slightly lacking in one area or another over a Windows based platform, it’s no where near worth dishing out the $300 for an OS, $500 for Microsoft Office, $100 a year for Virus protection, etc.
Also, I had my first experience with Win7 the other day when a friend JUST bought his brand new laptop, and what-do-you-know iTunes wouldn’t work properly. This was due to Win7 retaining firewall issues from the junk software that came with the OS, even after I removed it, I had to work very hard to get iTunes to work, and a person like yourself would not have been able to do it any easier than this problem. Even now, Win7 gives him some compatibility warning ever time he opens a program, even though it’s not being run in compatibility mode.
Hi…
Found this link very helpful after quite a search on the net.
My 14″ monitor picked the 800×600 (4:3) resolution by default and did not provide the 1024×768 (4:3) option, but this was available when using Windows XP.
The first test codes/commands worked (copy-paste the code gave an error, but then I carefully typed the Modeline that I got as a result of the – cvt 1024 768 – command). The resolution on the screen changed after the – xrandr –output VGA1 –mode 1024×768_60.00 – command.
Happy with that, I moved to the next set of commands that were meant to make the settings permanent (that is, 1024×768 resolution mode persistent even after the computer restarts).
I had trouble here… After adding the three lines of commands and saving the file and restarting the computer, it directly came up with the 800×600 resolution mode. A little upsetting, but I knew the answer is just round the corner. I believe the command below needs a little tweaking. That is, change the below commands… FROM
xrandr –newmode “1024×768? 70.00 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
xrandr –addmode VGA1 1024×768_60.00
xrandr –output VGA1 –mode 1024×768
TO…
xrandr –newmode “1024x768_60.00” 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
xrandr –addmode VGA1 1024x768_60.00
xrandr –output VGA1 –mode 1024x768_60.00
Save the file; close it; restart the computer and the resolution is 1024×768, which is what I/we need. Hope this is helpful.
Note: The above commands need to be changed in the default file as mentioned above by the author.
Important: The above three lines of commands are nothing but the last three lines of commands that we executed in the first section on our computers to see if it works. Use the same three lines of commands. Save it; and close it. Next, restart the computer and you should have the resolution.
🙂 A TON OF THANKS TO YOU ALL
The tip worked for me to get my resolution up from 800×600 to 1024×768 but the permanent entry into Default did not. Still had to manually choose my resolution after reboot. But considering I couldn’t even choose before (highest was 800×600), I’d say this is a very very good guide.
I have been using 8.04 for a long time with my desktop and was able to get my 42″ LCD set to 1024×768 by going to edit menus, clicking other finding display and forcing it to 1024×768. No need for command line. I decided to upgrade to 9.10 which I have been using on my laptop but the largest screen I can get on my LCD is 640×480. In 8.04 it atleast defaulted to 800×600 before I changed it. I did the commands above and this is what I got at the end:
xrandr: screen cannot be larger than 640×480 (desired size 1024×768). I did the new mode and add mode and there were no errors, but when I said to output I received that. Does anyone have any suggestions? I don’t understand why it is more difficult to do this in 9.10 then it was in 8.04.
Good stuff.
Thanks for posting!
It helped me with a
radeon 7000
Samsung 753dfx
in a karmic 9.10
This is very helpful. It worked like a charm.
Thank you very much!
I was having trouble after upgrading to an ASUS 238H (1920×1080 @ 60Hz) and this guide seems to have worked flawlessly.
Thank you for the write up on this method.
Well, I couldn’t get this guide to work for the 1920X1080 monitor I have, so I just installed Linux Mint 64bit since I had to replace my Hitachi Deathstar hard drive. It gave me the perfect resolution straight away, so I’m golden!
sir 1st thaks for publish this type rare help on net..all comands run succesfuly on my 10.04 ubuntu n my screen resultion also changed bt iam unable to edit and make changes in default file that open after $gksudo gedit /etc/gdm/Init/Default
this command….plese guide me to how can enabl edit on default file to make permanet resultion changes
Hi I followed the instructions but it keeps saying:”xrandr: cannot find output “VGA1″ ”
I really don’t know what to do about it, I’m posting the hole display
“grripper@grripper-laptop:~$ xrandr
Screen 0: minimum 640 x 480, current 800 x 600, maximum 800 x 600
default connected 800×600+0+0 0mm x 0mm
800×600 61.0*
640×480 60.0
1240x1024_60.00 (0x10f) 105.0MHz
h: width 1240 start 1320 end 1448 total 1656 skew 0 clock 63.4KHz
v: height 1024 start 1027 end 1037 total 1063 clock 59.6Hz
1024x768_60.00 (0x125) 63.0MHz
h: width 1024 start 1072 end 1176 total 1328 skew 0 clock 47.4KHz
v: height 768 start 771 end 775 total 798 clock 59.4Hz
grripper@grripper-laptop:~$ cvt 1024 768
# 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
grripper@grripper-laptop:~$ xrandr –newmode “1024x768_60.00? 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync
grripper@grripper-laptop:~$ xrandr –addmode VGA1 1024x768_60.00
xrandr: cannot find output “VGA1″
grripper@grripper-laptop:~$ xrandr –output VGA1 –mode 1024x768_60.00
warning: output VGA1 not found; ignoring
grripper@grripper-laptop:~$ ”
Thanks in advance
Since my first comment, I switched to a new laptop with an NVidia card. I tried to re-apply this tip but I came to the conclusion that the NVidia proprietary driver is not meant to be used with xrandr that way. The only thing that can be done is to turn the screen.
@grripper: your /xrandr output/ looks like mine so maybe you also have an Nvidia. In all cases, the name of your /screen output/ is called “default” (compare with the /sample output/ at the top of the page).
these type of issues is exactly why linux will never pose any serious threat to windows. I like linux and wish i could use it. Unfortunately i am not a geek who can spend a lot of time at a computer to figure things out. i installed ubuntu 10.04 but have trouble with my screen resolution and some other hardware. with windows I pay a lot of money, but it always works!! Isn’t there some kind of linux out there that will just work out of the box?
I don’t understand why configuration dialog that changes my resolution (and it works fine!) STILL does not have an option “make it default on startup”.
Shit.
I met this problem every time I installed linux and I don’t understand why this problem still exists for so many years!
ubuntu 10.04 works on my bravia as my temporary monitor but when i used my crt monitor it doest work anymore. over frequency.
I am new user of this OS and i think i like it but the problem is i cannot used it on my standard crt monitor. what should i do. pls any help would be appreciated.
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA1 connected 1024×768+0+0 (normal left inverted right x axis y axis) 1mm x 257mm
1600×1200 60.0
1280×1024 60.0
1024×768 85.0 75.1 70.1 60.0*
800×600 85.1 75.0
640×480 75.0 60.0
720×400 70.1
1024×768 (0x42) 65.0MHz
what next? help! thanks in advance
h: width 1024 start 1053 end 1189 total 1344 skew 0 clock 48.4KHz
v: height 768 start 771 end 777 total 806 clock 60.0Hz
“1024×768? (0x10d) 70.0MHz
h: width 1024 start 1072 end 1176 total 1328 skew 0 clock 52.7KHz
v: height 768 start 771 end 775 total 798 clock 66.1Hz
SOLVED!!! all i did was go to System Profiller and Benchmark and click generate a report.Save it. Restart and after that Linux Mint 9 detected my old pc monitor.
This works well for me in 10.04, for the Ubuntu GUI login screen and the Ubuntu desktop, but I’m still in search of a similar method for setting the resolution of the Ubuntu logo splash screen and the seven terminal consoles. One blog alluded to this being a bug, a problem where Grub2 is unable to communicate a resolution to the kernel. Any suggestions or opinions?
Hi guys : same problem here can u help 🙂
guru@guru-desktop:~$ xrandr –addmode VGA1 1024x768_60.00
xrandr: cannot find output “VGA1”
guru@guru-desktop:~$ xrandr –output VGA1 –mode 1024x768_60.00
guru@guru-desktop:~$ xrandr –addmode VGA1 1024x768_60.00
xrandr: cannot find output “VGA1”
This didnt work for me. I get this error message:
“Failed to get size of gamma for output default”
Anybody?
I have same problem with compaq presario.
xrandr: Failed to get size of gamma for output default
??
[guru says:
xrandr –output VGA1 –mode 1024x768_60.00
xrandr: cannot find output “VGA1?]
Maybe it works: xrandr –output default –mode 1024x768_60.00
xrandr –output VGA1 –mode 1024x768_60.00
it show get can get gamma size
it run various command.
it sticjk at gamma size
i suffer from low resolution & stict at 800*600
iwant to change 1024*768 and 1280*1024
please anybody help me out
thank you very much in advance
xrandr –output VGA1 –mode 1024x768_60.00
it show “can not get gamma size”.
I run various command.
it sticks at “can not get gamma size”.
i suffer from low resolution & stict at 800*600
iwant to change 1024*768 and 1280*1024
please anybody help me out
thank you very much in advance
Try this: Just open xorg.conf and add the –>
Section “Monitor”
Gamma 1.00 1.00 1.00
EndSection
Save and reboot.
I’m stuck in 1024×768 and I’d like to get at least 1280×768 (Vista looks perfect in this resolution) or anything in 16:9 that’s bigger than 1024xanything but my monitor isn’t recognized. (It’s a Toshiba 20″ theaterwide lcd tv connected via pc port.)
I have the same problem when trying to create the new modline. I get “xrandr: Failed to get size of gamma for output default”
mauricio-If: I tried that and it resulted in blank monitor.