Virtualisation for Beginners
It's not just for server jockeys, you know
Today, products like VirtualBox, Parallels Desktop and VMWare will make use of these hardware features if they're available, but still perform well on processors without them.
Parallels, for example, uses these new Intel and AMD hardware virtualisation extensions because they are almost always available on modern hardware, especially on the Mac. But Parallels can also deliver full functionality without Pacifica or Vanderpool by running in 'software mode', using techniques similar to VMWare's segment faulting
A VM is a useful testing ground for a new operating system -- in this case Google's ChromeOS under VMWare
It's tempting to think that on a multicore processor, virtualisation might allocate different cores to each of the running operating systems, but this isn't how it works. Cores are shared in much the same way as in a uniprocessor system, although the virtualiser will typically allow the user to set up 'core affinity', which associates a particular virtual machine with one or more specific cores.
But What Can I Do With It?
The most obvious use for virtualisation is running legacy apps which are perhaps no longer supported on current versions of the operating system. A tried and trusted old DOS accounting system, for example, might be carried over to Linux inside a VirtualBox virtual machine running a readily available open source version of DOS like FreeDOS.
A valuable side effect is that the application will be running in an environment isolated from other applications on the same machine, and so will probably behave more reliably than in its original habitat. And whereas in the past a failure of the application and/or the DOS environment might entail a complete reinstallation of one or both of these, now DOS and the app it's hosting can simply be reinstated as a whole, should the need arise, by restoring a snapshot of the virtual machine.
When you 'revert to snapshot' like this you'll discover immediately - or preferably have had the nous to realise well in advance - that any data used or created in connection with the application should be stored outside the virtual machine. It's usually easy enough to set up the virtual machine so that drive D: (for instance) is actually mapped to a data directory owned by the host operating system, or off on a network drive somewhere. This ensures that your set of up-to-date data hasn't been discarded with the now overwritten old version of the virtual machine.
Virtual machines can grow very large. Typically, on creation, the machine will be allocated some maximum disk space, say 50GB, but will initially occupy only a tiny proportion of that within the host operating system's file space. As new files are added the space occupied grows dynamically, but this space isn't released when files are deleted within the guest - one more reason for ensuring data is stored outside your virtual machine.
Parallels offers a utility, Parallels Compressor, that can be applied to an offline virtual machine to seek out deleted space and remove it, shrinking down the virtual machine. Unfortunately, this valuable facility is close to useless in practice, because the utility refuses to function with virtual machines that have been snapshotted, and snapshotting is pretty well a fundamental requirement.
The problem is that snapshots store more than just the files within the VM - they also store the state of the processor and the entire contents of memory. "And the file system is not in a synchronised state," says Stas Protassov, Senior Vice President of Virtualisation and Storage at Parallels, "and you could corrupt the file system."
An update sometime next year is expected to fix this problem and make snapshots and the compressor compatible. Once this is in place Parallels foresees offering the option to run the compressor permanently in the background.