Adventures in Installation: VMware Workstation 17.5.2 on Ubuntu 24.04


As part of my continued efforts to upgrade to Ubuntu 24.04 I encountered an issue while installing VMware Workstation. Specifically, the kernel modules would not compile... I've encountered this issue before, and have had to apply out-of-band patches to address this issue. Those did not appear to work this time and I had to do some investigating.

References

Remediation

Due to Secure Boot, I was unable to apply the vmware-host-modules from mkubecek. After disabling Secure Boot, I am able to install and use them with my system purely in UEFI mode (secure boot disabled). While there is a path forward to sign/install the modules while leaving Secure Boot enabled, that isn't a very convenient option and my threat model doesn't require this step.

Steps:

  1. Disable Secure Boot via BIOS/Firmware
  2. Boot into Ubuntu 24.04
  3. mkdir -p tmp/vmware && cd tmp/vmware
  4. wget https://github.com/mkubecek/vmware-host-modules/archive/workstation-17.5.1.tar.gz
  5. tar -xzf workstation-17.5.1.tar.gz && cd vmware-host-modules-workstation-17.5.1
  6. tar -cf vmmon.tar vmmon-only && tar -cf vmnet.tar vmnet-only
  7. sudo cp -v vmmon.tar vmnet.tar /usr/lib/vmware/modules/source/
  8. sudo vmware-modconfig --console --install-all

After following these steps, I see that VMware services start successfully:

Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Virtual ethernet                                                    done
   VMware Authentication Daemon                                        done
   Shared Memory Available                                             done

A note on Secure Boot

If you require Secure Boot, there is a way for you to sign the kernel modules using your own key by following the process described here: VMWare Workstation Pro - vmmon not found

Extracted for clarity - warning, I haven't tried the steps... presenting for completeness:

  • Generate a key pair using the openssl to sign vmmon and vmnet modules:
$ sudo openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"

Replace MOK with the name of the file you want for the key.

  • Sign the modules using the generated key by running these commands:
$ sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmmon)
$ sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv ./MOK.der $(modinfo -n vmnet)
  • Import the public key to the system's MOK list by running this command:
$ sudo mokutil --import MOK.der
  • Confirm a password for this MOK enrollment request.
  • Reboot your machine and complete the enrollment from the UEFI console.