Testing with Virtual Server 2005
Sometimes you don't know how cool a product is until you use it yourself. I'd always heard folks talking about how great virtual machine technology is but never really had occasion to use it until recently.
VS Whidbey doesn't support running on Win9x operating systems but they do support creating applications that run on some of those OS's. In order to test that, we used to have to use 2 separate machines, one set up with an OS that was supported for running VS Whidbey on (the host OS) and one set up with an OS that was supported for the running applications built with VS Whidbey (the target OS).
A few months ago, I had the bright idea of using Virtual PC to do these kind of test runs on a single machine. I set things up manually and was able to do a test run this way but, since there was a lot of manual work to set things up, it wasn't really feasible to use for our automated runs in the test lab. I investigated whether it was possible to script Virtual PC in order to do the setup we needed for our automated runs but that kind of functionality just wasn't available in the Virtual PC product.
Enter Virtual Server 2005. Virtual Server uses the same technology as Virtual PC but it has a COM API for controlling all aspects of the virtual machine technology. On Friday, I was able to do a pilot run of one of our test suites hosted on WinXP and targeting Windows 98 using Virtual Server. There's a few things I'm not completely happy about (such as the fact that Win9x is not officially supported as a guest OS using Virtual Server 2005. It seems to work fine, though) but I'm able to, as Larry the Cable Guy says, "Git 'er done."
The basic outline of what I'm doing is:
- Install VS Whidbey on the host OS.
- Install Virtual Server on the host OS and create a virtual machine with Win9x OS installed (I use a pre-built virtual hard drive image with the OS already installed on it).
- Create a virtual network using the Microsoft loopback adapter on the host OS and share a directory on on the guest OS to the host OS using that network. Using the Microsoft loopback adapter allows me to set up the virtual network with no connectivity to the corporate network which is necessary since our system administrators consider Win9x machines on the corpnet a security risk and would disconnect me from the network if they detected it.
- Set up the test run to do the building of the test applications on the host OS and the running of those applications on the target OS (we have an application that our test team built to do that).
Thanks to Virtual Server it looks like we'll be able to do this kind of testing more efficiently using less lab machines for these runs. Pretty cool.