How do I stop the clock running fast on a virtualbox client running ubuntu 8.04?

7,037

Solution 1

This was a know issue in VirtualBox, resolved by installing the Guest Additions on the Virtual Machine to manage the TimeSync. Their was a similiar problem with VMWare a while back as well. This is just one of the times it was reported for VirtualBox.

Ensure you are running the latest guest additions and it is the latest version provided with your version of VirtualBox.

Solution 2

I don't see why you couldn't run ntpd on the system, or cronjob an ntpdate to run every two or three minutes. I remember clock drift being an issue in many VM products at one time or another and the solution was always to make sure both the additions/utilities and the VM product were the same level.

You could also see if installing a new VM with an updated version of Ubuntu affects the clock drift at all, or if there's something odd with hyperthreading on your system or some other processor extension enabled in BIOS.

My personal approach would be to look at running a time sync from cron periodically since NTP can sometimes fail without telling me or run at random times which would be great when the clock isn't skewing like mad but in this type of situation...it might be handier to just force it to run consistently. Won't hurt anything aside from chewing a few extra processor cycles.

Solution 3

I don't know about Ubuntu and Virtualbox, but taking from what I know of RedHat and VMware, you could try appending "clock=pit" to your kernel boot options.

Share:
7,037

Related videos on Youtube

Tom
Author by

Tom

Updated on September 17, 2022

Comments

  • Tom
    Tom over 1 year

    I'm having a problem with the clock running fast in Ubuntu 8.04 server (2.6.24-24-generic kernel) running in VirtualBox 3.04.

    It's drifting quickly, something like 5 minutes per hour.

    I think it was working fine until I upgraded to VirtualBox 3.04 (from 2.something). I had ntpd running and the only thing I had to do was /etc/init.d/ntp stop, ntpdate ..., /etc/init.d/ntp start when the virtual machine was suspended/resumed.

    Today, I've tried installing the VirtualBox Guest Additions, and they're running (according to /etc/init.d/vboxadd status.)

    Running vboxadd-service --foreground --verbose Results in:

    vboxadd-service: Starting 'timesync' in the main thread
    vboxadd-service: adjtime by -380331911000 ns
    vboxadd-service: adjtime by -381107064000 ns
    vboxadd-service: adjtime by -381883899000 ns
    

    Which looks like it's trying, but failing, to update the time.

    So, I'm not sure what to do, I can't find any consensus on whether ntpd should be running or not? And if not, how do I stop it from starting up again on reboot?

  • Tom
    Tom over 14 years
    Yeah, I got that impression... I am running the 3.0.4 version of Guest Additions.
  • Tom
    Tom over 14 years
    i think the clock is drifting too fast for ntpd to correct it using it's "gradual" method. for now i'm just running ntpdate hourly.
  • KFro
    KFro over 14 years
    I noticed that some of the guest additions don't work right after a kernel upgrade...In other words they liked being recompiled when a kernel upgrade happens sometimes. I don't know if that would have anything to do with your problem, but it may...
  • f.ardelian
    f.ardelian about 10 years
    Linux Debian host, Windows XP guest, the clock is delayed by up to exactly 3 minutes. If I sync the time (using NTP) an I let it run for approximately 15 minutes or more, the guest's time will be delayed by exactly 3 minutes. This is with the Guest Additions installed. The problem persists at least with Windows XP guests.