Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to start always with same system time (VPC 2007 SP1)

16 views
Skip to first unread message

Christian Zimmermann

unread,
Jan 26, 2012, 9:40:22 AM1/26/12
to
Hello.

I'm developing software and I want to test it in a virtual system with a
special system time. So, every time I start the virtual system I want it
to start with a certain given system time.

I already know how to disable host time synchronisation. Of course this
precondition is done. But how can I automatically set a certain system
time as start time for the virtual machine? Is there a special XML tag
to set in the .vmc file I don't know?

I don't want to do that manually in the vm's bios every time I start it.

Greets,

Christian

MikeD

unread,
Jan 26, 2012, 12:02:43 PM1/26/12
to

"MikeD" <nob...@nowhere.edu> wrote in message
news:jfs0do$e7f$1...@dont-email.me...
>
> "Christian Zimmermann" <ch....@web.de> wrote in message
> news:jfrokr$rq6$1...@news.albasani.net...
> There's no way that I know of to do this. But since you're a developer,
> why don't you just write a little utility to set the system time to
> whatever you want it to be and run that utility at startup (either from
> the Registry or from Start Menu's Startup group)?
>
> Mike
>
>

Actually, you don't even need to write such a utility. Just create a batch
file to run the Date command line.


MikeD

unread,
Jan 26, 2012, 11:53:05 AM1/26/12
to

"Christian Zimmermann" <ch....@web.de> wrote in message
news:jfrokr$rq6$1...@news.albasani.net...

Christian Zimmermann

unread,
Jan 27, 2012, 5:39:51 AM1/27/12
to
Yes, thank you. I already thought about such a solution. But it's very
(too) late in the booting process, because I cannot assure that such a
script or a program is started before any service. If there is no tag
for that then it would be necessary to manipulate directly the .vhd file
where the vm system time and date is stored. But where and how?

Thanks for your help.

Christian

MikeD

unread,
Jan 27, 2012, 6:35:45 AM1/27/12
to


"Christian Zimmermann" <ch....@web.de> wrote in message
news:jftutp$su3$1...@news.albasani.net...
> Yes, thank you. I already thought about such a solution. But it's very
> (too) late in the booting process, because I cannot assure that such a
> script or a program is started before any service. If there is no tag for
> that then it would be necessary to manipulate directly the .vhd file where
> the vm system time and date is stored. But where and how?
>

I'm assuming you only need to do this for debugging/testing purposes
(because otherwise it'd be a very bad thing to be changing the system
date/time). So, can you just hard-code a substitute for the system date for
that purpose only?

The other thing you can do, which I just verified, is change the date and
time of your host OS. It appears the guest OS simply uses that date and
time. I changed the host OS's date to 01/01/2012 and then started a WinXP VM
and sure enough, it also had a date of 01/01/2012. Furthermore, I then reset
the host OS date to the correct date and the guest OS automatically reset
its date to match. Granted, that means you still need to manually change the
system date of the host, but from what I can see, that may be your only
option.

Mike


Christian Zimmermann

unread,
Jan 27, 2012, 10:26:53 AM1/27/12
to
Am 27.01.2012 12:35, schrieb MikeD:
>
>
> "Christian Zimmermann" <ch....@web.de> wrote in message
> news:jftutp$su3$1...@news.albasani.net...
>> Yes, thank you. I already thought about such a solution. But it's very
>> (too) late in the booting process, because I cannot assure that such a
>> script or a program is started before any service. If there is no tag
>> for that then it would be necessary to manipulate directly the .vhd
>> file where the vm system time and date is stored. But where and how?
>>
>
> I'm assuming you only need to do this for debugging/testing purposes
> (because otherwise it'd be a very bad thing to be changing the system
> date/time). So, can you just hard-code a substitute for the system date
> for that purpose only?

Not really, because the system time is retreived at some positions in
the software. The effort to change this is to high for this purpose and
to riskful not to forget one query (additionally to change it back). A
central function to call which retrieves the system date and time would
not be surely considered by every developer.

> The other thing you can do, which I just verified, is change the date
> and time of your host OS. It appears the guest OS simply uses that date
> and time. I changed the host OS's date to 01/01/2012 and then started a
> WinXP VM and sure enough, it also had a date of 01/01/2012. Furthermore,
> I then reset the host OS date to the correct date and the guest OS
> automatically reset its date to match. Granted, that means you still
> need to manually change the system date of the host, but from what I can
> see, that may be your only option.

Uurgh ;-)

Christian
0 new messages