I'm running Kubuntu 10.04 x64 on a Lenovo ThinkPad R500, with an external monitor attached.

If I configure extended desktop, everything works fine. The settings look like this:

extended desktop OK

After a reboot, these settings are reset and both screens are mirrored. The settings look like this:

extended desktop broken

I had my extended desktop working just fine under Ubuntu/GNOME, so I'm assuming there's something different about how KDE handles this config, I just can't seem to find the answer.

Does anyone know how to get my configuration to stick?


You can try a script using RandR, described here and here.


xrandr -q # identify the screen names: LVDS for laptop screen, VGA-0 for external monitor
xrandr --output VGA-0 --pos 1024x0 # to move the VGA screen 1024 pixels to the right.

You will also need to tweak the xorg.conf file, adding to the Screen section a Virtual definition, where the width is the maximum width of the displays added together, by the height of the biggest height.


See thinkwiki.org for more info on xrandr.
The section "Now automate it on login" is probably the one that interests you the most.
The section "GUIs" lists GUI front-ends for xrandr.

  • I'm trying to figure out how it's done in regular Ubuntu/GNOME, because it works just fine there. I use my laptop with and without the external screen all the time, and I'd prefer something that just magically works. – ThatGraemeGuy Jul 13 '10 at 7:09
  • @Graeme Donaldson: See my edit. – harrymc Jul 13 '10 at 8:08
  • You can add your xandr configuration call to the kdm startup file. – txwikinger Jul 13 '10 at 16:20
  • @harrymc: Here you go – txwikinger Jul 13 '10 at 16:21
  • Thanks, but this isn't much better. It takes me about 30 seconds every day to get my dual screen config the way I want it. I'd rather keep doing that than spend countless hours trying to figure out convoluted instructions like that wiki page. – ThatGraemeGuy Jul 15 '10 at 12:47

I replaced my xorg.conf with xrandr in /etc/gdm/Init/Default. For KDM this change can be done in /etc/kde4/kdm/Xsetup. See the Ubuntu Wiki and also the Debian Wiki. These also provide examples on resolving the problem using xorg.conf.

I added the following code to run only on my main display . (I also have a number of vncserver configurations.)

if [ -x "/etc/gdm/Init/xrandr${DISPLAY}" ];

My /etc/gdm/Init/xrandr:0 configuration file is:

xrandr --newmode 1280x1024    108.00  1280 1376 1488 1800   960  961  964 1000 +hsync +vsync
xrandr --addmode VGA-0        1280x1024
xrandr --output  VGA-0 --mode 1280x102

You will need to set the frame buffer size with the --fb option to a size large enough for both screens. Check the end of the man page for xrandr. From your example you may be able to get away with a line like:

xrandr --fb 2560x1024 --output LVDS1-o --auto --output VGA1-0 --auto --right-of LVDS1-0

Verify with xrandr that the modes are available.


You will need to manually configure a /etc/X11/xorg.conf file. It is now being generated on the fly. Your old file may work, but you will likely need to strip out most of the non-monitor related stuff.

  • This was a fresh install, I haven't got an old file. Any pointers for what I should put in it? – ThatGraemeGuy Jun 8 '10 at 7:39
  • You will need the sections: Monitor, Screen, and ServerLayout. Try 'Xorg -configure' and strip out the non-display components. Check the contents of /var/log/Xorg.0.log to see what is being configured. – BillThor Jun 8 '10 at 19:22
  • Will have to try that when I'm at work on Monday. Right now I'm at home and I don't have an external display. – ThatGraemeGuy Jun 12 '10 at 19:26
  • I had stop stop kdm first, else "Xorg -configure" complains that the server is already running. My xorg.conf.new file is here: dl.dropbox.com/u/279025/xorg.conf.new, but the screen/monitor section seems very plain. – ThatGraemeGuy Jun 29 '10 at 7:40
  • I expect the output from configure will be fairly plain. You will likely have to read the documentation on the configuration file to add the second monitor and specify its location. – BillThor Jun 29 '10 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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