Ubuntu jaunty - external monitor annoyance

3 minute read

Just to give equal opportunity to issues I have with Ubuntu, here’s one that bit me today.

I like to use a dual monitor configuration with my laptops, because I tend to have a lot of windows open when I work (terminals, browsers, remote desktops, email, various documents, etc). With Windows this is fairly straight forward, just suspend the laptop, connect the monitor, and bring the laptop back up. Go into your display properties and setup as desired. Most modern video drivers/chipsets will work fine, or at least get the basics right.

Historically with the olde X Window system just setting up one monitor was tricky enough, and two monitors was quite a challenge. Swapping monitors around on the fly was unheard of. Luckily, we’ve moved past those days, mostly. You can do the same thing with Ubuntu 9.04 (maybe 8.10) as with Windows - suspend the laptop, attach the monitor, bring the laptop back up, and go to the display properties – the external monitor just works.


The current incarnation of the Xorg X Window system uses a setting called the Virtual Resolution to determine the maximum size of your desktop. If you’re extending your desktop onto two monitors, the virtual resolution determines the maximum resolution of your monitors combined. I think you can also make your virtual resolution larger than all the screens combined and pan & scan around – I know you used to be able to do this back in the olde X11 days.

This is managed by resetting the virtual resolution when you add a monitor, expanding it to the maximum combined resolution of your monitors. So if, as in my case at home, you have an internal screen of 1280x800 an an external screen of 1440x900, and place them side-by-side, it will set the virtual resolution to 2720x900.

Unfortunately after resetting the virtual resolution, you have to log out and back in – the X Window system annoyingly still hasn’t managed to get all settings changeable on the fly, and logout/login restarts the X server. Sigh.

The fun comes if you’ve done all this hokey pokey at home, but then take your laptop in to work and, without running it with just the internal screen, plug in a different external monitor – say, one with a resolution of 1280x1024 – and wake the laptop up. When I did this today and tried to add the external monitor the display properties didn’t seem to be working. My external screen was limited to a resolution of 1152x864, no matter what I tried. I swapped monitors, I looked for logs – it remained a mystery.

So I thought for a bit about what seemed to be happening, and I realized what was going on. For some reason (BUG!) the display properties just limited the maximum resolution on the external screen to the virtual resolution it already had, instead of resetting the virtual resolution to fit the preferred size. I was limited to 1152x864, which fit inside the 900px height limit in the 2720x900 virtual resolution set when using my home external monitor.

I opened up /etc/X11/xorg.conf in a text editor and changed the virtual resolution setting to 2560x1024, which fit both the internal screen and the work external screen. After logging out and back in, the external monitor was then usable at 1280x1024. For some reason at that point my virtual resolution was reset again, to 2560x1036 – not sure why, maybe I wasn’t careful enough when aligning the monitors side-by-side in the display properties and the smaller one was hanging off below the larger.

In any case, negotiating this kind of issue isn’t something a normal non-technical Windows user is likely to figure out, and it supports Mike’s premise that Ubuntu isn’t ready for prime time. Hopefully the way this is handled can be refactored and simplified, and the bug with resetting the virtual resolution fixed.

In the mean time, I’ll probably just use my work laptop with my work external monitor, and my home laptops with my home external monitor.

Tags: ,