- Virtual PC 2004, SP1
Virtual PC 2004 ritually insists upon creating the a “My Virtual Machines” directory beneath your user profiles My Documents root, even if you have previously deleted this folder and frequently set the ‘working’ path to another location while in the file browser.
If you wish to store your VMC and VHD data elsewhere on your system or network, you must manually specify the full path to the Virtual PC Console each time you make configuration changes, as well as delete a new instance of My Virtual Machines.
This seems like a simple, yet typically Microsoft omission from the program – utterly defeating the idea of it being “My” Documents in favour of whatever Microsoft, Adobe, BVRP etc want to make it.
Most applications store working path information in the registry’s Current User settings, Virtual PC has, however been hard coded with its user profile paths, making non of the traditional registry keys beneath the Current User Software hive.
There is, however a way around this limitation, as presented cryptically in the readme.htm; which states:
What this is saying, in case you’re don’t happen to have a MCSE, is that as a counter measure, Virtual PC will screen for the presence of a Shell Wide configuration pointer (Environment Variable) defined as MYVIRTUALMACHINES.
Ever seen, for example, “%SYSTEMROOT%” or “%TEMP%” pop up before in Windows? They are environment variables specifying where the Windows folder (Q:\Windows\) and global Temp folder (N:\Eccentric\Folder\Naming\Temp\) are.
The Environment Variables are considered constants, and not likely to change – if indeed they will ever change. Administrative privileges are required to set or unset an environment variable, lacking the susceptibility of the registry. As they are global, they will already be considered active no matter who is logged into the system (unlike with Current User Registry settings) and unlike with Local Machine Registry settings, are globally available to anything looking for %MYVIRTUALMACHINES%. Saving the system or VPC drivers from specifying access to reams of registry hive to get to the desired few bytes of information.
There are two ways to set an environment variable.
Using the GUI:
- Pull up the Control Panel
- Run the System Applet
- Open the Advanced Tab
- Choose Environment Variables…
- Under System Variables click New…
- In the Variable Name enter:
- Under Variable Value enter the Full System Path to your new MVM root e.g.
Exit and restart Virtual PC for the change to become active under Virtual PC.
Using the Registry:
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
- Create a new String value named:
- Set the value to equal the Full System Path to your new MVM root e.g.
If you set the variable by hand in this fashion, you may need to log off before the change is recognised by the system.
Once you have added the system environment variable, Virtual PC will stop creating the My Virtual Machines folder beneath My Documents, and will default file system browser windows to the new MYVIRTUALMACHINES path.