Page 1 of 1

How to get time synchronisation to work?

Posted: 27. Mar 2012, 23:54
by varboxer
Hi

I've got a linux guest in a solaris host but the guest timekeeping is very poor.
NTP fails to keep the time synchronised so I'm trying the guest additions method.
However it doesn't seem to work, I've seen the offset go up to 20 minutes!
I've used commands like this on the host:
VBoxManage guestproperty set VM_NAME "/VirtualBox/GuestAdd/VBoxService/PARAMETER" VALUE
as documented but to no effect.
I've tried setting the parameters whilst the guest is off and whilst it is on, just in case.
Is there some trick I'm missing?

Re: How to get time synchronisation to work?

Posted: 28. Mar 2012, 06:15
by stefan.becker
Are the guest additions installed?

Re: How to get time synchronisation to work?

Posted: 29. Mar 2012, 13:59
by varboxer
Yes, guest additions are installed and the VBoxService process is running and has been restarted.

Since the time does seem to sync when it is 20 minutes out I suspect the settings are not taking effect. At what point are settings like "timesync-set-threshold" read and when can they be changed?

And why is the time offset getting worse and worse until it reaches 20 minutes rather than being kept better in sync?

Re: How to get time synchronisation to work?

Posted: 31. Mar 2012, 03:51
by ocean_xu
what is ntpdate output?

Re: How to get time synchronisation to work?

Posted: 31. Mar 2012, 09:35
by varboxer
ntpdate takes several (~8) seconds to run. The delay is ~0.02588. The offset varies as I described, increasing non-monotonically up to 1200 seconds.

Re: How to get time synchronisation to work?

Posted: 3. Apr 2012, 13:53
by varboxer
I've changed the VM to simulate two CPUs instead of one and the time is now staying within 0.1 seconds.

Re: How to get time synchronisation to work?

Posted: 3. Apr 2012, 14:57
by Ramshankar
Do NOT run NTP client in parallel if you have the guest additions' time sync installed.

Re: How to get time synchronisation to work?

Posted: 30. Aug 2012, 12:55
by varboxer
I'm still having big troubles with time sync. The guest time becomes wrong by more than 30 seconds.

Running VBoxService like this:

Code: Select all

VBoxService -v -v -f --enable-timesync --timesync-interval 1000 --timesync-set-threshold 1000 --timesync-set-start
I can see a couple of "timesync time set to" messages and a bunch of "timesync VBoxServiceTimeSyncAdjust: adjtime by" messages but only every two hours so the time still goes out too far too often.

Why is it only every two hours, how can it be synchronised more frequently?

Re: How to get time synchronisation to work?

Posted: 12. Sep 2012, 03:07
by hmartin
Are you sure your options are being properly set? Can you post the results of running

Code: Select all

# VBoxService -vv