# [BHYVE] Time is drifting away in windows guest



## abishai (Aug 20, 2017)

I observing very nasty issue with my windows guest in 11.1/bhyve.
I installed net/openntpd on my host, enabled NTP server and disabled NTP client (to be sure, this is not host clock drifting due to openntpd actions).
I'm pinging NTP server from windows and clock difference drifting VERY fast.
http://i.imgur.com/p3bKWXU.png You may observe -0,002 seconds every 2 seconds.
Any suggestions are welcome, clock difference becomes critical very fast


----------



## grehan@ (Aug 24, 2017)

What was the command you were using on Windows to show this ?


----------



## IPTRACE (Aug 25, 2017)

I have FreeBSD 11.1-p1 and Windows 10 on bhyve.
There is a clock synchronization on Windows but with external Microsoft NTP server.
The time is still correct.

Can you show the results of the below commands?
Windows: `w32tm /query /peers`
FreeBSD: `ntpctl -sa`


----------



## abishai (Aug 29, 2017)

grehan@ said:


> What was the command you were using on Windows to show this ?


`w32tm /stripchart /computer:10.0.1.2`
10.0.1.2 is bhyve host with openntpd.



IPTRACE said:


> Can you show the results of the below commands?




```
w32tm /query /peers
#Peers: 1

Peer: 10.0.1.2,0x9
State: Active
Time Remaining: 604657.5096000s
Mode: 3 (Client)
Stratum: 0 (unspecified)
PeerPoll Interval: 17 (out of valid range)
HostPoll Interval: 10 (1024s)
```


```
abishai@vhost:~ % doas ntpctl -sa
4/4 peers valid, constraint offset 0s, clock synced, stratum 3

peer
   wt tl st  next  poll          offset       delay      jitter
131.155.140.130 from pool pool.ntp.org
    1 10  2  914s 1272s         0.968ms    41.828ms     0.550ms
163.172.223.237 from pool pool.ntp.org
    1 10  2  984s 1299s         3.746ms    39.964ms     0.887ms
129.250.35.250 from pool pool.ntp.org
 *  1 10  2  636s 1299s         0.606ms    40.745ms     3.832ms
51.15.41.135 from pool pool.ntp.org
    1 10  3  658s 1325s        -4.947ms    53.562ms     4.193ms
```
But, as I told before, ntp client was disabled (it enabled now), so pinging 10.0.1.2 time shows drift of bhyve guest clock. External ntp server shows the same thing.

```
Tracking time-a.nist.gov [129.6.15.28:123].
The current time is 29.08.2017 22:18:25.
22:18:25 d:+00.1403994s o:-02.8782846s  [                   *       |
                ]
22:18:27 d:+00.1247995s o:-02.8760599s  [                   *       |
                ]
22:18:29 d:+00.1379994s o:-02.8982575s  [                   *       |
                ]
22:18:31 d:+00.1399992s o:-02.8969664s  [                   *       |
                ]
22:18:34 d:+00.1409994s o:-02.8973507s  [                   *       |
                ]
22:18:36 d:+00.1399995s o:-02.9000638s  [                   *       |
                ]
22:18:38 d:+00.1389995s o:-02.9018046s  [                   *       |
                ]
22:18:40 d:+00.1419995s o:-02.9040934s  [                   *       |
```
Bhyve host with disabled openntpd is not drifting.

```
abishai@vhost:~ % ntpdate -qv time-a.nist.gov
29 Aug 22:29:49 ntpdate[24566]: ntpdate 4.2.8p10-a (1)
server 129.6.15.28, stratum 1, offset -0.002670, delay 0.15079
29 Aug 22:29:55 ntpdate[24566]: adjust time server 129.6.15.28 offset -0.002670 sec
```


----------

