Configure time sync for Cloud Virtual Machines

This article will discuss how to configure your Cloud Virtual Machine to sync via NTP. This will also provide you with steps to make sure that if the server is rebooted, the time will remain synced by the node.

Windows

  1. Log into your server through Remote Desktop Connection (learn how to connect to your server through RDC).
  2. Go to Start > Run and type 'cmd' to open a command prompt.
  3. At the command prompt, run the following commands:
    w32tm /config /computer:ntp.hostmysite.net w32tm /resync
  4. To ensure that the virtual machine syncs the time on reboot, run the following command at the command prompt:
    schtasks /create /tn TimeSync /tr "w32tm /resync" /sc onstart

You will be prompted for your username and password for Remote Desktop. Enter that information when prompted. To schedule this under a different account, use the flags /u [domain\]user /p password with your information submitted.

If you receive an error when trying to sync time such as RPC Server is Unavailable, follow these steps:

  1. Stop the Windows Time Service via Command Line.
    net stop W32Time
  2. Unregister the Windows Time Service.
    w32tm /unregister
  3. Re-register the Windows Time Service.
    w32tm /register
  4. If you receive an error about the service being marked for deletion, the serer must be rebooted before the service can be re-registered.
  5. Lastly, start the Windows Time Service and make sure the service is running:
    net start W32Time sc query W32Time

Linux

  1. Log into the server via SSH. If you're not familiar with how to do this, please see How do I establish an SSH connection to my server?
  2. At the command prompt as an administrator, run the following command:
    vmware-guestd --cmd "vmx.set_option synctime 0 1"