Windows Virtual PC and Screen Resizing

For as long as I can remember – Virtual PC has allowed you to resize the virtual machine window and have the guest operating system change its screen resolution automatically.  The way this is done is that once you finish resizing the virtual machine window, we send a message into an integration service inside the virtual machine that in turn requests a desktop resolution change, just like a user changing the desktop resolution manually.

This works because of the excellent support in Windows for changing screen resolutions on the fly*.

Unfortunately, Remote Desktop (which is used by Windows Virtual PC) does not support changing screen resolutions on the fly.  In order to maintain the same level of functionality in Windows Virtual PC as with earlier versions of Virtual PC a new approach had do be tried.

If you do not have integrated mode enabled we continue to change the guest operating system desktop resolution like we always have.  If you do have integrated mode enabled we will instead break the Remote Desktop connection and create a new one at the new window resolution.

The can be a bit disconcerting – as it is not uncommon to see a momentary login screen while the new connection is created.  But you can rest assured that there is no potential for data loss / application disruption.  An easy way to think of this is to imagine what happens if you are using Remote Desktop to connect to a physical computer and the network gets disconnected – forcing you to reconnect to the remote computer.  When this happens everything will be just as you left it – because Windows maintains your login session even though you are not connected.  The same thing happens with Windows Virtual PC.

The important thing here is that even though different methods are used, whether you have integrated mode enabled or not you can always easily resize the virtual machine window and have the guest operating system adapt to your new window size.

* A little side story here.  When I started working at Connectix as a tester on Virtual PC I remember seeing a number of interesting bugs with virtual machine screen resizing which were a result of the fact that support for changing screen resolutions without reboot was not very reliable in Windows 95.  Thankfully all of these issues were sorted out by Windows 98 and this has been rock solid for every Windows release since then.