VMware – Convoluted Guest Freeze Fix…
I had been struggling for some considerable time with guest (Win10) performance issues with VMware – including application (Photoshop CS6) ‘freezing’ for a time, and overall very sluggish responses..
I had found several articles that suggested cause/effect/fix for this, but none really worked..
I made changes to control khugepaged:
……………………..
[root@rglinux820 ~]$ echo never | tee /sys/kernel/mm/transparent_hugepage/defrag
never
[root@rglinux820 ~]$ echo 0 | tee /sys/kernel/mm/transparent_hugepage/khugepaged/defrag
0
[root@rglinux820 ~]$ cat /sys/kernel/mm/transparent_hugepage/defrag
always defer defer+madvise madvise [never]
– and added ‘ transparent_hugepage=never ‘ to the kernel command line..
– but this only worked for a while after host reboot, and then the guest freezing started again.
I then found another suggestion, regarding kcompactd0, and made the following changes (as root):
$ echo 0 > /proc/sys/vm/compaction_proactiveness
and (for a permanent fix) added the following to /etc/sysctl.conf:
# Fix problem when vmware is affected by kcompactd0.
vm.compaction_proactiveness=0
After all these changes, the freezing problem seems to have – finally – disappeared..
It should be mentioned that Win10 also may need ‘power/performance’ settings altered to prevent ‘disk sleep’ issues etc., but that is outside the scope of a Linux article!..
There may be other workarounds/fixes, but these are the ones that worked for me..
Acknowledgements…
The original articles I found are here – and one has been updated to cover a potential Win11 guest issue:
https://unix.stackexchange.com/questions/458893/vmware-on-linux-host-causes-regular-freezes
and
https://gist.github.com/2E0PGS/2560d054819843d1e6da76ae57378989 (scroll down to the comments by neves-0 and gene-olsen for the kcompactd0 fix..)
Robert Gadsdon. January 20th, 2022.
One thing that’s bugged me for years is the guest (CentOS7) would start running at 100% CPU at random times. Both the guest and host performance would go to hell. I’d added the parms you suggested but no joy. The fix for me was to create a desktop icon with the start command as
vblank_mode=0 vmplayer /home/jojo/vmware/CentOS7.2/CentOS\ 7.2.vmx
I had found that previous ‘solutions’ worked for others, but not for me..
Thanks for the additional fix info – I’ll try that if my ‘guest’ slows down again..
RG.