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?
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?
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.
Can't rely on TSC http://en.wikipedia.org/wiki/Time_Stamp_Counter
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.
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:
https://gist.github.com/1209749
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:
http://www.gentoo-wiki.info/HOWTO_Install_VMware_Tools_in_Gentoo
Though the question is quite old, here's another preferable solution to the problem:
This way, the clock of the guest will always match the host's clock, even if the VM is suspended. Other methods like running ntpd or ntpdate failed for me. And, yes, the clock will jump and cron jobs might be skipped ;)