Timekeeping best practices for Windows, including NTP
Time Synchronization
Note: w32time is the time synchronization utility that ships with Windows. NTP (the Network Time Protocol daemon) is available for Windows through a variety of third-party ports to Windows.
Configuring w32time
When using w32time, there are a number of configuration parameters that can be changed. The table below describes the relevant parameters and gives a recommended value. All of the parameters are stored in the registry. Some of them can also be modified through the w32tm utility instead of directly editing the registry. This best practices guide covers running w32time in NTP mode. w32time can also use the windows domain hierarchy as time servers, which is not covered in this best practices guide.
Key
|
Details
|
HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\
Services\W32Time\
TimeProviders\NtpClient\
SpecialPollInterval
|
Recommended Value: 900
Type: REG_DWORD
Description: This parameter controls how often w32time will poll the time server to check whether time on the client needs to be corrected. The parameter is specified as number of seconds to wait between polling. The recommended value of 900 specifies that the time server should be polled once every 15 minutes.
|
HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\
Services\W32Time\Parameters\
NtpServer
|
Recommended Value:
Type: REG_SZ
Description: This parameter specifies the time servers to use. It is specified as a string of space separated servers. Specifying ",0x1" after the server name indicates that the server should be contacted at the frequency specified by the SpecialPollInterval setting. Note: Modify the recommended value to point to the ntp servers available in your environment.
w32tm Command:
w32tm /config "/manualpeerlist:
|
HKEY_LOCAL_MACHINE\
SYSTEM\CurrentControlSet\
Services\W32Time\Parameters\
Type
|
Recommended Value: NTP
Type: REG_SZ
Description: This parameter specifies the mode that w32time should use. A value of NT5DS indicates that w32time should use the Windows domain hierarchy as its time servers rather than the NTP servers specified in the NtpServer key.
w32tm Command:
w32tm /config /syncfromflags:
MANUAL
|
VMware Tools Time Synchronization and Configuration
When using w32time or NTP in the guest, disable VMware Tools periodic time synchronization.
To disable VMware Tools periodic time sync, use one of these options:
- Set
tools.syncTime = "0"
in the configuration file ( .vmx file) of the virtual machine.
or
- Deselect Time synchronization between the virtual machine and the host operating system in the VMware Tools toolbox GUI of the guest operating system.
or
- Run the
VMwareService.exe -cmd "vmx.set_option synctime 1 0"
command in the guest operating system.VMwareService.exe
is typically installed inC:\Program Files\VMware\VMware Tools
.
or
- Run the
vmtoolsd.exe timesync {enable|disable}
command from the guest operating system and located atC:\Program Files\VMware\VMware Tools\vmtoolsd
.
These options do not disable one-time synchronizations done by VMware Tools for events such as tools startup, taking a snapshot, resuming from a snapshot, resuming from suspend, or vMotion. These events synchronize time in the guest operating system with time in the host operating system even if VMware Tools periodic time sync is disabled, so it is important to ensure that the host operating system's time is correct.
Disabling Time Synchronization
The time synchronization checkbox controls only whether time is periodically resynchronized while the virtual machine is running. Even if this box is unselected, by default VMware Tools synchronizes the virtual machine's time after a few specific events that are likely to leave the time incorrect.
Note: Unlike the normal periodic time sync, which can move the guest clock only forward, these special time syncs can move the guest clock either forward or backward. If you want your guests to never sync backward in time, disable the options (by selecting "False"
for each option).
- Select the virtual machine in the vSphere Web Client inventory and power it off.
- Right click the virtual machine and choose Edit Settings...
- Click the VM Options tab.
- Expand the Advanced option.
- Under Configuration Parameters click Edit Configuration.
- Click Add Row and add this information:
Name Value tools.syncTime
False time.synchronize.continue
False time.synchronize.restore
False time.synchronize.resume.disk
False time.synchronize.shrink
False time.synchronize.tools.startup
False time.synchronize.tools.enable
False time.synchronize.resume.host
False
No Comments