Clock Drift on Debian under VirtualBox
I installed a minimal Debian 10 as guest on a MacBook Pro under VirtualBox 6.1 and noticed that the clock would drift – at lot. After being up a couple of hours it was almost an hour slow.
Whether using systemd-timesyncd
, ntp
, or ntpd -gq
all would give the same result: the clock would not sync.
Below of ntpd -gq
that just never quits:
11 May 14:12:28 ntpd[712]: ntpd 4.2.8p12@1.3728-o (1): Starting
11 May 14:12:28 ntpd[712]: Command line: ntpd -gq
11 May 14:12:28 ntpd[712]: proto: precision = 1.117 usec (-20)
11 May 14:12:28 ntpd[712]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): good hash signature
11 May 14:12:28 ntpd[712]: leapsecond file ('/usr/share/zoneinfo/leap-seconds.list'): loaded, expire=2020-12-28T00:00:00Z last=2017-01-01T00:00:00Z ofs=37
11 May 14:12:28 ntpd[712]: Listen and drop on 0 v6wildcard [::]:123
11 May 14:12:28 ntpd[712]: Listen and drop on 1 v4wildcard 0.0.0.0:123
11 May 14:12:28 ntpd[712]: Listen normally on 2 lo 127.0.0.1:123
11 May 14:12:28 ntpd[712]: Listen normally on 3 enp0s3 192.168.73.175:123
11 May 14:12:28 ntpd[712]: Listen normally on 4 lo [::1]:123
11 May 14:12:28 ntpd[712]: Listen normally on 5 enp0s3 [2a01:cb00:28c:d900:a00:27ff:fecb:be52]:123
11 May 14:12:28 ntpd[712]: Listen normally on 6 enp0s3 [fe80::a00:27ff:fecb:be52%2]:123
11 May 14:12:28 ntpd[712]: Listening on routing socket on fd #23 for interface updates
11 May 14:12:29 ntpd[712]: Soliciting pool server 89.111.47.130
11 May 14:12:30 ntpd[712]: Soliciting pool server 66.70.172.17
11 May 14:12:30 ntpd[712]: Soliciting pool server 171.66.97.126
11 May 14:12:31 ntpd[712]: Soliciting pool server 173.255.215.209
11 May 14:12:31 ntpd[712]: Soliciting pool server 47.190.36.235
11 May 14:12:31 ntpd[712]: Soliciting pool server 2a01:4f8:162:548a::2
11 May 14:12:32 ntpd[712]: Soliciting pool server 2a01:4f8:160:4266::2
11 May 14:12:32 ntpd[712]: Soliciting pool server 178.17.161.12
11 May 14:12:32 ntpd[712]: Soliciting pool server 199.182.221.110
11 May 14:12:32 ntpd[712]: Soliciting pool server 89.111.15.218
11 May 14:12:33 ntpd[712]: Soliciting pool server 176.221.42.125
11 May 14:12:33 ntpd[712]: Soliciting pool server 2a00:f820:428::2
11 May 14:12:33 ntpd[712]: Soliciting pool server 79.142.192.4
Turns out that it’s the paravirtualization provider setting of Virtual Box that slowed the clock down artificially.

Set it to Minimal
and the problem is resolved.
For Linux the documentation suggests KVM
as a manual override of Default
, which should also be selecting KVM, but this did not resolve the problem. See also “How to select paravirtualization interface in VirtualBox?“
Once that change was made ntpd -gq
fetches the time, adjusts the clock, and quits as expected.
Furthermore, this can also be tested with a sleep 3
on the command line. The console should stay busy for about 3 seconds and return. In my tests it was noticeably longer (about 5 to 6) when paravirtualization was Default
or KVM
.