How to setup Ubuntu to use a KVM box: Nvidia Settings, Xorg.conf and an EDID File

I have not seen a clear explanation anywhere on how to do this. X and Xorg.conf is frankly atrocious and outdated and needs to replaced as soon as possible by something like Wayland.

Ubuntu no longer uses the xorg.conf settings file. The X.org server simply generates default sections on the fly. This is fine if you have a monitor directly plugged in. But if you have a KVM box (to switch between multiple monitors, mice and keyboards) that blocks full communication with the monitor then Ubuntu will boot up into an ugly low-res default resolution (or worse). Here’s how I fixed this on my machine.

First use nvidia-settings to make a basic xorg.conf settings file. Make sure you are doing this connected direct to the monitor (no KVM box).

Make sure the correct metamode, resolution and refresh rate is set, then “Save to X configuration file”. Copy the xorg.conf file from the window that brings up. Save it somewhere. Then save the EDID monitor file … there’s button for this in the nvidia-settings.

Add the EDID line as shown below to your xorg.conf file. Make sure the name at the start of the line matches with the “Identifier “Device0″” line in the device section name of your display device (examine you xorg log). Should be something like “CRT-1”.

Option “CustomEDID” “CRT-1:/home/djbarney/edid.bin”

Then remove “nvidia-auto-select” from the metamodes line in the Screen section. Leave the rest of the line as it is.

Copy your xorg.conf file to “/usr/share/X11/xorg.conf.d”. Make sure there are no xorg.conf files around that might cause trouble … look in /etc/X11. If you find any delete them.

Now connect your KVM box. Stop the X server with “sudo service gdm stop”. Then start it with “sudo service gdm start”. The server should then start with the resolution set as if you had it connected direct to the monitor.

Lastly support Wayland and other replacements for X. Xorg has an odd history and is really a mess of experimental code and peculiar standards that have built up over the years. It is not kind to Linux beginners and needs to be replaced with something sane and non-evil.

UPDATE APRIL 2013: I had not updated this post. This method works but has issues with it. For example X can sometimes get confused switching between monitors because it can only see the EDID file. I eventually bought a KVM box that saves the actual EDID data in the box so X will always be presented automatically with the correct EDID.

"... Suppression and spinning of negative data and ghostwriting have emerged as tools to help manage medical journal publications to best suit product sales, while disease mongering and market segmentation of physicians are also used to efficiently maximize profits. We propose that while evidence-based medicine is a noble ideal, marketing-based medicine is the current reality."