Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have Gentoo installed as guest OS. I have hardware clock synced with host system, but the clock of OS tend to be wrong after suspend.

The only solution I find out is run hwclock -s frequently via cron.

Any better method?

share|improve this question

VMware tools might do this for you, but Gentoo is not in the guest compatibility list so it may not work, or may take a lot of effort to get working.

You could use ntp to keep the clock up to date, or schedule ntpdate to run. I am not sure if these are better methods than hwclock -s.

One thing you may want to avoid is a method that simply changes the clock time - that will result in cron jobs being skipped. ntp speeds up the clock to get to the correct time. ntpdate changes the clock time.

share|improve this answer
For me, the only difference between ntpdate and hwclock -s is that ntpdate requires network, because the host is ntp-synced. But ntpd takes a long time to catch up after suspend for a day. :-( – leafduo Jul 23 '11 at 5:57
And, skipping cron jobs is not critical for me, this host is used for developing only. – leafduo Jul 23 '11 at 5:58
$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock tsc hpet acpi_pm 

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource

Can't rely on TSC

Try hpet or acpi_pm

Plus kernel command line option clocksource=hpet (set inside boot loader configuration.)

See Documentation/kernel-parameters.txt in Linux source.

share|improve this answer
I don't have kvm-clock as an available clocksource, why? – leafduo Sep 9 '11 at 8:05
Last night I had just gotten in bed when the thought that timesource was the issue. I had to write it down or I'd forget. My only Gentoo-on-VMware fusion VM guest is miles away. I edited my comment this morning taking out some KVM-specific stuff. I am pretty KVM-centric. – user67717 Sep 9 '11 at 11:16
kvm-clock would only work if you were using KVM not VMware Fusion. – user67717 Sep 9 '11 at 11:17

I built a new Gentoo VM guest on VMware Fusion 3.1.3 on another Macbook and installed open-vm-tools which is in portage. I had to unmask two packages but they built OK.

The /usr/bin/vmtoolsd process keeps the guest clock in sync with the host clock. It does some other housekeeping too. Admittedly it may take a short while for it to bring the clock into sync but it does it for me.

To get accelerated I/O etc. you want to activate these kernel options too:


They don't require a "tools" package as the upstream kernel contains those drivers by default now. The open-vm-tools-kmod package contains additional driver modules. My config file is visible in this gist:

I didn't actually read this wiki entry, I just installed the packages and configured the startup scripts and kernel options myself but it might be useful:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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