1

Debian 9 as Guest Hyper-V is unable to synchronize the clock and set the right date, always it stays around 6 minutes behind:

(Timezone is obfuscated)

#  systemctl start ntp
#  date
    sáb jul  7 09:42:59 -03 2018
#  timedatectl 
    Local time: sáb 2018-07-07 09:43:09 -03
    Universal time: sáb 2018-07-07 12:43:09 UTC
    RTC time: sáb 2018-07-07 12:45:22
    Time zone: XXXXXXXXXXXXXX (-03, -0300)
    Network time on: yes
    NTP synchronized: no
    RTC in local TZ: no
 #  ntpstat 
     unsynchronised
     polling server every 64 s
 #  ntpq -p
         remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 0.debian.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.001
 1.debian.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.001
 2.debian.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.001
 3.debian.pool.n .POOL.          16 p    -   64    0    0.000    0.000   0.001
 66.60.22.202 (a 64.113.44.54     2 u   20   64    1   10.385  321656.   7.049
 time.unnoba.edu 200.89.75.197    3 u   19   64    1   14.119  321640. 185704.
 131.0.232.2 (st 216.218.254.202  2 u   16   64    1    9.568  321660. 185705.


What could be wrong?
sebelk
  • 682
  • 4
  • 13
  • 32

2 Answers2

4

Hyper-V includes system clock synchronization service that is enabled by default; in other words, your ntpd or systemd-timesyncd is fighting with Hyper-V syncing the time of the guest VM to the time of the host system.

Before implementing any NTP-based time synchronization, you must switch the Hyper-V time synchronization off.

See this question on Superuser.SE for instructions on disabling Hyper-V time synchronization.

telcoM
  • 4,448
  • 15
  • 25
0

I've found that is as time is synced by systemd now. So, I did:

chmod -x /usr/sbin/ntpd
systemctl restart systemd-timesyncd

And now the time is correct. However timedatectl says clock is not syncd:

timedatectl | grep no$

NTP synchronized: no
RTC in local TZ: no
sebelk
  • 682
  • 4
  • 13
  • 32