5

I have an Ubuntu 14.04.4 LTS VM running under Vagrant and VirtualBox. When comparing its time to the server's I see things like this:

$ ntpdate -q ntp.ubuntu.com
server 91.189.94.4, stratum 2, offset -0.527602, delay 0.11812
server 91.189.89.198, stratum 2, offset -0.415140, delay 0.12631
server 91.189.89.199, stratum 2, offset -0.666563, delay 0.12758
server 91.189.91.157, stratum 2, offset -0.561897, delay 0.04617
 3 Aug 20:40:38 ntpdate[17776]: step time server 91.189.91.157 offset -0.561897 sec
$ ntpdate -q ntp.ubuntu.com
server 91.189.91.157, stratum 2, offset 0.005067, delay 0.04915
server 91.189.94.4, stratum 2, offset -0.969532, delay 0.11708
server 91.189.89.198, stratum 2, offset -0.991536, delay 0.12196
server 91.189.89.199, stratum 2, offset -0.871215, delay 0.12868
 3 Aug 20:42:21 ntpdate[17778]: step time server 91.189.94.4 offset -0.969532 sec

Note the huge difference in offset for the 2 invocations. 1/2 a second and almost 1 second.

I tried updating the time:

$ sudo ntpdate -s ntp.ubuntu.com
$ ntpdate -q ntp.ubuntu.com
server 91.189.91.157, stratum 2, offset -0.144275, delay 0.04559
server 91.189.94.4, stratum 2, offset -0.996168, delay 0.11856
server 91.189.89.198, stratum 2, offset -0.045262, delay 0.12607
server 91.189.89.199, stratum 2, offset -0.056879, delay 0.12617
 3 Aug 20:44:16 ntpdate[17859]: adjust time server 91.189.89.198 offset -0.045262 sec

Which made the offset much less. But that's still a lot for having just been updated. On another server I saw an offset of .002.

What could be going on? This VM is configured identically, afaik, to other servers which do not have this problem. What should I check?

1
  • 3
    You shouldn't be using ntp inside VMs -- the guest tools support automatic clock syncing. Probably the hypervisor adjusting the clockrate of the VM on the fly is responsible for your problems.
    – alzee
    Aug 3, 2016 at 20:55

2 Answers 2

2

First thing I would check is make sure the Guest Additions are installed and running properly on that VM. Part of their job is to synchronize the real time clock with the clock on the host. I'm not sure about Ubuntu specifically, but I think in some distros you need to configure the necessary services to start automatically after installing the Guest Additions.

0

As Charles said, you should check that virtualbox guest plugin is installed.

If you still have the issue try to modify the paravirtualisation parameter of your VM.

In the setting of your machine go to: Systeme > Acceleration Clock Drift virtualbox

1
  • I see mine is set to "legacy". should i changed it to "default"? May 24, 2017 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.