VHD (Virtual PC) - how to force a Startup regardless of changed VHD

310 Views Asked by At

I am using a virtual machine to automate the execution of integration tests for a server-based product.

I am using "Windows XP Mode and Virtual PC" on a developer machine.

I am doing everything using PowerShell. I wish to:

  1. mount the VHD (diskpart)

  2. copy the release package onto the VHD file system

  3. dismount the VHD (diskpart, again)

  4. Start the VM

It is all fine as long as I don't do 2. If I change the VHD file system at all then 4. fails silently.

If I then go to the Virtual Machines on the Host and start the VM up using the GUI I get a warning:

"Inconsistency in virtual hard disk time stamp detected"
"The virtual hard disk's parent appears to have been modified"

I suspect there is a security feature in here (would make sense). But in my case this feature is not desirable.

Anyone know how to disable the timestamp checking or set the timestamp after I unmount the VHD (before?) ...?

EDIT: Look at the Startup2() options ... method takes one parameter, one of which says:

vmStartupOption_FixParentTimestampMismatch  = 1

... from: Microsoft method details

1

There are 1 best solutions below

0
Aidanapword On

As per my edit - there is a Startup2() method that takes a parameter that says to ignore the timestamp.