Workaround for the Ubuntu problem with KVM switches

August 26, 2009

It seems that Ubuntu not only Karmic (9.10), but also older versions have a problem with KVM (Keyboard, Video, Mouse) switches. To be exact the problem is the auto-detection of the capabilities of the monitor. If you connect the monitor directly to the computer everything works, if you use a KVM switch you get only 800×600 as the maximum resolution.

The workaround is to tell the xserver the Horizsync and Vertrefresh the monitor really supports. With older Ubuntu versions you could just add following lines (for a 1280×1024 LCD) to your /etc/X11/xorg.conf in the monitor section:


Section "Monitor"
        .....
        Option          "DPMS"
	Horizsync 31.5-64.0
	Vertrefresh 56.0 - 65.0
        .....
EndSection

But starting with Karmic Ubuntu has no /etc/X11/xorg.conf file by default anymore. So what we need is a complete minimal xorg.conf file so we can include our 3 lines, but we don’t want to mess anything else up. This is the minimal config I came up with.


Section "InputDevice"
	Identifier	"Generic Keyboard"
	Driver		"kbd"
	Option		"XkbRules"	"xorg"
	Option		"XkbModel"	"pc105"
	Option		"XkbLayout"	"de"
	Option		"XkbVariant"	"nodeadkeys"
EndSection

Section "InputDevice"
	Identifier	"Configured Mouse"
	Driver		"mouse"
EndSection

Section "Device"
	Identifier	"Configured Video Device"
EndSection

Section "Monitor"
	Identifier	"Configured Monitor"
        Option          "DPMS"
	Horizsync 31.5-64.0
	Vertrefresh 56.0 - 65.0
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"Configured Monitor"
	Device		"Configured Video Device"
        SubSection "Display"
                Depth           24
                Modes           "1280x1024" "1024x768"
        EndSubSection
EndSection

Section "ServerLayout"
        Identifier      "Default Layout"
        Screen          "Default Screen"
        InputDevice     "Generic Keyboard"
        InputDevice     "Configured Mouse"
EndSection

Except the Keyboard stuff the should be nothing thats not minimal. Maybe it is also possible to remove some lines there, but I didn’t test it. I was happy that it worked this way ;-). If you’ve an even more minimal config write a comment please!

8 Comments »

RSS feed for comments on this post. TrackBack URI

  1. only the device, monitor and screen sections are required as far as i can tell. it works fine on my box without the others.

    Comment by dan — November 4, 2009 #

  2. I’m using Ubuntu 11.04 – the Natty Narwhal – released in April 2011

    The second solution solved the problem.

    Thanks.

    Comment by Shimon — August 3, 2011 #

  3. Worked awesome!

    I only had problems with my desktop (both laptops worked fine) all of them with Ubuntu 11.10

    I manually set the xorg.conf file and now I’ve got full res in every VGA!

    Thanks!!!!

    Comment by Jeronimo — November 4, 2011 #

  4. Finally got the resolution back.
    Working fine now with 1280×1024 (19″ Monitor), but in Ubuntu 11.10 you need to have the subsection in screen section, if not it won’t do.

    thanks a lot

    Comment by Eva — November 29, 2011 #

  5. I found another one (as the method presented here didn’t work for me and that post is the most fruitful I obtained via google)

    Working for me with 1920×1200 resolution with a cheap KVM (announced to work for 1920×1440 VGA resolution)

    1. Get a working xorg.conf file for your system using whatever method
    2. Get in a terminal the modeline corresponding to your monitor and desired resolution using :
    gtf 1920 1200 60
    (in my case, first param for the width, 2nd for the height and 3rd for the freq… on new computer you should access these information in the menus from comuter)
    3. Modify your xorg.conf :
    Add the obtained modeline in the “Monitor” Section

    Section "Monitor"
    Identifier "Configured Monitor"
    Modeline "1600x1200_75.00" 205.99 1600 1720 1896 2192 1200 1201 1204 1253 -HSync +Vsync
    Modeline "1920x1200_60.00" 193.16 1920 2048 2256 2592 1200 1201 1204 1242 -HSync +Vsync
    EndSection

    in my case

    Finally add the corresponding Mode with the same name as in the modeline in the Subsection Display of the section “Screen”


    SubSection "Display"
    Modes "800x600" "1024x768" "1600x1200_75.00" "1900x1200_60.00"
    EndSubSection

    Hope it can help…

    Comment by Fikfik — January 17, 2012 #

  6. I just purchased an iogear GCS22U and pasted in what you have including keyboard and logged out and back in and it works like a champ thanks! Also using Ubuntu 11.x

    Comment by Michael Berg — February 2, 2012 #

  7. Thanks a lot for your valuable fix. I’ve been trying vainly to find in the BIOS anything resembling to “enable KVM”.
    Your solution IS V solution on my ubuntu 12.10 freshly installed and updated.
    Thanks for the comfort you gave me.

    Comment by Joetke — December 19, 2012 #

  8. Hello, What about if I got an UBUNTU 12.04 tls and a 1280×768 resolution. How do I create and xorg.conf.
    Thanks a lot, I am trying to learn linux

    Comment by Hector — June 4, 2013 #

Leave a comment

XHTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Powered by WordPress
Entries and comments feeds. Valid XHTML and CSS. 36 queries. 0.055 seconds.