Virtual Machines

One of my must have tools when developing software is VMWare. This great product lets you run a PC within another PC. It gives you an emulated PC on which you can do almost anything that you can do on a normal PC. You can boot it, install software on it, configure it to have network access, and when you have finished, you can shut it down.

However there are a few advantages that it has over a real PC. With a real PC, if you botch a software install, it is often a case of starting again by re-installing the operating system. However with a virtual PC, there are other options. When you shutdown a virtual PC, VMWare gives you the option of committing or discarding changes that have happened since you booted the virtual PC. So if you botched a software install and want to revert the system to the state that it was at before you started the install, just discard the changes.

Another advantage is that the virtual PC is persisted as a normal operating system file. This means that you can do normal file operations on it. Actions such as zipping it up, burning it to CD, moving it to a faster host machine or even sending it by email - only kidding - these persisted files can be hundreds of megabytes even when zipped.

Okay, so let me list the ways that I have used this animal over the last couple of years.

The first use was when we had to develop for and configure a Websphere Application Server to talk to an Apache Web Server. Because we needed separate servers to evaluate the configuration options and because there was a shortage of hardware, we used one PC running two instances of VMWare - one for the Apache Web Server and the other for the Websphere Application Server. With enough RAM, the performance was adequate.

The project also required us to support a variety of Browser and Operating system combinations. Rather than have a battery of PC's lined up taking up desk space, we opted to use VMWare. We configured a clean VM for each required operating system browser combination. When we needed to test a particular combination, all we had to do was boot a particular VM. Once testing was done, we could shutdown the VM, discarding any changes. We could always start with a known clean configuration.

More recently, I was investigating Active Directory. Rather than interfering with the existing site configuration or stuff around trying to set up a separate physical LAN and PCs, I used VMWare. By creating two VMWare instances, one with Windows 2003 Server, the other with Windows XP and setting them up so that they were on the same private host only network, did the trick.

One place that it shines is with training. We had to do a half day course on the Microsoft Sharepoint Portal Server. Rather than going through the hassle of trying to get the software installed and configured beforehand on our PCs, the instructor waltzed in on the day, pulled out a couple of DVDs with preconfigured VMWare saved files and we were ready to go. The added benefit was that we did not have to worry about installing and removing the software from our PCs.

On Mac OS X, Virtual PC provides a similar facility. The main purpose here seems to be to provide access to Windows only applications. I have used it, but don't find it as snappy as VMWare. Possibly because I was running it on a iMac 800 with 768MB.

Microsoft also provides a version of Virtual PC for Windows, which I haven't tried yet.