VMware Communities
djbarrett
Enthusiast
Enthusiast

Regression in 16.1.0: vmware-modconfig now required after Linux kernel update

Since updating to VMware Workstation Pro 16 (Ubuntu 18.04.5 LTS host), the Workstation GUI refuses to launch any VMs after any Linux kernel update. The GUI displays a dialog "Cannot open /dev/vmmon: No such file or directory." To make the software work again, I have to run:

$ vmware-modconfig --console --install-all

I remember having to run this command for ancient versions of VMware Workstation Pro (circa 2014), but not in the past few years and definitely not in Workstation 15.

Secure boot is not enabled.

Regression? Bug? Misconfiguration on my part?

I'm currently running Workstation Pro 16.1.0 build-17198959.

0 Kudos
1 Reply
djbarrett
Enthusiast
Enthusiast

I have not found a solution, so I wrote a script to invoke vmware-modconfig on boot if the kernel version has changed. I call it from /etc/rc.local. Feel free to steal it.

#!/bin/bash

PROG=$(/usr/bin/basename $0)

# Directory containing kernel version file
DIR=/usr/local/etc/vmware

# File containing version of kernel from previous boot
KERNEL_VERSION_FILE="${DIR}/previous"

# Make sure required directory exists
[ -d "${DIR}" ] || /bin/mkdir -p "${DIR}"
if [ $? -ne 0 ]
then
  /usr/bin/logger "${PROG}: failed to find/create '${DIR}'"
  exit 1
fi

# Make sure required kernel version file exists.
# If not, create one with a dummy value that will force a rebuild.
[ -f "${KERNEL_VERSION_FILE}" ] || echo dummy > "${KERNEL_VERSION_FILE}"
if [ $? -ne 0 ]
then
  /usr/bin/logger "${PROG}: failed to find/create '${KERNEL_VERSION_FILE}'"
  exit 1
fi

# Get current kernel version
CURRENT_KERNEL=$(/bin/uname -r)

# If same kernel version, exit
[ "${CURRENT_KERNEL}" = $(cat "${KERNEL_VERSION_FILE}") ] && exit 0

# If we got here, kernel versions differ.
# Rebuild vmware kernel module.
/usr/bin/logger "${PROG}: building vmware kernel module"
​/usr/bin/vmware-modconfig --console --install-all

# If all went well, update kernel version file
if [ $? -eq 0 ]
then
  echo "${CURRENT_KERNEL}" > "${KERNEL_VERSION_FILE}"
  /usr/bin/logger "${PROG}: finished building vmware kernel module"
else
  /usr/bin/logger "${PROG}: error: could not build vmware kernel module"
fi

0 Kudos