We've been using an EC2 micro instance for a little remote monitoring for the past few weeks, and it's bothered me badly how the system time is never accurate; no matter how much fighting I did with Windows time syncing, it was never working properly. Didn't find an answer on serverfault that explained how to fix it, but found a good one finally on Amazon's forums, and wanted to share it here for anyone else looking.

Scenario: Windows 2003 Server on EC2 Micro

Situation: Time always wants to sync to UTC, no matter what is configured in Windows.


I figured I'd add an update about our experience with this - we have found that using a third-party app to update the time makes the problem worse. The app works great but we find that the time changes every hour and then the app has to correct it. If we configure Windows time sync to use NTP then the time stays correct and the third-party software is not necessary.

Here is what we do to configure Windows time sync:

First ensure that you can get time from a NTP server, otherwise the instructions below are not going to work. To test, get the current variance from an NTP server using the following Windows Time service command w32tm /stripchart /samples:5 /computer:pool.ntp.org /dataonly

In a VPC we had to open UDP port 123 for inbound connections in the NAT security group.

To configure NTP time sync in Windows

  1. Registry edit - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpClient Set SpecialPollInterval to polling interval in seconds (we set ours to 60).
  2. Registry edit - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\W32Time\Parameters Set Type to NTP
  3. Run the following commands to configure the time servers (can use other servers, we're using 4 time servers - 0.pool.ntp.org, time.nist.gov, 1.pool.ntp.org, and 2.pool.ntp.org) net stop w32time w32tm /config /syncfromflags:manual /manualpeerlist:"0.pool.ntp.org,0x1 time.nist.gov,0x1 1.pool.ntp.org,0x1 2.pool.ntp.org,0x1" net start w32time

To review the config w32tm /query /configuration

To check the sync against a time server w32tm /stripchart /samples:5 /computer:pool.ntp.org /dataonly

Source: Time on my EC2 windows instance changed automatically

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.