Slowing down virtual machines

A common request that I hear is that people want a way to create a 'slow' virtual machine.  Usually this is because they have an old game or application that has problems when run on modern, fast computers.

The problem is that Virtual PC and Virtual Server virtualize the processor.  This means that when the virtual machine is using CPU resource it is actually running directly on the physical processor (most of the time).  Because of this there is no way for us to purposefully slow down the speed of the CPU inside a virtual machine.

Programs that emulate a processor (where they have software the provides the same functionality as a physical processor, without actually needing direct access to the processor) can control the speed of the emulated process (DOSBox and Bochs are two such programs), however emulation is much slower than virtualization - so they cannot run as fast as Virtual PC / Virtual Server can.

Virtual Server provides the ability to limit the amount of CPU resource used by a given virtual machine, but this is not effective for slowing down the virtual machine.  As I mentioned already - we run the virtual machine directly on the processor - so it is not possible for us to change the processor speed.  So setting a virtual machine with a maximum of 10% CPU resource under Virtual Server (for example) means that it will only be allowed to run on the CPU for 10% of the total system scheduling time over a period of time.  While the virtual machine is running, it is still running at full processor speed (albeit less oftenly than it would otherwise run).

So what are your options?  Well - maybe an emulation solution is better for your needs.  Or, maybe you need to invest in some older hardware.  Or - you could pursue the use of 'slow down' software inside of the virtual machine.  Some programs that I have used with varying levels of success include:

One final comment on this topic - some people have noticed that some older DOS programs that are known to crash on fast hardware actually run perfectly inside of Virtual PC / Virtual Server.  The reason for this is that a long time ago in Virtual PC development, we put in some code to detect the problematic routines in some common DOS libraries (checkout this for an example reference) and to patch these binaries 'on the fly' so that they would run correctly inside of the virtual machine.

Cheers,
Ben