Friday, May 22, 2009

Vista Multiple Monitors Bug with Terminal Services

If you're running multiple monitors on a Vista machine, and then login to that machine remotely, your remote view will only show the contents of the primary monitor (resized appropriately).

This isn't such a big deal, but if you do this regularly you'll certainly have run across a bug in which the secondary monitor will be reset to its lowest resolution when you log on to the dual monitor Vista machine locally. I think I've blogged about this problem before, but now I have a fix:

When the secondary monitor is stuck at its lowest resolution, do the following:

1) Right click on the desktop and choose Personalize.

2) Click on Display Settings.

3) Adjust the secondary monitor to maximum resolution and click apply.

4) Curse loudly because the monitor resets again to low resolution.

5) Adjust the secondary monitor to maximum resolution and click apply.

6) Goddammit.

7) Disable the secondary monitor and click apply.

8) Adjust the secondary monitor to maximum resolution and enable it.

9) Whatthehellisgoingon?

10) Adjust the secondary monitor to some value between its lowest resolution and maximum and click apply.

11) Eh? For some reason this resolution will stick.

12) Adjust the secondary monitor to its maximum resolution and click apply.

13) Goldarnitall! It'll be back to its lowest resolution.

14) Adjust the secondary monitor to its maximum resolution and click apply.

15) Repeat step 14 until the secondary monitor finally adjusts to maximum resolution.

16) Write blog post.

As you can see, this is a relatively simply procedure. I decompiled the Vista code for setting display resolution, and think I've found the bug (I prettied it up a bit for readability):

if ((userLastLoggedInFrom() == TERMINAL_SERVICES) {
if ((attemptsToChangeResolution() < 35)
&& (rand(100) == 42)) {
setDisplayResultion(requestedValue);
} else {
setDisplayResolution(
(requestedValue < MAXIMUM_RESOLUTION)
? requestedValue : LOWEST_RESOLUTION);
}
}
As you can see, the magic value "35" should probably be something more reasonable, like "23". Perhaps there is a registry hack.

Oh well, this isn't quite as bad as keeping dual monitors working correctly on Ubuntu, for which the only proven solution consists of copying random xorg.conf files from Google searches until you find one that works.

1 comment:

Anonymous said...

You should try Ubuntu again... Have no idea what you're talking about (problems with multiple monitors?) I use it all day long... no problems here...