Sam Hooke

VMware Workstation VM gets sluggish then locks up

TL;DR: Following Windows update 22H2, Ubuntu (and other VMs) running inside VMware Workstation 16 get progressively slower, over the course of about 30 minutes, before eventually locking up. This can be fixed by making a small config change.

Update 2023-12-12: Added Fix 2, and marked it as the preferred solution, since Fix 1 prevents Docker from working.

Ubuntu locking up §

For well over a year I have been using Ubuntu inside VMware Workstation as my development environment. Last week the Ubuntu VM developed an issue whereby over the couse of perhaps 15 to 30 minutes, the VM would get more and more sluggish, before locking up completely, and eventually switching to a black screen with text similar to the following:

[ 2741.744153] INFO: task gmain:1456 blocked for more than 155 seconds.
[ 2741.744156]       Not tainted 5.15.0-57-generic #63-Ubuntu
[ 2741.744157] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2741.744243] INFO: task kworker/u256:0:5130 blocked for more than 155 seconds.
[ 2741.744244]       Not tainted 5.15.0-57-generic #63-Ubuntu
[ 2741.744244] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2998.743235] INFO: task close:24619 blocked for more than 155 seconds.
[ 2998.743257]       Not tainted 5.15.0-57-generic #63-Ubuntu
[ 2998.74326B] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.

This became very disruptive to my work flow because the only resolution was to power off the VM, and turn it back on again. Unfortunately searching online for issues regarding a “sluggish” Ubuntu VM or even searching for the error above yields many irrelevant results.

However, my suspicions were that a recent Windows update had triggered this issue, since the issue began after I applied the Windows 22H2 update, and I had not made any changes to the Ubuntu VM or to VMware Workstation. Modifying my search term to include the Windows update led me to find that others had indeed encountered the same issue:

The discussion reveals that the issue is not specific to Ubuntu, but seems to impact all Virtual Machines. Some users are able to “fix” the issue by uninstalling certain Windows updates, though this is not ideal, and if your machine is managed may not be possible.

Fortunately I found two fixes that work well for me.

Fix 1: Disable Windows Hypervisor Platform §

The fix, as detailed by boomshankerx, is to disable the Windows Hypervisor Platform. These were the steps I followed:

  1. Open Powershell as administrator.
  2. Run bcdedit /enum to view the current setting for hypervisorlaunchtype. Mine was set to Auto.
  3. Run bcdedit /set hypervisorlaunchtype off to set hypervisorlaunchtype to off.
  4. Open the “Turn Windows features on or off” window through Control Panel (or just type that phrase into the search bar).
  5. Disable Virtual Machine Platform, Windows Hypervisor Platform and Windows Subsystem for Linux.
Screenshot of the 'Turn Windows features on or off' window, with 'Virtual Machine Platform', 'Windows Hypervisor Platform' and 'Windows Subsystem for Linux' disabled.
Disable these features.
  1. It may then take a minute or so to apply changes:
Screenshot of the 'Turn Windows features on or off' window, with a progress bar saying 'Applying changes'
Applying changes...
  1. Then you will need to reboot, as prompted.

A shortcoming of this fix is that it requires disabling WSL (Windows Subsystem for Linux), which will be inconvenient if you use that feature for something else!

Verifying the fix §

If the fix is working, then the vmware.log should indicate that the “Monitor Mode” is CPL0, not ULM.

In VMware Workstation, right click on the VM and select “Open VM directory”. In that directory will be a vmware.log. Search for Monitor Mode and verify it is set to CPL0:

2023-01-09T19:01:33.638Z In(05) vmx Monitor Mode: CPL0

The VM should no longer get sluggish and lock up.

Fix 2: Config change §

A major shortcoming of Fix 1 is that it disables WSL. This is problematic if you want to run VMWare Workstation and Docker on the same machine, since WSL2 is the preferred Docker backend.

To avoid this shortcoming, an alternate fix identified on 2023-02-06 by anders_o is to make a small modification to the vmx file:

  1. Stop your VM.
  2. In VMWare Workstation, right-click on the machine and select “Open VM directory”.
  3. In the Explorer window that opens, find the *.vmx file and open it in a text editor.
  4. Very near the top should be a line that says something like virtualHW.version = "19". Change this to virtualHW.version = "10".

Ancecdotally, the VM feels a little less responsive following this change, but it does not lock up. Crucially, I can now use Docker and VMWare Workstation on the same machine. I’m curious what other impact downgrading the virtualHW.version has, but have not investigated.

Version information §

  • VM: Ubuntu 22.04
  • Host: Windows 10 Enterprise, 22H2
  • Hypervisor: VMware Workstation 16.2.5

See all notes.

← Previous Note: Hugo anchors next to headers
Next Note: Print a 64-bit integer using 32-bit integers →
← Previous Trip: Mount Peak
Next Trip: Annette Lake Sno-Park →