VMware Cloud Community
Kr_
Contributor
Contributor

VM time is about an hour short despite being configured to use host's time

Greetings!

I'm not sure why this is so but the time in my windows vm is always behind an hour or so (I checked time zone already) and I have the vm configured to update its time based on the host's time (which I know is correct as ntp is set up correctly).

How can I fix this?

Thanks.

Reply
0 Kudos
18 Replies
PCTechStream
Hot Shot
Hot Shot

Can you please explain what kind of environment do you have: Any!

Virtual or physical vCenter

Horizon View Connection\Security Servers

Virtual or physical (AD DC)

How many VMs

Raul.

VMware VDI Administrator.

http://ITCloudStream.com/

Stay Connected: Like > Share > Comment > Reply > Helpful > Answered

www.ITSA.Cloud
Reply
0 Kudos
bluefirestorm
Champion
Champion

What is the Windows version in your VM?

Is the VM timezone where Daylight Savings Time is observed? If yes, is the "Automatically adjust clock for daylights saving time" checked or unchecked?

Reply
0 Kudos
Kr_
Contributor
Contributor

It's Windows 10 and yes, time zone and adjust for daylight saving time automatically are set correctly.  Right now it's 7:58 am and the vm says it's 5:02 am.

Reply
0 Kudos
Kr_
Contributor
Contributor

Physical vcenter esxi 6.5

no horizon anything

no domain, this a home network

i only have one vm

Reply
0 Kudos
Gotzu
Enthusiast
Enthusiast

make sure NTP server is defined and NTP service is set to start/stop with host from configuration tab of your host

Cheers!
Rajeev
Reply
0 Kudos
PCTechStream
Hot Shot
Hot Shot

1 Check the time in the BIOS virtual/physical is correct?

2 Check Guest time with Host

tt.PNG

Raul.

VMware VDI Administrator.

http://ITCloudStream.com/

Stay Connected: Like > Share > Comment > Reply > Helpful > Answered

www.ITSA.Cloud
Reply
0 Kudos
Kr_
Contributor
Contributor

This was set to manual, I just switched it so it starts/stops w/host.

Reply
0 Kudos
Kr_
Contributor
Contributor

Yep - host has correct time/date and synchronize guest time with host was always ticked.

Reply
0 Kudos
Kr_
Contributor
Contributor

So despite these settings after rebooting the vm, the time is still off.

What a mystery.

Reply
0 Kudos
PCTechStream
Hot Shot
Hot Shot

1 Did you check the time in the BIOS virtual/physical is correct?

www.ITSA.Cloud
Reply
0 Kudos
Kr_
Contributor
Contributor

Yes, bios has correct time. So does the physical esxi host.

The windows vm, however, is stubbornly nastolgic.

Reply
0 Kudos
PCTechStream
Hot Shot
Hot Shot

Try the following: Create three new VMs

1.  Windows 7

2.  Windows 10

3 . Any Windows Server

Without making any changes check the time for each one and let me know what O/S got the correct/wrong time!

Raul.

VMware VDI Administrator.

http://ITCloudStream.com/

Stay Connected: Like > Share > Comment > Reply > Helpful > Answered

www.ITSA.Cloud
Reply
0 Kudos
Kr_
Contributor
Contributor

Welp, I just installed win8 and it has the correct time.

What does this mean?

Reply
0 Kudos
dariusd
VMware Employee
VMware Employee

Does the Windows event log inside the affected guest give any warnings/errors about time synchronization?  If you're using the Windows NTP client, there should be messages from the log describing its attempts to synchronize.

Do you have VMware Tools running inside the VM?  Tools has its own time-synchronization mechanism independent of NTP.  Only use one time sync method at a time -- either VMware Tools time sync or NTP.  I'd recommend reading our guide to Timekeeping In VMware VirtualMachines​, particularly the section on Synchronizing Virtual Machines and Hosts with Real Time.  Page 10 (Virtual CMOS RTC) might also prove interesting.

The VM's .nvram file stores the VM's time offset (how much difference there is between the host's realtime clock and the virtual machine's realtime clock) -- that's what allows us to appear to keep track of time even while the virtual machine is powered off.  In the absence of correctly-functioning time sync in the guest, this would be the most likely explanation for a persistent error of the magnitude you're seeing there.  I suspect that powering the VM off and deleting the .nvram file from the datastore would erase the time delta when the VM is next booted, however it's unlikely to change the fact that time sync clearly isn't working.  (Note: Don't delete the .nvram if your virtual machine is configured to use EFI firmware!  EFI virtual machines store important stuff in the .nvram file.)

Cheers,

--

Darius

Reply
0 Kudos
Kr_
Contributor
Contributor

Ok thanks, I disabled the vm option to sync time with host and use vmware tools instead.

I had a thought - this vm used to be a physical machine until I virtualized that.  That is really the only difference between it and the new windows 8 vm I created.

I'm going to sift through the event logs now but I did not find any relevant ones concerning time when I initially checked.

BTW - the bios mode is EFI.  When I switch it to Bios it does not boot.

Reply
0 Kudos
PCTechStream
Hot Shot
Hot Shot

That means that this VM used to be a physical machine still got some setting attached from the physical hardware. Before you start troubleshooting this issue, it would be a good idea to run the System File Checker. To do so, you have to type sfc /scannow in an elevated CMD "Administrator" and hit Enter. Wait for a while and when the job is completed "Verification 100% complete", restart your Windows computer. Once you have done this, you can move forward to try to troubleshoot the Windows Time synchronization problem. You will use the /register parameter. This parameter, when run for W32tm.exe, registers the time service to run as a service and adds the default configuration to the registry. You better log on as Administrator!!!

A. In an elevated CMD "Administrator":

You may then next also want to register the concerned Windows Time file which is named as W32tm.exe and see if this helps!

net stop w32time

w32tm /unregister

w32tm /register

AFTER REBOOT NO LUCK? THEN...

B. In an elevated CMD "Administrator":

You can also force Windows to sync Time using W32tm.exe.

net stop w32time

w32tm /unregister

w32tm /register

net start w32time

w32tm /resync

If you dont want to do this manually, you may use this Microsoft Fix It to run these commands for you and fix the problem automatically.

LINK: https://support.microsoft.com/en-us/help/2970908/how-to-use-microsoft-easy-fix-solutions

If nothings helps you, then try to repair Windows and see if it helps you.

Press F8 while booting the system to go into Windows Recovery Menu.

Raul.

VMware VDI Administrator.

http://ITCloudStream.com/

Stay Connected: Like > Share > Comment > Reply > Helpful > Answered

www.ITSA.Cloud
Reply
0 Kudos
Gotzu
Enthusiast
Enthusiast

-->Please query your time server

w32tm /query /configuration

-->If it is other than your host then go ahead with below commands one at a time.

net stop w32time

-->make sure to enter Host IP or netbios name in below command within quotes.

w32tm /config /syncfromflags:manual /manualpeerlist:”host IP or netbios name”

w32tm /config /reliable:yes

net start w32time

-->Now again query your time server. If it shows your host you are all set.

w32tm /query /configuration

Cheers!
Rajeev
Reply
0 Kudos
Gotzu
Enthusiast
Enthusiast

use below to command to query time server

w32tm /query /source

Cheers!
Rajeev
Reply
0 Kudos