Skip to content

About

patch for VMware workstation pro 17.6.4 kernel module build failure on Linux kernel 7.0.x. Fixes 6 broken/removed kernel APIs. Tested on Ubuntu 26.04 LTS

Resources

Stars

4 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

VMware Workstation 17.6.4 — Kernel 7.0 Patch

A shell script that patches and rebuilds VMware Workstation Pro's kernel modules (vmmon and vmnet) for Linux kernel 7.0.x, where the official build fails due to multiple removed or renamed kernel APIs.


Background

VMware Workstation ships its kernel modules (vmmon, vmnet) as source tarballs and compiles them against your running kernel at install time. This works reliably on kernels up to ~6.14. On kernel 7.0, the build fails immediately because several internal Linux APIs that VMware's source depends on were renamed or removed during the 6.x → 7.0 transition.

This patch was developed and tested on Ubuntu 26.04 LTS (Resolute) with kernel 7.0.0-15-generic, by manually tracing each compiler error to its root cause and applying the minimal correct fix.


What This Patch Fixes

1. driver-config.h: No such file or directory

Root cause: VMware's Makefile.kernel sets compiler include flags using the EXTRA_CFLAGS variable. Modern Linux kernels (5.0+) replaced EXTRA_CFLAGS with ccflags-y for out-of-tree module builds. The kernel build system silently ignores EXTRA_CFLAGS, so the -I paths pointing to VMware's own header directory never reach the compiler.

Fix: Replace EXTRA_CFLAGS with ccflags-y in Makefile.kernel for both vmmon and vmnet. Additionally, hardcode absolute paths into the INCLUDE variable because $(SRCROOT) resolves incorrectly when the kernel build system changes working directories internally.


2. del_timer_sync undeclared

Root cause: del_timer_sync() was renamed to timer_delete_sync() in kernel 6.15 (commit 97a32539b956) as part of a broader timer API cleanup to align naming with other subsystems.

Affected files: vmmon-only/linux/hostif.c, vmmon-only/linux/driver.c

Fix: s/del_timer_sync/timer_delete_sync/g


3. rdmsrl_safe undeclared

Root cause: rdmsrl_safe() was renamed to rdmsrq_safe() in kernel 7.0 as part of the x86 MSR (Model Specific Register) API cleanup. The l suffix (for "long") was replaced with q (for "quad") to be consistent with other low-level x86 accessors.

Affected files: vmmon-only/linux/hostif.c

Fix: s/rdmsrl_safe/rdmsrq_safe/g


4. pgd_large / p4d_large / pud_large / pmd_large undeclared

Root cause: These page table inspection functions were renamed to their *_leaf equivalents in kernel 6.x. The renaming reflects more accurate semantics: a "large page" mapping is technically a "leaf" node in the page table tree, not merely a "large" entry.

Affected files: vmmon-only/include/pgtbl.h, vmmon-only/include/compat_pgtable.h

Fix:

pgd_large        → pgd_leaf
p4d_large        → p4d_leaf
pud_large        → pud_leaf
pmd_large        → pmd_leaf
compat_p4d_large → compat_p4d_leaf

5. dev_base_lock undeclared

Root cause: dev_base_lock was a global rwlock_t used to protect the kernel's network device list. It was removed in kernel 6.x in favour of the RTNL (Routing Netlink) lock, which provides equivalent serialisation for network device list operations.

Affected files: vmnet-only/vmnetInt.h

Fix:

read_lock(&dev_base_lock)   → rtnl_lock()
read_unlock(&dev_base_lock) → rtnl_unlock()

6. random_get_entropy_fallback undeclared (kernel header bug)

Root cause: This is a bug in Ubuntu 26.04's linux-headers-7.0.0 package. The shipped arch/x86/include/asm/timex.h references random_get_entropy_fallback(), which was removed from the kernel. The function body is only reachable on x86 systems without a TSC (very rare hardware), so stubbing it to return 0 has no practical effect on normal systems.

Affected file: /usr/src/linux-headers-7.0.0-*/arch/x86/include/asm/timex.h

Fix: Replace the unreachable call with return 0.


Requirements

  • VMware Workstation Pro 17.6.4 already installed
  • Linux kernel 7.0.x
  • Kernel headers installed: sudo apt install linux-headers-$(uname -r)
  • Build tools: sudo apt install build-essential
  • Root access

Usage

# Clone the repo
git clone https://github.com/caleb173/vmware-kernel7-patch.git
cd vmware-kernel7-patch

# Make executable
chmod +x patch-vmware-kernel7.sh

# Run as root
sudo bash patch-vmware-kernel7.sh

The script will:

  1. Back up the original VMware module tarballs to a timestamped directory under /usr/lib/vmware/modules/source/
  2. Extract and patch vmmon and vmnet sources
  3. Patch the broken kernel header (timex.h) if needed
  4. Build both modules against your running kernel
  5. Install the compiled .ko files to /lib/modules/$(uname -r)/updates/
  6. Repack the patched sources back into VMware's tarball directory
  7. Run depmod, load the modules, and start VMware services

Then launch VMware with:

vmware

Tested Environment

Component Version
Host OS Ubuntu 26.04 LTS (Resolute)
Kernel 7.0.0-15-generic
VMware Workstation Pro 17.6.4 (build-24832109)
CPU Intel Core i5-2450M (Sandy Bridge)
GCC 15.2.0

Compatibility Notes

  • This patch targets kernel 7.0.x specifically. For kernels 6.15–6.19, the dev_base_lock and ccflags-y fixes still apply, but rdmsrl_safe and the *_large → *_leaf renames may not be needed depending on your exact kernel version.
  • The timex.h fix is specific to Ubuntu 26.04's packaged headers and may not be needed on other distributions.
  • VMware Workstation 26H1 (the calendar-versioned successor to 17.6.4) may or may not need these patches — it was released too recently to have community-verified kernel 7.0 support at time of writing.

If the Build Still Fails

Run the script with bash -x for verbose output:

sudo bash -x patch-vmware-kernel7.sh 2>&1 | tee patch.log

Then open an issue and attach patch.log.


Reverting

The script backs up your original tarballs automatically. To revert:

BACKUP=$(ls /usr/lib/vmware/modules/source/ | grep backup | tail -1)
sudo cp /usr/lib/vmware/modules/source/$BACKUP/vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar
sudo cp /usr/lib/vmware/modules/source/$BACKUP/vmnet.tar /usr/lib/vmware/modules/source/vmnet.tar
sudo vmware-modconfig --console --install-all

License

MIT — do whatever you want with it. Attribution appreciated but not required.


Credits

Patch developed by tracing compiler errors manually on a live Ubuntu 26.04 + kernel 7.0.0 system. Referenced kernel changelogs, Linux git history, and the mkubecek/vmware-host-modules project for prior art on older kernel patches. Assisted by Claude (Anthropic) — AI pair programming throughout the debugging and patching session.

About

patch for VMware workstation pro 17.6.4 kernel module build failure on Linux kernel 7.0.x. Fixes 6 broken/removed kernel APIs. Tested on Ubuntu 26.04 LTS

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages