3

When running a virtual machine in VMware (Ubuntu 16.04 host), both the guest system (Windows 10 at the moment) and the host system regularly become unresponsive for several seconds, e.g. when starting Atom or Visual Studio in the guest VM.

RAM usage reports look normal (16 GB total, 6.5 GB used by the VM as “shared memory”, some GB free), but while the system is unresponsive, IO tasks are either suspended or very slow, for example copy/paste of text takes several seconds.

Changing settings (virtualisation settings, VM’s RAM, …) in VMware does not have any effect.

  • Even though you've found the solution, I am surprised you are fine with 5GB of RAM used for your VM, as from my experience W10 allocates 5+ GB just when it starts, and VS 2017 takes about 500MB, so 5.5GB used under W10 on a physical host with 16GB RAM is a normality. Adding AV and other minor corporate stuff brings up initial RAM allocation on my current machine to 9.5 GB right after fresh start. – ajeh Jul 27 '18 at 17:28
  • You are right. The VM is configured with 6.5 GB currently. In free -h, the memory used by VMware does not show up in “used memory” but only in “shared” (for example, it shows 2 GB used and 3 GB free currently). Will update the question to clarify that :) – Simon A. Eugster Jul 30 '18 at 6:55
5

The solution is to disable khugepaged defragmenting:

echo never | sudo tee /sys/kernel/mm/transparent_hugepage/defrag
echo 0 | sudo tee /sys/kernel/mm/transparent_hugepage/khugepaged/defrag

See this answer from the question Arch Linux becomes unresponsive from khugepaged.

Also, it is probably a good idea to limit the amount of RAM which VMware can use for running VMs to reserve some for the host system (Edit > Preferences).

VMware settings for reserved memory


Note: I am re-posting this answer under this question because the answer is very hard to find – it literally took me years.

| improve this answer | |
  • 2
    alternatively, you can add to the kernel options in grub transparent_hugepage=never – Rui F Ribeiro Jul 27 '18 at 16:48
2

I will leave this answer here in case it might help someone else.

I've experience frequent freezes and hangs both on host (Ubuntu 19) and guest (Centos 7) while using VMware. I do not know what is the problem and I did not find a solution on any forum. I am using a Dell Xps 9570.

The freezes stopped when I deactivated "Virtualization Engine" options. Go to "Virtual Machine Settings" > "Processors" and make sure there is no checkbox selected at "Virtualization Engine".

enter image description here

| improve this answer | |
2

For me none of the above helped, also disabling 3D support did not help.

Instead what seemed to help is to set the power setting "Turn off hard disk after" (at "Power Options" > "Change advanced power settings") to "0" (minutes), to disable this feature.

This also seems related to the fact that the problem typically only occurred after a while of not using the running VM (which then gave Windows enough time to run into this setting and to try turn off/on the "disk" (actually an SSD in the host system)).

| improve this answer | |
1

I had similar issue on Ubuntu 18.04 on Dell XPS 15 9670 and TB16 docking station (temporary freezes (1-5 s) regularly, starting Win10 cause reproducible crashes). Since the actions below all problems are gone:

  • Upgrade to Workstation 15.5.5
  • Disconnect docking station and USB devices: There seem to be quite a number of issues in the Linux USB subsystem due to bad industry specs etc. (Greg KH answered to my post in https://www.spinics.net/lists/linux-usb/msg182825.html). An older Dell D3100 docking station reproducibly crashed the Linux kernel. Try without docking station and USB devices before doing any of the other points further below.
  • Reduce "swappyness" of Ubuntu (temporarily): sysctl -w vm.swappiness=10
  • Disable hugepage as above (temporarily): echo never > /sys/kernel/mm/transparent_hugepage/defrag; echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/defrag; echo never > /sys/kernel/mm/transparent_hugepage/enabled
  • Reduce the memory of guest VMs to 3GB
  • Reserve 8G RAM for the host OS as above
  • Disable 3D accelleration in Gnome and in the VM settings.
  • Use Wayland, so instead of complete freeze (reboot) you will get a new login screen (Wayland restart?)

I'm still not sure which of these really nailed it, but now I'm fine at last.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.