Forcing Monitor resolution

Cinnamon and Rosemary are now both happily rack-mounted in the basement (where it is cool, and where their many disk drives and fans can make as much racket as they wish).

Mostly I control them from the office with ssh and or vnc, but once in a while I need to actually be down there. My neighbor gave me a monitor, I have plenty of mice and keyboards, so I hooked up a KVM switch on the two of them so I didn’t have to keep getting behind the rack to move the monitor.

But alas, neither of them picked up the resolution of the monitor, I suppose (not sure) that with the KVM in the middle, they can’t really read the EDID and such stuff from the monitor. And since it is an “unknown” monitor, the display panel only shows 1024×768, 800×600 etc. The monitor itself helpfully tells me that it wants to be 1440×900 @60Hz.

After a little reading, here is what I did, on each system (both are ubuntu).

Get it to generate a modeline by giving the desired resolution to the cvt command:

cvt 1440 900 60
#1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHz
 Modeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync

Now add that modeline using xrandr:

xrandr --newmode "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -HSync +VSync

Note that the capitalization of HSync and VSync had to be changed from what cvt gave me.

Now that the new mode exists, we have to add it to the device. The device name can be found by asking xrandr for information about the current device (while you are using it of course).

xrandr --current

Among other things it will tell you the name of the device, which was VGA-0 on one of them, and VGA-1 on the other. Yes, VGA. Whaddya want? These are in the basement, I’m not playing games on them, and they have to run through a KVM.

Armed with the name of the device, add the modeline:

xrandr --addmode VGA-0 "1440x900_60.00"

This won’t survive a reboot, but it can be put into the “~/.xprofile” as follows, so that it is repeated when you log in:

xrandr --newmode "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -HSync +VSync
xrandr --addmode VGA-0 "a440x900_60.00"