Monday, November 4, 2024

Workaround For VMWare Fusion Network Stack Seizure

About two weeks ago after a big Microsoft 11 update, VMWare Fusion 13 on MacOS Ventura (13.7) network stack started randomly seizing.   From within the Windows 11 VM guest OS, you could not ping or otherwise connect to any outside network addresses or hosts.  Initially, the only way to resolve was to reboot the Windows 11 VM guest OS. Whenever this issue occurred, thousands of the following error were added to the vmware.log file:

vmx VMXNET3 hosted: Cannot retrieve the buffer descriptors per rx packet.

After researching extensively, I learned that the issue could be remediated by restarting the VM network stack rather than rebooting the Windows 11 VM guest OS.

I wrote the following script to periodically check the status of the VM network stack.  If any of the network stack services changed from "running" to "not running", I restarted the stack.  This seems to be working for now as a workaround until VMWare resolves the issue.

#!/bin/bash
# Restart the network stack if for some reason that it stops
while true
do
   cknet=$(sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --status 2>&1 |egrep -v "Some|disabled"|grep "not running")
   if [ -n "${cknet}" ]
   then
      sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --stop
      sudo /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli --start
   fi
   sleep 120
done


The runtime user of this script will need to add the following for un-prompted use of sudo where you replace <user> with your runtime username:

<user> ALL = (ALL) NOPASSWD: /Applications/VMware\ Fusion.app/Contents/Library/vmnet-cli

Hope this helps others if they encounter the same.

Blessings

Brad

No comments: