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:
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 EndSection
Reboot 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.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- Doing for User Space What We Did for Kernel Space
- SuperTuxKart 0.9.2 Released
- Parsing an RSS News Feed with a Bash Script
- Google's SwiftShader Released
- SourceClear Open
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide