Thursday, June 18, 2009

Running VPCs with different date/time

I have plenty of VPC images that were built on trial version for testing and demo purpose. So when these images lives longer than it’s trial period, you’ll need to trick it by changing the host machine’s time. That’s no good since it’ll affect your applications on the host machine.


There’s a quick method to either disable the time synchronization between the VPC and the host machine, or  hardcode a specific date/time for the VPC. Both can be done via modification on the vmc file.

1. Disable the time synchronization:


Under the following mouse configuration:
<allow type="boolean">true</allow>

Add this:
<enabled type="boolean">false</enabled>

2. Set the desired date/time:

You have to find the time_bytes value inside the .vmc file, which looks like this one:

<time_bytes type="bytes">27003200110001201008</time_bytes>

After finding it, set the desired date/time value according to the following specification:
Digits 1 - 2 contain the seconds value.
Digits 5 - 6 contain the minutes value.
Digits 9 - 10 contain the hours value.
Digits 15 - 16 contain the day value.
Digits 17 - 18 contain the month value.
Digits 19 - 20 contain the year value.

In the above example, the date/time value is 11:32:27, 20/10/2008

After making the above 2 changes, save the .vmc file, and the guest operating system will start in the same date/time that you set in the time_bytes value.



No comments: