Guerrilla Tactics to Force Screen Mode in Ubuntu
Readers of my previous posts will know about the bad luck I've had when it comes to getting the screen setup on Linux, particularly with Ubuntu Linux. It's a particularly annoying problem when the hardware detection goes wrong and one is presented with a list of unsuitable screen modes. What follows is a way of using XRandR (X Rotate and Resize) to brute force a desired screen mode for X when conventional routes have failed.
Once you've added the new mode and tested that it works, you can add it to your xorg.conf or to the startup script of your login manager. Most of what follows assumes that you are using Ubuntu Linux, but it should work just as well with all but the most unusual distributions.
If you're having a problem whereby your monitor immediately goes blank and reports that the incoming signal is out of range when X starts, it might be worth attempting to the change the screen mode by hitting ctrl+alt+[minus symbol]. Repeatedly pressing this combination might select a screen mode that your monitor can display.
Once you have a usable display, open up a command line and type:
xrandr
When you invoke XRandR with no parameters, it lists the currently supported screen modes. Typical output might look something like this:
Screen 0: minimum 800 x 600, current 800 x 600 , maximum 800 x 600 default connected 800x600 +0+0 0mm x 0mm 800x600 60.0
If the screen resolution and refresh rate that you need are listed here, it might be a good idea to try changing the screen mode using the standard tools for your desktop environment or the specific tools for your graphics card driver.
If your desired resolution is not displayed, you can add it to the system using XRandR. First generate a modeline for your screen setup using the cvt command. For example, if you need a screen mode of 1280x1024 at 60Hz, type:
cvt 1280 1024 60
The output should look something like this:
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
Add this mode to the system using XRandR
xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
I got the technical information I needed by copying and pasting everything after the word “Modeline” from the output of cvt. Now type “xrandr” again to make sure that the new mode has been added to the system. You should see it listed along with the other modes. Note that the string “1280x1024_60.00" in that example is simply the name of the mode, the actual numbers in the name are irrelevant. Once the mode has been created, attach it to a display output using the following.
xrandr --addmode default 1280x1024_60.00
On my setup, the display output is called “default”, as revealed by the second line of the output of the xrandr command with no parameters. Now try changing to the new screen mode.
xrandr --output default --mode 1280x1024_60.00
If this works, you're ready to make the change permanent. You can do this by editing the xorg.conf file or adding a command sequence to a startup file.
Basically, you add the modeline to the “Monitor” section of your xorg.conf file and the mode itself to the “Display” subsection within the “Screen” main section, adding to or replacing what's already there.
So, in keeping with the above examples, the Monitor section should look something like this:
Section "Monitor"
Identifier "default"
Modeline "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync
Option "PreferredMode" "1280x1024_60.00"
EndSection
and the Screen section something like:
Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Modes “1280x1024_60.00”
Depth 24
EndSubSection
EndSectionReboot and see if you have a working display.
Another way of doing this is to add the command sequence that you've already used to your login manager. This is a last resort if other means simply refuse to work, but it works pretty well. In the case of KDM, the KDE4 login manager, you should be able to edit the startup script by typing
sudo kwrite /etc/kde4/kdm/Xsetup
The equivalent GDM (Gnome) file is “/etc/gdm/Init/Default”. Using the setup above as example, simply cut and paste the following lines to this file.
xrandr --newmode "1280x1024_60.00" 109.00 1280 1368 1496 1712 1024 1027 1034 1063 -hsync +vsync xrandr --addmode default 1280x1024_60.00 xrandr --output default --mode 1280x1024_60.00
There you have it, a rather guerrilla method of forcing the screen to do what you want.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
| Dart: a New Web Programming Experience | May 07, 2013 |
- RSS Feeds
- New Products
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Drupal Is a Framework: Why Everyone Needs to Understand This
- Home, My Backup Data Center
- A Topic for Discussion - Open Source Feature-Richness?
- What's the tweeting protocol?
- Dart: a New Web Programming Experience
- Developer Poll
- Trying to Tame the Tablet
- Reply to comment | Linux Journal
43 min 9 sec ago - Reply to comment | Linux Journal
3 hours 15 min ago - Reply to comment | Linux Journal
4 hours 32 min ago - great post
5 hours 7 min ago - Google Docs
5 hours 30 min ago - Reply to comment | Linux Journal
10 hours 18 min ago - Reply to comment | Linux Journal
11 hours 5 min ago - Web Hosting IQ
12 hours 39 min ago - Thanks for taking the time to
14 hours 16 min ago - Linux is good
16 hours 13 min ago
Enter to Win an Adafruit Prototyping Pi Plate Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Prototyping Pi Plate Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- Next winner announced on 5-21-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
ubuntu scr res
My computer claims to have 1280x1024 screen, ubuntu allows for that size, but refuses to believe the computer.
So I added xforce vga=771 to the boot and that seems to work well enough.
g
Crude, thought we were past that!
I recall having to do this sort of nonsense back over 12 years ago using Slackware. I've been running Mandriva for almost 8 years now and this type of screen setup is unheard of! Just run XFdrake and the utility does all this for you, from the command line.
When I looked at Ubuntu, I could not understand all the excitment surrounding it. I found Ubuntu to be crude and lacking a *lot* of polish that I otherwise take for granted.
How to set max monitor resolution
Hi. I have tried to change desktop resolution for xubuntu virtual machine (running under xen), but encoutered following error
xrandr: screen cannot be larger than 800x600 (desired size 1024x768)How can I set up the resolution of virtual screen?
I have exactly the same
I have exactly the same issue. Using VirtualPC 2007.
There is a lot of information and much chat on how to make the changes mentioned above permanent etc, but nowhere can I find information on what to do if the above steps dont work! I too get the error: "screen cannot be larger than 800x600 (desired size 1024x768 )"
Seems logical that Additions for Virtual PC would sort it but I can't find an ubuntu version so dead end has been reached :¬(
Anyone..?
Not sure this will work for me
On my system-- a laptop with nvidia graphics-- there is almost nothing in the xorg.conf:
I'm not worried about setting the resolution of my primary display (the laptop screen)-- but I find that for about half the projectors I try, the laptop does not successfully read their edid, so I'm left with 640x480.
I usually set them up using TwinView, with the projector echoing the upper left corner of my screen.
Given the paucity of information in my xorg.conf and my desire to change the resolution of an external screen, can you provide guidance on how I would modify the instructions above to successfully reach, say, a 1280x1024 resolution on a projector that isn't behaving well (i.e., not broadcasting an edid correctly)?
nvidia-settings
Does the nvidia-settings command work? If not, nvidia-settings can generate a fresh xorg.conf file, that might be more complete.
If you can't get that to work and the xrandr command does allow you to manually set the screen mode you want, it might be worth adding the command sequence to the startup script of your login manager as described. Try it, would be my advice.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.
A good thing about using
A good thing about using Xrandr is that you can always try it to see if it works from the command line without editing any files.
HELP
Greetings from Venezuela, I got this problem with my video card Drivers, my card It's a Nvidia GeForce 6200, using Ubuntu 10.04, my monitor It's a Samsung 19" widescreen.
The resolution 1440x900 doesn't get it from the drivers... Did search the Nvidia page, got the driver but nothing...
This metod that you mention here would work to force that resolution???
Thanx in advance for the attention and congratulation for the blog, had learn a lot with all of you.
I had similar problems with
I had similar problems with my Samsung monitors. I had 2 connected to an ATI card. The one connected to the DVI port set is resolution correctly. The one connected to the VGA port wouldn't. I checked the X log and the monitor was reporting the wrong resolutions when connected via the VGA cable, but not the DVI cable. In the end I got an HDMI to DVI cable and connected the second monitor to that. Then both monitors worked correctly.
Try it
A good thing about using Xrandr is that you can always try it to see if it works from the command line without editing any files.
UK based freelance writer Michael Reed writes about technology, retro computing, geek culture and gender politics.
Excellent! Just what i was
Excellent!
Just what i was looking for.
Debian Lenny with an ati card and the proprietary drivers set don't get the full resolution of my LCD.
01010010 01010100 01000110 01001101 00100001