2

I have very rapid time drifts on vmware.

-241587 20:38
-241587 20:39
-241587 20:40
-241587 20:41
-241587 20:42
-0.014 20:02
-0.025 20:03
-0.056 20:04
-0.093 20:05
-0.093 20:06
-68996. 20:07
-68996. 20:08
12.923 20:07
12.923 20:08
20.371 20:09
21.734 20:10
21.734 20:11
-67965. 20:12
-67941. 20:13
-67915. 20:14
-67906. 20:15
-67906. 20:16
-67897. 20:17
2.508 20:16
2.508 20:17
37.491 20:18
40.774 20:19
40.774 20:20
40.774 20:21
-67927. 20:22
-67912. 20:23
-67912. 20:24
-67897. 20:25

NTP tries to deal with it but as you can see it's having troubles. I also tried vmware-tools, but they clearly inferior to NTP. My NTP configured with frequent sync interval and resistance to panic:

tinker panic 0
restrict 127.0.0.1
restrict default kod nomodify notrap
server 10.0.0.3 iburst minpoll 4 maxpoll 6

So, I realized it's better to find the cause of drifts. I found that the time drift depends on CPU load. Higher CPU load - higher drifts. CPU and memory steal don't affect drifts. I isolate single virtual machine on one host - drifts still continue. I've tried different clock sources. hpet, tsc, acpi_pm. - still drifts continue. I was disabling/enabling them on guest level in kernel settings, and on VMware level in vmkernel.boot settings. - nothing worked.

cat /proc/interrupts | grep timer; sleep 10; cat /proc/interrupts | grep timer
  0:         46          0          0          0          0          0          0          0   IO-APIC   2-edge      timer
LOC:     109263     298456     176209     142493     237279     126348     113116     104975   Local timer interrupts
  0:         46          0          0          0          0          0          0          0   IO-APIC   2-edge      timer
LOC:     109499     299498     176782     142786     237786     126769     113417     105206   Local timer interrupts

Guest OS: Ubuntu 16.04.1 VMware 5.5

Алдар
  • 131
  • 5

1 Answers1

1

You can enable periodic synchronization with the following .vmx configuration file option:

tools.syncTime = true

Set the period to something very low, like every 20 secs:

tools.syncTime.period = 20

For this to work you need to have VMWare tools installed in your guest OS.

See http://www.vmware.com/pdf/vmware_timekeeping.pdf for more information

Luca Gibelli
  • 2,611
  • 1
  • 21
  • 29
  • Nowadays, out-of-box vmware tools are no longer supported by the most of linux distributions. In my case, for ubuntu I installed open-vm-tools . And I have no idea how to decrease sync interval. For timesync they have only 2 options: enable, disable. With enabled "timesync", time drifts almost same as without it. – Алдар May 16 '18 at 08:36
  • I just installed vmware-tools on ubuntu 16.04 without any problem, it is supported: https://www.vmware.com/resources/compatibility/detail.php?deviceCategory=software&testConfig=16&productid=40945&supRel=243,&deviceCategory=software&details=1&releases=243&operatingSystems=223&productNames=15&page=1&display_interval=10&sortColumn=Partner&sortOrder=Asc&testConfig=16 – Luca Gibelli May 16 '18 at 14:29
  • I installed vmware-tools directly from host. It also doesn't work. It may fix time only forward. It doesn't fix time backwards. – Алдар Jun 15 '18 at 04:05