« Google Stories | Main | Other Nice Spots on the Microsoft Campus »

January 01, 2005

Virtual PC - App Compat Story of the Future?

We bought the kids a new computer which came with Windows XP, and some of their games refused to run. Not surprising, these games are 5+ years old and designed to run on Windows 95/98, and with the switch to the NT-based operating systems, despite Microsoft's best application-compatibility efforts, they have problems running. Many times these are due to bugs in the application (such as depending on memory being initialized a certain way) that happened to not fail on the old platforms. People like Raymond Chen spent a lot of time working on app compat, in some cases actually detecting specific applications and having the operating system "misbehave" in the way they expected.

So Microsoft has tried hard to fix these problems, but a lot of it comes down to which of the thousands and thousands of applications we tested and how much we care about fixing them. Evidently Lego Chess didn't make it, because it crashes consistently on XP when it plays animations. I'm not knocking Microsoft for this; the "fix" for this problem would have happened 10-15 years ago and would have involved better development tools and a tougher Windows logo compatibility program, which would have led to fewer and more expensive apps, and therefore more expensive hardware...in other words it would be like the Macintosh.

Nonetheless I was stuck with a nonworking Lego Chess and some unhappy kids as a result. So I installed Virtual PC. Virtual PC takes a different tack; rather then emulate the Windows API, it emulates an entire computer. To run a game under Virtual PC, you first have to install an OS on the virtual machine, then install the game, then run it.

I went to the company store and plunked down $20 for Virtual PC. Then I needed to find an old Windows OS to install. We had kept all the manuals and stuff from various old computers, so I knew I had a Windows 98 CD somewhere. Eventually I found it, installed it, installed Lego Chess...and it failed. Oops! A quick search of the Microsoft org chart revealed that the former test manager on one of my products was now the test manager for Virtual PC. He redirected me to Ben Armstrong (aka Virtual PC Guy) who told me to go to the Virtual PC website and install Virtual PC SP1, and then enable this workaround for a video bug, and lo and behold Lego Chess now works in all its glory. Actually I also had to turn off the Direct 3D mode in Lego Chess, but that didn't seem to affect the performance.

(Then I tried to install Windows Me in a separate virtual machine. Microsoft had made it a bit harder in the time between Windows 98 and Me...for one thing the product ID was on a sticker attached to the computer, not with the manuals, but luckily the old computer was still in our garage. Worse, the Windows Me CD that I had was marked "for reinstallation on a Dell PC only". The kids' new computer is a Dell, but evidently it really meant reinstallation on the original Dell it came with -- it must check for some known bits in the hard disk boot sector or something -- because it aborted partway through setup. So now I have to find a Windows Me disk, which seem to be selling for upwards of $50 on eBay. It's annoying because these used to be a dime a dozen at the company store (or perhaps $240 a dozen) but now I don't know how to get a cheap copy, unless someone at Microsoft has one lying around.)

Anyway, this got me thinking that Virtual PC could really become the application compatibility story for Microsoft in the future. You do lose a bit by running apps under Virtual PC; the virtual machine has its own virtual hard drive (although there is a way to access the computer's real drive), and I'm not sure how well things like cut-and-paste work between virtual machines. But when you are running a standalone app (like a game) none of that matters (and if your alternative is the app not working at all, who cares about cut-and-paste).

Currently, of course, you have to own a CD of the old OS you want to run, and also run it through setup. But Microsoft could fix that. Each copy of Virtual PC could include a license and CD image for old versions of Windows -- but only licensed to run under Virtual PC on one machine. I think the images could be "preinstalled", because the virtual machine that Virtual PC presents is a standard system (for example Windows 98 reports that the display adapter is from S3, and the sound card is a Soundblaster, even though our actual machine has different hardware).

And in fact you could snapshot the memory state of the virtual machine after the OS booted, so you wouldn't even have to wait for that. Sure a memory snapshot would take 128 megabytes or whatever of disk space, but so what? Disk space is dirt cheap. A CD image, 1 gig virtual hard drive, and 128 meg booted memory snapshot for Windows 95, Windows 98, AND Windows Me would take up less than 6 gigabytes -- today Dell isn't selling a computer with less than a 40 gig drive, and is offering free upgrades to 160 gig on its higher-end systems.

Right now on XP you can choose to run an app in "compatibility" mode with old Windows versions. But instead Windows could come with Virtual PC included, with these preinstalled images of old Windows, snapshotted in booted state, and when you went to run an app you could choose "run under virtual machine of this old version of Windows" and it would BOOM load up the memory snapshot and load the app inside it, and there you would be.

Posted by AdamBa at January 1, 2005 07:04 PM

Trackback Pings

TrackBack URL for this entry:


The one problem with this that I see is that when you are running Virtual PC, you are theoretically open to some exploit hitting you on the virtual box.

I've seen Virtual PC machines running Win98SE get hit with a worm and I believe even had the IT department shut down the port for network because of it. :-)

Posted by: Al Billings at January 2, 2005 02:23 PM

True...I set up my virtual machines with no network card, which is fine for most games. VPC could also add an automatic NAT/firewall between the virtual network card and the real one.

- adam

Posted by: Adam Barr at January 2, 2005 08:31 PM

I hate you, I want to work at Microsoft too!

Posted by: Alexandru Pojoga at January 4, 2005 09:47 AM

I really like the idea of "Run application in virtual machine". Actually I started to think of that in the middle of the text, and was happy to see it written in the end :).

In [1] they use VMs to get device driver compatibility.

[1] http://l4ka.org/publications/paper.php?docid=1208 [Unmodified Device Driver Reuse and Improved System Dependability via Virtual Machines by Joshua LeVasseur, Volkmar Uhlig, Jan Stoess, and Stefan Götz]

Posted by: Andreas Häber at January 7, 2005 07:03 PM

I love your article and I installed your hack. Thank you very much for this. I did notice that you have if statements and only if statements. The hack whould not install properly in my header until I added a if statement. Then, all was very cool. I am installing this on every messageboard I control which is a sizable number. Again, thank you.

Posted by: samual at February 8, 2005 10:03 PM