Compiler mis-match when compiling vmmon and vmnet for VMWare after 25.10 upgrade

Background:
I have a Win11Pro VMWare virtual machine for work that I open with VMware-Workstation-Full-17.6.2-24409262.x86_64.bundle, and need VMWare’s vmmon and vmnet modules to be signed.

Ubuntu Version:
25.10

Problem Description:
After upgrading to Ubuntu 25.10, this no longer works because there is a mismatch of the compilers. They look quite similar, but not identical:

Relevant System Information:

vox@vox-Legion-7-16ARHA7:~$ sudo vmware-modconfig --console --install-all
[sudo: authenticate] Password: 
[AppLoader] Use shipped Linux kernel AIO access library.
An up-to-date "libaio" or "libaio1" package from your system is preferred.
[AppLoader] GLib does not have GSettings support.
Stopping VMware services:
   VMware Authentication Daemon                                        done
   Virtual machine monitor                                             done
make: Entering directory '/tmp/modconfig-bssP4h/vmmon-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/6.17.0-7-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-6.17.0-7-generic'
make[2]: Entering directory '/tmp/modconfig-bssP4h/vmmon-only'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
You are using:           gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0**
  CC [M]  linux/driver.o
  CC [M]  linux/driverLog.o
  CC [M]  linux/hostif.o
  CC [M]  common/apic.o
  CC [M]  common/comport.o
  CC [M]  common/cpuid.o
  CC [M]  common/crosspage.o
  CC [M]  common/memtrack.o
  CC [M]  common/moduleloop.o
  CC [M]  common/phystrack.o
  CC [M]  common/sharedAreaVmmon.o
common/apic.c:20:10: fatal error: vm_basic_defs.h: No such file or directory
   20 | #include "vm_basic_defs.h"
      |          ^~~~~~~~~~~~~~~~~
**compilation terminated.**

(followed by lots of other, similar, fatal errors)

These are the commands I would usually execute to make everything work again:

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"
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)
sudo mokutil --import MOK.der
<reboot, import key at boot prompt, reboot>

System info:

vox@vox-Legion-7-16ARHA7:~$ uname -a; gcc --version; apt-cache policy linux-image-generic; free -h; df -h /
Linux vox-Legion-7-16ARHA7 6.17.0-7-generic #7-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 18 10:10:29 UTC 2025 x86_64 GNU/Linux
gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0
Copyright (C) 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

linux-image-generic:
  Installed: 6.17.0-7.7
  Candidate: 6.17.0-7.7
  Version table:
 *** 6.17.0-7.7 500
        500 http://archive.ubuntu.com/ubuntu questing-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu questing-security/main amd64 Packages
        100 /var/lib/dpkg/status
     6.17.0-5.5 500
        500 http://archive.ubuntu.com/ubuntu questing/main amd64 Packages
               total        used        free      shared  buff/cache   available
Mem:            14Gi       3.6Gi       8.1Gi        86Mi       2.2Gi        10Gi
Swap:          4.0Gi          0B       4.0Gi
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p2  937G  366G  524G  42% /

Can I force using “x86_64-linux-gnu-gcc (Ubuntu 15.2.0-4ubuntu4) 15.2.0”, or is there a more elegant solution out there.

This question has similarities with “Unable to upgrade kernel, dpkg exiting with error on tp_sampi for Thinkpad” - but I don’t think [stochastic]'s solution would help me. Unable to upgrade kernel, dpkg exiting with error on tp_sampi for Thinkpad

Any help would be greatly appreciated,

Cheers, Vox

Your problem lies here:

common/apic.c:20:10: fatal error: vm_basic_defs.h: No such file or directory
  20 | #include "vm_basic_defs.h"
     |          ^~~~~~~~~~~~~~~~~

Looking for that header file in the Ubuntu repositories:

$ apt-file search vm_basic_defs.h

(no response)

It seems as though you need a header file that is not included in the Ubuntu repositories. This has nothing to do with a compiler mismatch.

VMWare isn’t included in the Ubuntu repositories, so it’s not really something we can support. My best guess is that vm_basic_defs.h is included in VMWare’s development files somewhere, but that’s outside of the scope of the Ubuntu Discourse.

You need to uninstall VMware from your system and reinstall fresh from the bundle. That will recompile the source code and binaries that are inside the bundle and make it usable in your system with the updated GCC libraries in the system.

Cheers, eeickmeyer. I understand. I am new to Ubuntu Discourse as of today, and admit struggling to make sense of it, and your scope.

I would normally find answers on Community support | Ubuntu (but that gives “502 Bad Gateway” when I click the log-in button) for anything that needs compiling. USB wifi/Bluetooth/sound cards etc. Failing that, https://stackoverflow.com/ usually had something. Nothing on there at all.

I might go back to 25.04 and start again. Thanks for replying,

Vox

Actually, it is a compiler mismatch problem. Those are compiled during the installation process for the drivers, etc. in the bundle, and if you did an update on the system you have to uninstall and reinstall VMware Workstation and its components.

Ah. Yeah, I’m no expert on that and am not familiar with VMWare. I just know missing files when I see them.

Ah, thank you teward.

I have backups of everything - but reinstalling just takes time, you know?

We will reinstall VMware Workstation and its components in the morning.

Thanks to both eeickmeyer and teward.

Cheers,
Vox

Yeah, but fortunately uninstalling VMware won’t delete the other data in your system. VMware Workstation installation is pretty quick and painless compared to a full system install.

Sorted! I eventually found this on Reddit empowered by teward’s comments: https://www.reddit.com/r/Ubuntu/comments/1o54w7v/comment/njbjec0/

wget https://github.com/philipl/vmware-host-modules/archive/refs/heads/workstation-17.6.3.zip

7z x [workstation-17.6.3.zip](http://workstation-17.6.3.zip) && cd vmware-host-modules-workstation-17.6.3

(the 2nd line above failed as I didn’t have 7z, but the error message was clear, and I installed it without problem). Then I did this:

tar -cf vmmon.tar vmmon-only && tar -cf vmnet.tar vmnet-only

sudo cp -v vmmon.tar vmnet.tar /usr/lib/vmware/modules/source/

sudo vmware-modconfig --console --install-all

All good, we have work-related Win11Pro VMWare with bitlocker and whatever MS are throwing at us. I know the password, and it worked.

Cheers,
Vox

This topic was automatically closed after 30 days. New replies are no longer allowed.