Page 1 of 2
Single app causing massive time drift
Posted: 12. Sep 2009, 12:46
by dali
Hello.
I'm using VirtualBox 3.0.6 on Debian Lenny, with a Windows Server 2003 guest (Guest Additions installed).
I've been having problems with the virtual machine losing time, the clock could loose 20 minutes in an hour. I've searched forums and Googled the problem, everything looked OK (kernel modules, guest additions), I even tried turning off CPU frequency scaling on the host, no luck.
Today I stumbled on the cause: I have a personal information manager installed in the virtual machine, EssentialPIM Free Edition (3.0.3). When I start E-PIM, the system clock visibly slows down to a crawl, every second taking 2-3 real seconds. Not only does the clock slow down, it feels like the whole machine slows down. As soon as I exit the program, the clock speeds up until it reaches correct time and then proceeds in normal steps (probably Guest Additions correcting the time), staying in sync until E-PIM i started again.
Since the app is used for reminders and such, it probably hooks in to the system clock in some way and that seems to cause a massive drift when in a VirtualBox virtual machine. I've used E-PIM on a physical machine (also Windows Server 2003) for years with zero problems. I've also used it in VMWare virtual machines without problems.
Any ideas?
Re: Single app causing massive time drift
Posted: 15. Sep 2009, 21:13
by vbox4me2
You might pose the question to the developpers of the App. if they are hogging rtc or attempting to hogg. The App. might even have options to control this.
Re: Single app causing massive time drift
Posted: 21. Sep 2009, 20:32
by dali
I have, they "noted the problem" but weren't going to do anything about it. It's a freeware app, I can't do much more than that.
I've also tried another app, Desktop iCalendar, which had the same effect.
Seems likely that it's a problem affecting all apps needing to monitor the system time. I've only seen it in VirtualBox.
Re: Single app causing massive time drift
Posted: 21. Sep 2009, 21:10
by vbox4me2
Anything that depends on the rtc will have this problem, but hanging of rtc is only needed for exact timing events like stock management. You could hack into the rtc routines to add some idle's.
Re: Single app causing massive time drift
Posted: 24. Sep 2009, 18:03
by dali
You mean changing the source code and building VirtualBox? I'd rather not do that if I can avoid it, every update would mean recompilation, "aptitude update; aptitude safe-upgrade" is very much preferred ...
If you mean adding/changing some parameter to the XML file, I'm all for it.
Re: Single app causing massive time drift
Posted: 24. Sep 2009, 19:25
by vbox4me2
No I meant the app. misbehaving.
Re: Single app causing massive time drift
Posted: 24. Sep 2009, 19:38
by dali
Ah, OK. It's freeware but unfortunately not open source.
Re: Single app causing massive time drift
Posted: 25. Sep 2009, 21:06
by abronsius
I get the same behavior under windows xp. I have 3 virtual Windows XP running with the same configuration but only one has time shift! I can run this machine alone, with no app: it does not change the problem.
Hope it will be fixed with the next version of virtualbox...
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 19:26
by robertb
Was this ever fixed? I'm running 3.2.10 and it has pretty severe time drift as a result of an application (I think) running on the host machine (Windows 7). It's losing 1 second for every 5 seconds.
As a short-term fix, I'm running an NTP equivalent (htpdate because the firewall blocks a number of ports including ntp and time). I set the time every 15 seconds via a script that gets started on boot, but I'm a bit worried that doing this will screw up some programs.
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 19:36
by Perryg
Are you saying the HOST is loosing the time?
Does it loose the same amount of time if you are not running anything on it?
I have seen Windows loose time all by itself. Usually the issue is the motherboard clock but can be due to a bios problem. Try updating the MB bios and see if it helps.
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 21:57
by robertb
Perryg wrote:Are you saying the HOST is loosing the time?
No, the guest is losing the time synchronization. [I'm realizing that I've been posting to the wrong sub-forum since I'm running Ubuntu under Windows, not vice-versa. Sorry.]
Perryg wrote:Does it loose the same amount of time if you are not running anything on it?
No. The host (Win7) seems to keep time perfectly. It's only the guest (Ubuntu) that loses track of time.
Perryg wrote:I have seen Windows loose time all by itself. Usually the issue is the motherboard clock but can be due to a bios problem. Try updating the MB bios and see if it helps.
Windows is working fine. It's only the VM that's drifting.
Again, it starts out with the correct time when the VM first starts, but then it loses it. It's also very inconsistent how much it drifts. I would guess that it has something to do with the applications running on the host. I still need to do more experimentation.
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 22:33
by Perryg
Are the guest additions installed (in the guest)?
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 23:22
by robertb
I checked that. All guest additions are installed.
I'm not sure it would matter, 'tho. When I check the "bios" clock in the guest VM via "hwclock -r", it's wrong, too.
Re: Single app causing massive time drift
Posted: 25. Nov 2010, 23:38
by Perryg
Yes it would matter. The guest additions are what provides the time sync.
What version of Ubuntu are you using?
Re: Single app causing massive time drift
Posted: 26. Nov 2010, 01:05
by robertb
Ubuntu 9.10 Karmic Koala, 32-bit. (The host is 64-bit Win7.)
FWIW, everything else works, including mouse integration in seamless mode. I only noticed this time sync problem yesterday. I don't recall the time being off before that. (I've been running Virtualbox this way for about 1 month.)