FreeBSD loses time when used in VMware

Gary Hendricks bsdmail at project415.org
Thu Jul 6 15:24:25 BST 2006


 Gary Hendricks wrote:

>> Stephen Allen wrote:
>>> I run my FreeBSD installation in a VMware session, which I pause each
>>> time I shut my computer down. This means I have to reset the date/time
>>> when I start it again. However, the time seems to be running slow... it
>>> takes about 1.5 seconds for a second to pass in FreeBSD.
>>>
>>> I run a Gentoo installation too, which a) doesn't suffer this problem,
>>> and b) seems to set itself the right time when I resume it from being
>>> paused?!
>>>
>>> Any ideas why FreeBSD time is running slow?
>>>
>>> Many thanks,
>>> Steve :)
>>>
>>>
>>> ------ FreeBSD UK Users' Group - Mailing List ------
>>> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users
>>>
>> In a bid to bring the conversation back on track, I have a VMWare 
>> image running and suspended it.
>> Will update you whether the time slows down in the virtual machine 
>> and whether it is a FreeBSD thing or not.
>>
>> What is your securelevel set at? Some levels can prohibit the update 
>> of time by anything more than a second or so.
>>
>> -Gary
>> PS: English is not my first language either.. ;-)
>>
>>
>>
>> ------ FreeBSD UK Users' Group - Mailing List ------
>> http://listserver.uk.freebsd.org/mailman/listinfo/freebsd-users
>>
> OK, These are my findings.
>
> My clock did not update until I issued an ntpdate with one of our 
> servers. So no obvious 'automatic' updating from the host.
>
> My time seem to be running pretty shoddy with the host as reported.
>
> 6 Jul 14:06:58 ntpdate[97755]: step time server offset 7.012476 sec
> 6 Jul 14:08:14 ntpdate[97756]: step time server offset 36.679682 sec
> 6 Jul 14:08:29 ntpdate[97757]: step time server offset 7.391938 sec
> 6 Jul 14:08:46 ntpdate[97758]: step time server offset 8.141272 sec
> 6 Jul 14:08:59 ntpdate[97759]: step time server offset 6.409949 sec
>
> -Gary
>


To fix this is kinda simple but horrible..

6 Jul 14:17:13 ntpdate[512]: adjust time server offset -0.024246 sec
6 Jul 14:17:28 ntpdate[513]: adjust time server offset 0.019958 sec
6 Jul 14:17:58 ntpdate[514]: adjust time server offset 0.007555 sec

One possible solution or workaround to this problem is to disable the 
use of APIC (note: Not ACPI) by adding the following line in 
/boot/loader.conf:

hint.apic.0.disabled=1

By disabling APIC device, FreeBSD is forced to fall back on the IRQ 
timers to avoid the rate of the clock and timer on emulated FreeBSD 
machine on VMware slows down. The down side to this resolution is that 
FreeBSD cannot runs in as SMP kernel mode as a virtual SMP machine on 
the emulated machine.

Another alternative is to comment out the “device apic” line in the 
kernel config file and rebuild the kernel.

This was leeched from 
http://www.mydigitallife.info/2006/04/12/freebsd-60-on-vmware-server-time-and-clock-slow-down/






More information about the Ukfreebsd mailing list