Ticket #5510 (closed defect: obsolete)
Clock loses synchronization
Reported by: | arussell | Owned by: | |
---|---|---|---|
Component: | guest additions | Version: | VirtualBox 3.0.12 |
Keywords: | time clock synchronization sync pause save resume | Cc: | |
Guest type: | Linux | Host type: | Windows |
Description (last modified by frank) (diff)
I am running a Windows XP host with multiple Linux guests, including Arch Linux and Ubuntu. I do not know whether or not this bug affects other hosts and guests. I have installed Guest Additions on all affected guests.
Currently the clock falls out of sync after a guest is paused and resumed. The time remains the same as when the guest was paused. Resetting the guest does not fix the issue -- the guest must be completely shut down and manually started again. Also, the same issue manifests when the machine state is saved and then restored.
I would expect the Guest Additions to detect whenever the machine is restored from a paused or saved state and set the time accordingly.
Attachments
Change History
comment:1 Changed 14 years ago by frank
If you updated the guest additions to 3.0.12 then the maximum difference between guest and host cannot be more than 20 minutes. If the difference is smaller, adjtime() is used to adjust the guest time to the host time. If the difference is bigger, the guest time is set using settimeofday(). The parameter 20 minutes is configurable, check /usr/sbin/vboxadd-service --help and check the script /etc/init.d/vboxadd-service.sh.
comment:2 Changed 14 years ago by arussell
Thanks for the response. It seems to work if I modify the vboxadd-service script to pass --timesync-set-threshold <ms>. About how long does adjtime() usually take to synchronize the time? I let it run for quite a while, and the time never seemed to catch up. Does adjtime() leave a log entry anywhere?
comment:3 Changed 14 years ago by frank
adjtime() is a Linux syscall which takes the difference to the correct time. The Linux kernel decides himself how quick the time is adjusted. The interval is usually quite small (some milliseconds per interval). You can start the service with -v -v -v --foreground to display debugging output.
comment:4 Changed 14 years ago by arussell
Alright, so it looks like adjtime *is* trying to sync the time, but it just takes an extremely long time. I set the threshold to a lower number, and it works to my satisfaction. I had been having this problem for quite a while now, but only just now reported it...so it looks like it's already been fixed! I'm fine with this ticket being closed. Thanks again for being so helpful.
Ubuntu run