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"
  <INSERT MODELINE HERE>
EndSection
Section "Screen"
  Identifier "Screen0"
  Device "<INSERT DEVICE HERE>"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "<INSERT MODENAME HERE>"
  EndSubSection
EndSection

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
EndSection

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

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!

62 thoughts on “Enabling Resolutions in Ubuntu 12.04 & Lubuntu 12.04

  1. Jake July 3, 2012 at 6:22 am Reply

    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.

    Thanks
    Jake

  2. Just Another Someone (@SomeonesThought) August 17, 2012 at 7:50 pm Reply

    leafpad is not a command? Help ?!

    • Toukakoukan August 17, 2012 at 7:52 pm Reply

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

  3. Just Another Someone (@SomeonesThought) August 19, 2012 at 11:30 am Reply

    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?

  4. Just Another Someone (@SomeonesThought) August 19, 2012 at 11:31 am Reply

    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 August 19, 2012 at 11:35 am Reply

      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.

  5. Just Another Someone (@SomeonesThought) August 19, 2012 at 11:39 am Reply

    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

  6. thanks September 25, 2012 at 8:26 am Reply

    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!

  7. Dan Zimney (@dzimney) October 2, 2012 at 4:44 pm Reply

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

  8. bdovpro October 5, 2012 at 5:18 am Reply

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

    • Dan Zimney (@dzimney) October 11, 2012 at 2:05 pm Reply

      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.

  9. Aragorrn October 9, 2012 at 6:36 pm Reply

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

  10. LinuxNub October 21, 2012 at 7:15 pm Reply

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

  11. Newbie October 28, 2012 at 2:45 am Reply

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

  12. Chris November 3, 2012 at 9:27 am Reply

    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.

    Thanks,
    Chris

  13. ait November 8, 2012 at 2:32 pm Reply

    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
    why?

  14. XYLAMIC November 20, 2012 at 1:07 am Reply

    This worked like a dream! Thanks!

  15. Manuel December 7, 2012 at 1:26 pm Reply

    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?

    Thanks.

  16. Devon (@dtourond) December 24, 2012 at 10:29 pm Reply

    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..

  17. Mark January 10, 2013 at 12:44 am Reply

    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!

  18. philsbury January 20, 2013 at 5:30 pm Reply

    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?

  19. Harvey February 28, 2013 at 1:01 am Reply

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

  20. marnixava February 28, 2013 at 3:53 pm Reply

    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.

  21. Bernd Becker March 13, 2013 at 6:41 pm Reply

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

  22. [...] This is the xorg.conf I used with my “headless” system. It came from this blog post and I did have to save it as xorg.conf and not the filename shown in the [...]

  23. texhood April 8, 2013 at 11:41 pm Reply

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

  24. xcarolr April 13, 2013 at 8:42 pm Reply

    Thanks for this helpful guide!

  25. Ben April 27, 2013 at 11:13 pm Reply

    Hi,
    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 August 7, 2014 at 3:19 am Reply

      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?..

  26. Francesco May 1, 2013 at 10:07 am Reply

    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
    EndSection

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

    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! :)

  27. equiman May 20, 2013 at 2:13 am Reply

    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)

  28. Jonas Silickas June 9, 2013 at 3:47 pm Reply

    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!

  29. […] what? The winner is Sam Martin, proposing to create a “modern” /usr/share/X11/xorg.conf.d/10-monitor.conf Xorg […]

  30. nickpheas July 5, 2013 at 8:41 pm Reply

    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?

  31. […] advice is greatly welcome, I’ve tried the xorg.conf version as well and it did not work. Tutorial I tried. Thank […]

  32. […] advice is greatly welcome, I’ve tried the xorg.conf version as well and it did not work. Tutorial I tried. Thank […]

  33. Keith Armstrong August 24, 2013 at 12:39 pm Reply

    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!

  34. [ubuntu] resolution topic | My Blog August 25, 2013 at 8:41 pm Reply

    […] I have tried adding a 10-monitor.conf to add a 1920×1080 mode..following this http://samuelmartin.wordpress.com/20…lubuntu-12-04/ […]

  35. […] I have tried adding a 10-monitor.conf to add a 1920×1080 mode..following this http://samuelmartin.wordpress.com/20…lubuntu-12-04/ […]

  36. […] I have tried adding a 10-monitor.conf to add a 1920×1080 mode..following this http://samuelmartin.wordpress.com/20…lubuntu-12-04/ […]

  37. El Pipi October 9, 2013 at 1:32 am Reply

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

  38. Vivek P October 12, 2013 at 2:29 pm Reply

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

  39. Greg Ellis November 1, 2013 at 11:53 am Reply

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

  40. Juraj November 2, 2013 at 9:16 am Reply

    Hi,

    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?

    Thanks,
    Juraj

  41. G. Alonso. November 24, 2013 at 12:30 am Reply

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

  42. Larry Kamons November 26, 2013 at 2:03 am Reply

    THANK YOU THANK YOU THANK YOU

    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!

  43. Abhishek Pathak December 19, 2013 at 5:32 am Reply

    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.

  44. Abhishek Pathak December 19, 2013 at 5:37 am Reply

    *commands cvt and gtf

  45. Czarek Tomczak January 29, 2014 at 5:26 pm Reply

    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

  46. Lisa March 4, 2014 at 12:48 pm Reply

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

  47. Mark March 30, 2014 at 10:45 pm Reply

    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!

  48. Dan Stay April 17, 2014 at 5:48 pm Reply

    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.

  49. William Seddon May 3, 2014 at 11:51 am Reply

    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.

  50. NakNak May 31, 2014 at 10:26 pm Reply

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

    4 days struggling to find a working solution for 14.04!

    YOU ARE THE MAN!!!

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

  51. Denis Nelubin July 3, 2014 at 6:38 pm Reply

    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).

  52. Golan August 19, 2014 at 1:02 pm Reply

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers

%d bloggers like this: