What's the correct way to set the time on ESXI hosts?

I tried doing it through cli with the following command:

esxcli system time set -d 3 -M 11 -y 2021 -H 14 -m 10 -s 0

But after restarting a guest OS (Windows), the time on it resets to the wrong one again (1 hour late in this case).


Solution 1:

The proper way is to continuously synchronize your host with an SNTP server.

You should always have an exact time on your host to ensure that any guest that is 'stunned' (pause, snapshot, ...) is resynchronized correctly. If the host's time is off, it'll push that time to any stunned guests (regardless of the synchronize guest time with host setting!), potentially causing time to jump. You surely don't want that.

In vSphere Client, go to Host -> Manage -> System -> Time & Date -> Edit SNTP settings. Set NTP service startup policy to Start and stop with host and enter a trusted SNTP server. In Services start the ntpd service.

For the guest itself you can choose whether you generally want to synchronize with the host or (better) with your trusted SNTP server directly. Most often, Windows clients and servers are synced through AD - either a domain controller or a dedicated SNTP 'master'.