I use 12.04. Till today I use it with an Acer trravelmate4070 and an LG screen in order to expand my desktop. Works great.

Till today that I decided to connect my LG screen to a KVM switch in order to share the big screen with an other PC when I need it. In the KVM switch the resolution is lower and I can not manually change it.

I read many solutions about making an .conf file but since I am new to Ubuntu I am afraid. Moreover I realized that these articles talk for the same problem but not as an extension screen but as a main screen. Any idea how to correctly configure this file?

These are the links that I consulted:

  • I would recommend updating the KVM Switch with latest software if they have any updates available. – user94096 Oct 2 '12 at 17:10
up vote 3 down vote accepted

I just discovered that my previous answer is not the one I'm using on my current system. That's okay. I have another solution that I've tested recently which is working. This version still changes the resolution after starting the desktop environment, but it does it using the autostart system from the freedesktop.org standard. ...

You can put a .desktop file into ~/.config/autostart to run a script that will set the right resolution for you.

In the .desktop file:

[Desktop Entry]
Comment=Fix my resolution at 1920x1080

In the script:

xrandr --newmode "1920x1080_60.00" 173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync
xrandr --addmode VGA-0 1920x1080_60.00
xrandr --output VGA-0 --mode 1920x1080_60.00

More information

My previous answer to this question has more information on what goes in the script. You can find more details and a slightly more robust version of this solution in A Better Linux Startup.

try to unplug/Plug the monitor (RGB/DVI cable) into your machine. That happened to me once

  • I did it. It dont work at all. Only if I unplug the cable and put it directly to my pc and then to the KVM will work again! – Vagelism Sep 22 '12 at 9:54
  • seems like a bug !! – user91632 Sep 22 '12 at 9:57
  • It is for sure! But how can I overcome it? – Vagelism Sep 22 '12 at 10:32
  • try another KVM :( – user91632 Sep 22 '12 at 10:35
  • The KVM works great with windows in any resolution so is not this the problem! – Vagelism Sep 22 '12 at 11:48

I had the same problem with 12.04. I used the fix from Robert Penz blog. I did not need to configure the keyboard or mouse, just the screen. This is my xorg.conf:

Section "Device"
    Identifier  "Configured Video Device"

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

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

Section "ServerLayout"
    Identifier      "Default Layout"
    Screen          "Default Screen"

I had a similar problem, but I don't know if it was exactly the same. My screen resolution was correct, but if the screensaver came on while I was switched over to the other machine, then when I returned to the Ubuntu machine and the screensaver switched off, the screen resolution was wrong. I figured that something must have polled my monitor, and when it could not find it, it used default parameters. I did 2 things. I removed Gnome-Screensaver and the associated autostart program. I am now using Xscreensaver. I uninstalled the AMD drivers. Now it is working properly.

  • Thank you for your answer. I had also the same problem with you. – Vagelism Jan 22 '13 at 9:32

I've had a similar problem for years with a budget KVM switch that doesn't even have software or settings. My solution probably isn't the right way, but it works and it's easier to understand than xorg.conf.

Doing it this way, your desktop will technically start in the wrong resolution, but it'll change before it finishes initializing anyway.

  1. Make sure you know your monitor's native resolution. Mine is 1920x1080, so that's what I'll use here.

    • See what choices xrandr says you have. You probably won't find the right resolution there. Just type xrandr with no arguments and it'll give you a list of the available modes.
    • Take a look at what xrandr calls your external monitor, too. You'll need that later. Mine is "VGA-0". The display built into the laptop is usually something like "LVDS-0".
  2. Generate a Modeline using cvt. You should already have it because it comes with Xorg Core:

    cvt 1920 1080

    The output will look something like this:

    # 1920x1080 59.96 Hz (CVT 2.07M9) hsync: 67.16 kHz; pclk: 173.00 MHz
    Modeline "1920x1080_60.00"  173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

    There's no need to understand all of those numbers, just copy everything after "Modeline" on the second line.

  3. Now, create a new mode with xrandr. This is where you'll paste the stuff you copied from after the word "Modeline":

    xrandr --newmode "1920x1080_60.00" 173.00  1920 2048 2248 2576  1080 1083 1088 1120 -hsync +vsync

    That first part in the quotes is the name of your new mode. You can change it if you want to.

  4. Now, add the mode to your monitor:

    xrandr --addmode VGA-0 1920x1080_60.00
  5. Now switch to the new mode: xrandr --output VGA-0 --mode 1920x1080_60.00

    Switch back and forth between modes a couple of times to see it work.

  6. Add the newmode, addmode, and mode lines to a file named .xinitrc in your home directory using your favorite text editor. If there isn't one there, just create it.

  • 1
    I get the following error: $ xrandr --addmode VGA-0 1280x1024_60.00 X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 153 (RANDR) Minor opcode of failed request: 18 (RRAddOutputMode) Serial number of failed request: 31 Current serial number in output stream: 32 – Val Blant Apr 1 '14 at 8:27

Ubuntu 14.04 KVM switch 41ua I spend 2 hour to solve similar problem and problem was in vga cable. Replace vga cable I can change resolution to 1920x1080 without using xrandr or xorg it's very strange.

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.