Thursday, 14 May 2009

How do you stop a Virtual PC from synchronising its date time with the host PC?

Ever wondered how you can stop a virtual PC image synchronising its date and time with the host machine? Sometimes when testing it’s handy to be able to test in an identical environment each time – so if the date has moved on a few days tests that once passed no longer work or at least behave differently.

There is a way though!

Find your most beloved XML editor, or even notepad will do (just be extra careful when editing in notepad you don’t make any errors) I used XMLNotepad.

You can get XML notepad from here:
http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en

Open up your Virtual PC definition file – the .vmc file.

Scroll down and find <integration><microsoft><components>
Now you may or may not have this, but this is the key – under the <components>node you need to have – you may have had this element but it will likely be set to true.

<host_time_sync>
<enabled type="”boolean”">false</enabled>
</host_time_sync>

Save the vmc and reboot and you should be away! If you alter the virtual machine date/time and then commit the changes you should find once you reboot that the date and time have not altered since the commit changes.


Beware! I did read on here http://mcpmag.com/columns/article.asp?editorialsid=1649 that if you were to reboot the virtual PC without commiting the machine changes it will in fact resync the date/time again. So just in case!

No comments:

Post a Comment