Enabling Resolutions in Ubuntu 12.04 & Lubuntu 12.04

Earlier I was setting up a new Lubuntu powered computer which was to be connected to a TV via HDMI as its primary display. When I set it up with my TV it recognised 1920×1080 as a viable resolution no problem at all.
When I went to set it up on its destination display it refused to display anything above 1280×720.
“What gives?” I thought to myself. Well, I never found out what gave, but here’s how to fix it:

The problems:

  • xandr based commands reset whenever you restart, and while you can (apparently) set the commands to run on startup, my attempts to do so proved fruitless.
  • xorg.conf is A) deprecated B) couldn’t be generated by Xorg :1 -configure.
  • /etc/X11/xorg.conf.d/10-monitor.conf (the proper replacement for xorg.conf) path (as specified by the Archlinux Wiki) was nowhere to be found, and creating it did nothing.

The solution:

It turned out after some Googling that xorg config files had been moved to /usr/share/X11/xorg.conf.d/

So, what do we do with that information? Well first we need two bits of machine-specific information.

1) We need to generate a modeline

We do so by going into terminal and typing “gtf x y r” where x is the horizontal resolution, y is the vertical resolution and r is the refresh rate (which is largely irrelevant since LCDs are the norm). So for example, mine was:

gtf 1920 1080 60

You’re probably safe to keep the refresh rate at 60 unless you have a good reason to do otherwise. Once you’ve executed the command you’ll be presented with something like this

# 1920×1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz Modeline “1920x1080_60.00″  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync

We’re only interested in the second half, so make a note of everything from modeline onwards.

2) We need to find the display interface name

In the terminal type: xrandr
This will  give you something along the lines of:

Screen 0: minimum 64 x 64, current 1920 x 1080, maximum 32000 x 32000 HDMI-1 connected 1920×1080+0+0 0mm x 0mm

The display interface name is the bit before ‘connected’ so in this case ‘HDMI-1′. Make a note of yours.

3) Creating  the 10-monitor.conf

In order to create our spangly new resolution we need to create /usr/share/X11/xorg.conf.d/10-monitor.conf
So in the terminal run:

sudo leafpad /usr/share/X11/xorg.conf.d/10-monitor.conf

This will open a blank text file, into which you want to paste the following:

Section "Monitor"
  Identifier "Monitor0"
Section "Screen"
  Identifier "Screen0"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24

The modename is the bit in quotes (so 1920x1080_60.00 in our earlier example). You can add additional resolutions that already exist in the list xandr shows just by putting them in quotes and adding them to the end of the modes line.

So for reference, mine looks like this:

Section "Monitor"
  Identifier "Monitor0"
  Modeline "1920x1080_60.00" 82.97 1000 1064 1168 1336 1000 1001 1004 1035 -HSync +Vsync

Section "Screen"
  Identifier "Screen0"
  Device "HDMI-1"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "1920x1080_60.00" "1024x768"

And you’re done!

Once you’ve saved 10-monitor.conf in /usr/share/X11/xorg.conf.d/, restart your computer and you should have your brand new resolution available and set as default.

What to do if it all goes wrong.

If you get a black screen on restarting, don’t panic, it probably means a typo or other syntax error of some description.
While the computer’s on, hit ctrl+alt+F1 to go into a terminal and run:

sudo rm /usr/share/X11/xorg.conf.d/10-monitor.conf

Then restart and you’ll be back to defaults! Hope this saves someone some time and hair-pulling!

  • Jake

    Thank you so much for sharing this information. And thank you for giving a little redundancy. It really helps a lot that things like file names and paths are repeated and that your working example and the general template (both) are given. So often people don’t include these important things.

    It didn’t quite work for me but I still think you’re on to something with this. My setup is a little different. It’s Ubuntu 12.04 server base system with lxde installed on that and it’s a vm. I actually have resolution problems with the same kind vm (12.04 server with lxde installed on top) on 3 different virtualization platforms; and, yes, I’ve been pulling my hair out for about a week now. This is the first decent info I’ve seen (mostly there’s no info at all).

    So what was my result? This was done on the vm running in vmware workstation 8. After creating the 10-monitor.conf file in /usr/share/X11/xorg.conf.d/ and rebooting lxde would not fire up at all. All I got was a tty log in screen. I cp’d the file to the desktop, did a rm to remove it from it’s original location and rebooted. After fixing a typo and rebooting again, lxde fires up now but it’s still the old 800×600 resolution (I have two 23″ monitors supposed to run at 1920×1080). Not sure what the problem is but I’ll keep messing with it and see if I can get any further with it.. If you have any suggestions I’d sure appreciate it.


  • http://twitter.com/SomeonesThought Just Another Someone (@SomeonesThought)

    leafpad is not a command? Help ?!

    • Toukakoukan

      Just substitute leafpad for whatever text editor you use, gedit, nano, vi, etc…

  • http://twitter.com/SomeonesThought Just Another Someone (@SomeonesThought)

    I did exactly as you did (I even installed leafpad), but when I reload I don’t get a different resolution, just the same one. Is there a step I may have missed?

  • http://twitter.com/SomeonesThought Just Another Someone (@SomeonesThought)

    Just noted that the modeline in your reference 10-monitor.conf does not conclude with ‘+Vsync’, is that a mistake on your behalf or mine?

    • Toukakoukan

      It should, it’s just the styling on this wordpress theme cuts it off. Copy and paste the example into a text editor to see the full line.

  • http://twitter.com/SomeonesThought Just Another Someone (@SomeonesThought)

    Not sure if this is a problem but when I type xrandr, I get failed to get size of gamma for output default, then I get the Screen 0 stuff.

    Really need help with this! Thanks

  • thanks

    Worked perfectly, thanks! My screen’s name was “default” and its resolution was different, but other than that everything went exactly as it should’ve!

  • http://twitter.com/dzimney Dan Zimney (@dzimney)

    For my configuration I had to leave out “1024×768″ of the Modes line in the “Display” subsection.

  • bdovpro

    anyone actually get this to work? My resolution wont change at all.

    • http://twitter.com/dzimney Dan Zimney (@dzimney)

      I had this working for a week. This morning I started up my machine and it all suddenly wasn’t working. It’s like the 10-monitor.conf file is being ignored suddenly.

  • Aragorrn

    Thank you soooo much.
    It worked for me. I have been struggling for days. You saved my mental health :)

  • LinuxNub

    Thanks a bunch. Well written guide and worked like a charm.

  • Newbie

    Thanks alot… Im new to linux and this just had me confounded..

  • Chris

    Hello. Thanks for looking into this. While it works, I’m want to modify it to work for external monitors with a laptop. The main problem is that the VGA input on the laptop can be connected to many different types of monitors. Unfortunately, my main home monitor has a bad EDID. With a bad EDID, how can xorg.conf even distinguish that the bad monitor is connected. I’d really like Xorg to use the EDID if it exists but use my custom settings if it can’t read the EDID.


  • ait

    altough your gtf output is
    Modeline “1920x1080_60.00″ 172.80 1920 2040 2248 2576 1080 1081 1084 1118
    your 10-monitor.conf file is
    Modeline “1920x1080_60.00″ 82.97 1000 1064 1168 1336 1000 1001 1004 1035

  • http://gravatar.com/xylamic XYLAMIC

    This worked like a dream! Thanks!

  • Manuel

    Thank you for your tutorial.

    Something weird occurs in my tryout: after following your steps and restarting the computer, the external monitor works in the login screen but, when I log in, there appears the “out of range” message again.

    I’ve tried with Unity and Gnome Classic.

    I think it is important to tell that the resolution appearing when running on the logging screen it’s not the refresh rate I typed in the monitor.conf I generated.

    Any tip?


  • http://twitter.com/dtourond Devon (@dtourond)

    I tried this and it didn’t work. I’m trying to get my iMac G3 to display a picture but so far it only works when I plug an external monitor. I think the problem is that the iMac needs a refresh rate of 75Hz if it’s set to 1024×768, and the only refresh rate I can set it to for that resolution is 60. That’s probably why it doesn’t work..

  • Mark

    I tried this and my monitor couldn’t see the resolution and it turned off. I tried the recovery which didn’t work and had to reload everything!

  • philsbury

    This worked pretty nicely, however the image quality is now quite blurred. I’ve tried importing colour profiles and the such but no joy.

    If I remote desktop into it from my Mac it looks fine. Any thoughts?

  • http://Keitel Harvey

    Thanks, but this doesn’t work at all. Lubuntu is a crappy Linux distro.

  • http://gravatar.com/marnixava marnixava

    Great. Worked for me, even though I initially used resolution 1920×1080 while I meant to use 1920×1200. I thought I could save a reboot by going into a ALT-CTL-F1 terminal and doing a “service lightdm restart”, but that didn’t seem to work. Rebooting worked. FYI, there are two places in the article where “xrandr” is spelled “xandr” (missing the first r). Thanks a lot for this info.

  • http://www.facebook.com/bernd.becker.731 Bernd Becker

    How can I recycle my perfectly well working xconf file from ubuntu 9.04?
    Bang it into /usr/share/X11/. and pray?

  • Pingback: Installing Ubuntu Linux in place of OS X on a Mac Mini » TechNotes()

  • texhood

    This worked great with Ubuntu 12.04 and a VIZIO 47″ TV!

  • xcarolr

    Thanks for this helpful guide!

  • Ben

    Thanks for the great tutorial! I oops however, but I know what I did. Do you know how I can reset my modeline? Right now it says something along the lines of 0x0 0hz..etc….
    Is there some way I can manually reset it? Or copy/paste your modeline above and set mine to it?

    Thanks :-)

    • Trend

      Same shit with my old Dell Inspiron 1100. (0x0_0)
      However, my problem is not the wrong resolution, it’s the color depth. It seems to be just 8-bits, and nothing I do would ever change that.
      The above solution wouldn’t help either. Blank screen on reboot, that’s all. Tough luck, what else to say?..

  • http://gravatar.com/fr2632 Francesco

    Hi, thanks for this tutorial!

    When I type “gtf x y r” I get this which looks weird:

    # 0x0 @ 0.00 Hz (GTF) hsync: -nan kHz; pclk: -nan MHz
    Modeline “0x0_0.00″ -nan 0 -2147483648 -2147483648 -2147483648 0 1 4 1 -HSync +Vsync

    Also, I created the 10-monitor.conf file but nothing happened after reboot? This is my 10-monitor.conf file :

    Section “Monitor”
    Identifier “Monitor0″
    Modeline “4320×900″ 251.07 4320 4336 4352 4480 900 903 912 934 -HSync +VSync

    Section “Screen”
    Identifier “Screen0″
    Device “DVI-I-1″
    Monitor “Monitor0″
    DefaultDepth 24
    SubSection “Display”
    Depth 24
    Modes “4320x900_60.00″ “1440×900″

    I struggle to set a resolution of 4320×900 with a TripleHead2Go and 3x 22 inches monitors. Currently, the Nvidia X server settings gives me a max resolution of 3840×1024.

    Can you may help me on this?

    Thanks in advance! :)

  • Pingback: SOLVED - TripleHead2Go vs Ubuntu | Ubuntu Info - James n Sheri.comUbuntu Info – James n Sheri.com()

  • Pingback: TripleHead2Go vs Ubuntu | Ubuntu Info - James n Sheri.comUbuntu Info – James n Sheri.com()

  • Pingback: [lubuntu] Resolution and SiS 671 graphics card driver problems | Ubuntu Info - James n Sheri.comUbuntu Info – James n Sheri.com()

  • http://gplus.to/equiman equiman

    Thanks!! I’m searching all day… and finally found a solution that works!!

    Thanks a lot… now I have:
    Ubuntu 13.04 with gnome shell 3.8
    Nouveau drivers 1280×1024 resolution
    Graphic card Nvidia 6800 XT

    Thanks Thanks Thanks!!! Maybe I publish this solution in spanish (with respectively credits)

  • http://gravatar.com/jsilickas Jonas Silickas

    Dear Sam Martin,

    Really very thanks! I’ve been looking for a solution to my problem for weeks and only its orientation solved my problem. Thank you very much. Now I’m your fan!

  • Pingback: Tackling native screen resolution problems on virtual ubuntu guest installs | Bitbach's Blog()

  • http://gravatar.com/nickpheas nickpheas

    Tried that. It says ‘out of range’ and will not boot or respond to control+alt+f1.
    Really? In 2013 the only way to set the screen resolution is to guess at configuration files and reinstall the os if you guess wrong?

  • Pingback: Ubuntu 12.04: Adding new screen resolutions under virtualbox | tanhaaiyaaN()

  • Pingback: Error when using XRANDR to add new resolution | WyldePlayground.netWyldePlayground.net -()

  • Pingback: Error when using XRANDR to add new resolution | Ubuntu InfoUbuntu Info()

  • http://www.belkast.com Keith Armstrong

    This worked like a charm. The only thing I had to do (I use Ubuntu 13.04) extra was to go in to the Display section of the System Settings and pick the new resolution (which had shown up). When I initially rebooted, the resolution was the same as when I had shut down…but all is great! Thanks!

  • Pingback: [ubuntu] resolution topic | My Blog()

  • Pingback: [ubuntu] resolution | WyldePlayground.netWyldePlayground.net -()

  • Pingback: [ubuntu] resolution | Ubuntu InfoUbuntu Info()

  • Pingback: [lubuntu] Lubuntu 13.04 Screen Resolution Problems | Ubuntu InfoUbuntu Info()

  • Pingback: [lubuntu] Lubuntu 13.04 Screen Resolution Problems | WyldePlayground.netWyldePlayground.net -()

  • El Pipi

    newbie in unbutu… felt like wining a championship!!!!
    With your generous help.
    Thaks a lot Sam!!!!

  • Vivek P

    THANK YOU !!!! .. was stuck with 8 bit colors in lubuntu 13.04 .. now it works just fine !!

  • Greg Ellis

    I have had to load text file with xrandr commands for the past 3 years – this is brilliant!

  • Juraj


    great tutorial, works well!

    I have a notebook on dock station.

    So I have two screens, and I am using only one when on dock (VGA mon). Is it possible to put some additional info in 10-monitor.conf for Modeline, Device and Modes? Or, create new, e.g. 11-monitor.conf and enter info for inbuild notebook display?

    That way, I could use a notebook when not on docking. So, can I put additional modes for notebook in built screen in current 10-monitor.conf, or create a new one for this inbuilt display?


  • http://www.eltransversal.es G. Alonso.

    Thanks I was all tge day trying to configure resolutions, and now I understand the changes on xorg.conf

  • Larry Kamons


    I have been searching for this for days!

    I am attempting to rid my life of MS Windows and want to standardize on Ubuntu.

    Thanks again!

  • https://plus.google.com/101593322995531828868 Abhishek Pathak

    Thank you so much. Worked like a charm. I have a question though.
    What is the difference between the commands and ? They return slightly different values for me. cvt returns 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync and gtf returns 108.88 1280 1360 1496 1712 1024 1025 1028 1060 -HSync +VSync.
    PS: I had earlier changed my resolution using xrandr and added a start up script which would do the same at start up. It worked until I changed from Unity to GNOME 3. So it is possible to change resolution using xrandr but your solution is simply better.

  • https://plus.google.com/101593322995531828868 Abhishek Pathak

    *commands cvt and gtf

  • https://plus.google.com/104260618289594041237 Czarek Tomczak

    I have followed these instructions, but only at login screen the resolution and refresh rate were correct. After I logged in, hdmi monitor went 30hz and it was blurry again. I am able to manually set the right setting for hdmi monitor using this command:

    xrandr –output HDMI1 –mode 1920×1080 –rate 60

  • Lisa

    Thank You This worked for me only difference was in the beggining I used cvt as opposed to gtf

  • http://www.markcassino.com/b2evolution/index.php Mark

    Thanks for posting this. At first this did not work for me, but as I researched things I saw a comment somewhere that if you are running with proprietary drivers changes made through xrandr, xorg.conf, or ../xorg.conf.d have no effect. I was using the nVidia drivers… Once I uninstalled them the approach detailed above worked perfectly. Yea!

  • http://stayonline.us Dan Stay

    Thank you very much for this writeup, it’s accurate and well written. I could have saved myself several hours of troubleshooting if I had followed these instructions first on a new lubuntu install.

  • William Seddon

    I have tried many of the other “fixes” for this issue, and this is the first one that has worked for me. Thank you so much for the clear, concise instructions. I am using an old Dell Optiplex on an old Sylvania 42″ LCD TV, and I was stuck with 1024×768 or lower at startup. I am running Lubuntu 12.04LTS.

  • NakNak

    Tell me where i can find you to kiss your feet!!!

    4 days struggling to find a working solution for 14.04!


    THANK YOU VERY MUCH FOR SHARING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • https://plus.google.com/+DenisNelubin Denis Nelubin

    I’ve got the necessity to add this line to Screen section:
    Option “Monitor-VGA-0″ “Monitor0″
    Where VGA-0 is the output name (as it’s passed to xrand command).

    It’s necessary for multihead devices. Overwise the configuration will be allplied to the first output only (HDMI in my case).

  • Golan

    thanks mate !
    your advice works perfect on linux mint 17.

  • Harpreet

    Thanks man!!