VMware Communities
DmitryBond
Enthusiast
Enthusiast

Is it possible to simulate different "current time" on VM?

Hi.

For automatic testing of some complex sub-system I need to somehow simulate certain "current date & time" on VM. Is it possible?

In particular I'm trying to create automatic test scenarios for our transportation system which is tightly bound to current time + some calendar master data.

So, the problem is - when running test scenario at 12:00 it is giving one results, when running the same test scenario at 14:00 it is giving different results.

And every next time it is giving different results until next day. And even next day at 12:00 it may give different results because of day of week. For example, when it is 12:00 Friday then this is day before weekend and Calendar MD defines it as a "plant offline" time interval, so it will give different results also...


That is why I'm searching for options - how could I design my test scenario for it?

I think it would be the best if I could set current date and time for VM to certain fixed value, for example = 2015-04-20,12:00 and then run my test scenario.

The question is - is it possible to set current date and time for VM to certain fixed value and to keep VM working correct with specified date & time for some reasonable time (at least 1 hour), so I can complete my test scenario execution?

Because as I can see VM is always sync current time with host PC. Despite any settings in VMX file and despite a time I specified in BIOS for this VM. 😕

Could you please advice on this situation?

Regards,
Dmitry.

PS. It is VmWare Workstation 11.0 on Windows 7 x64 Ultimate.

In VMX file I set "tools.syncTime = "FALSE"" and as I can see Windows 2008 R2 also is not configured to sync time with any sources.

So, I'm a bit puzzled why VmWare still synchronize VM time with host PC?...

0 Kudos
2 Replies
RDPetruska
Leadership
Leadership

Refer to Ulli's page here...  sanbarrow.com

for entries required to start a VM at a specific date/time.

0 Kudos
DmitryBond
Enthusiast
Enthusiast

Thank you for reply.

But seems it does not work for WS 11.x.

I changed VMX file as it is described in the description at the link you specified then I started VM.

In VM BIOS I can see - it was started with date & time value which I specified in VMX. But then, when Windows 2008 R2 started I can see that date & time was synchronized with host PC. 😕

I searched internet for solution but not found any working advices. As I can see Windows Time service on VM is disabled, time sync for VmWareTools also disabled.

Any idea - why it is synchronizing time after all?

Btw, in Windows EventsLog I can see this message from [Kernel-General]:

    The system time has changed to ‎2015‎-‎04‎-‎29T12:34:41.103000000Z from ‎2015‎-‎04‎-‎20T12:03:04.579101500Z.

0 Kudos