Views:

Temporary fix:

  1. Pause and resume the VM.
  2. Stop and start the VM.
  3. Go to Hyper-V Manager console and disable and then enable the Time Synchronization option for the VM.

Long-term fix:

  1. Configure the VM to pull time from an external source (e.g. domain controller or NTP server). This requires the Time Synchronization option to be disabled on the host.
  2. Configure the host to pull time from an external source like domain controller or NTP server; and then verify if the VM is pulling time from the host OS through NTP.
    1. Create a script for cron to schedule time update on the server:
    2. You need to create the script using vi editor:

      cd /etc/cron.hourlyvi ntpdate.sh

    3. Change the pool.ntp.org to be whatever your time server is:

      Example:

      Original File:

      #!/bin/bash
      ntpdate -s pool.ntp.org
      service crond reload

      New File:

      #!/bin/bash
      ntpdate -s time-a.nist.gov service crond reload

    4. Save and close the file.
    5. Add the following in order to run hourly in crontab:

      crontab –e

      This allows you to edit the root crontab.

      The original file looks something like this:

      */10 * * * * /usr/sbin/logrotate /etc/logrotate.d/lighttpd
      0 * * * * /usr/tmcss/bin/tlogger
      15 0 * * * /usr/tmcss/bin/CDTPurge.sh

    6. Add a line to the script above:

      19 * * * * /etc/cron.hourly/ntpdate.sh

      The 19 means it will run every hour at the 19th minute. You can change this to any number you want.

    7. Save the file and make sure that the Time Synchronization option has been disabled on the host.