VMware Communities
happyuserbg
Contributor
Contributor

Workstation 17.5.0: vmware-clk spinning on CPU when Linux VMs are running

I am using VMware Workstation 17.5.0 on Ubuntu 20.04 host and I noticed that whenever there is at least one Linux VM running, a vmware-clk processes is started and it keeps using around 17% CPU.
When only Windows VMs are running, this doesn't happen. I can see such process occasionally but it quits quickly without causing any excessive CPU usage.
It doesn't matter how many Linux VMs are running, there is only 1 process and the CPU usage doesn't really change.
When I shut down all Linux VMs, the process quits.
When I power on a Linux VM to firmware, there is no such issue until I exit the firmware and the OS boots.

I managed to reproduce this issues in Ubuntu VM using nested virtualization, so it doesn't seem to be an issue with my host OS.
Interestingly, when I search for vmware-clk in Google, I get only 1 result which is a shell script in GitHub. Also nothing in this forum.

I am not sure if this issue is new for VMware Workstation 17.5 since I upgraded from 16.2.5 and I never tried 17.0.x.

My host's CPU is Ryzen 5 1600x.

Tags (1)
9 Replies
downhomejoe
Contributor
Contributor

This also happens on EYPC 7601 with VMware 17.0.2 and 17.5, Linux kernel 6.5.0 host. Guests are running open-vm-tools. Time sync is enabled in most of the VMs. The vmware-clk cpu usage does not increase with more VMs running. Slightly different behavior than above, vmware-clk uses ~30% core constantly and never goes away.

happyuserbg
Contributor
Contributor

It's interesting if this only happens on hosts with AMD CPUs.
In my case vmware-clk's CPU usage is 17% of one thread, but the lower % may be due to the higher base clock (3.6 GHz vs. 2.2 GHz of EPYC 7601).
The CPU usage doesn't increase when 2 or more Linux VMs are running.
I don't have time sync enabled for any of the VMs and I also tried to completely disable it by adding a bunch of settings in the .vmx file, but this didn't help.
I see the same issue even when running RouterOS.
I guess that the issue doesn't happen when only Windows VMs are running because Windows uses tick counting for timekeeping while recent Linux kernels use tickless timekeeping.

It will be good if someone who runs Workstation 7.5.0 on Linux with Intel CPU reports whether such issue exists on such host.

FamPhetial
Contributor
Contributor

I have the same thing. vmware-clk taking 10 % CPU while the guest and host are idle.

In the settings it says: "Time sync off"

This is with: AMD Ryzen 9 5900X

0 Kudos
FamPhetial
Contributor
Contributor

What is going on here? Is somebody from vmware monitoring this forum or is it just a useless excercise to engage here?

sahat
Contributor
Contributor


I had to manually patch the vmmon module to work-around/resolve this issue.

Here is what I did (on Ubuntu 22.04):


mkdir /tmp/work
cd /tmp/work
tar xf /usr/lib/vmware/modules/source/vmmon.tar
cd vmmon-only/

# Edit the code - patch
vi linux/hostif.c

#
# Change the following in function HostIF_SetFastClockRate(), line number 3353
#
# from:
# if (rate > MIN_RATE) {
# to:
# if (false) {
#
# Save the file and exit ( :wq )
#

# Build the module
make

# If the above is successfult then the vmmon.ko module would be placed in current directory

ls -l ./vmmon.ko

#
# Unload the module
# Make sure there are no VMs running
#
sudo rmmod vmmon

# Save a copy of the original module, in case we need to revert back
sudo mv /usr/lib/modules/$(uname -r)/misc/vmmon.ko /usr/lib/modules/$(uname -r)/misc/orig.vmmon.ko

# Copy our newly built module
sudo cp ./vmmon.ko /usr/lib/modules/$(uname -r)/misc/vmmon.ko

# Load the newly built module
sudo modprobe vmmon

# Verify that the module has been loaded
sudo lsmod | grep vmmon

#
# Now save the patched sources
# so that if the ubuntu kernel is updated in future and
# VMware player/workstation needs to rebuild the modules,
# ensure that your changes are preserved
#
cd ..
tar cvf vmmon.tar vmmon-only/
sudo mv /usr/lib/vmware/modules/source/vmmon.tar /usr/lib/vmware/modules/source/orig.vmmon.tar
sudo mv ./vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar

 

0 Kudos
FamPhetial
Contributor
Contributor

That did not work for me. The module builds and loads fine. But when I start a VM the computer basically freezes.

0 Kudos
happyuserbg
Contributor
Contributor

This issue is not resolved in Workstation Pro 17.5.1.

Looks like VMware has problems with QA.

Also no one from VMware pays attention to this forum.

0 Kudos
JMA100
Enthusiast
Enthusiast

Yes, this issue is still present on 17.5.1.  I followed sahat's suggestion and it worked on three different hosts.  Thank you sahat!

0 Kudos
FamPhetial
Contributor
Contributor

I gave @sahat 's fix another try. And, indeed, it works for me now too. I must have done something wrong when I tried it the first time. Now its working fine. I can not see any vmware-clk process anymore. Thank you!

 

0 Kudos