Skip to content

Latest commit

 

History

History
200 lines (149 loc) · 5.7 KB

File metadata and controls

200 lines (149 loc) · 5.7 KB

VMware Kernel 6.18 Compatibility Patches ⚡

License Kernel VMware

Complete fix for VMware Workstation 17.6.4 on Linux kernel 6.18

🎯 What This Fixes

This patch set adds full support for Linux kernel 6.18 to VMware Workstation 17.6.4 kernel modules (vmmon and vmnet).

Key Issues Resolved

  • Timer API changes: del_timer_sync()timer_delete_sync() (kernel 6.16+)
  • MSR API changes: rdmsrl_safe()rdmsrq_safe()
  • UACCESS validation: Fixed csum_partial_copy_nocheck()unsafe_copy_to_user()
  • Missing headers: Created driver-config.h and vm_basic_defs.h
  • Build system: Fixed objtool validation and kernel 6.18 build requirements
  • Debug infrastructure: Added VMX86_DEBUG support and missing variables

📋 Requirements

  • Linux kernel 6.18.x
  • VMware Workstation 17.6.4
  • GCC compiler
  • Linux kernel headers for your kernel version
  • Root/sudo access for module installation

🚀 Quick Install

Option 1: Automated Installation (Recommended)

# Clone this repository
git clone https://github.com/RepairYourTech/vmware-vmmon-vmnet-linux-6.18.git
cd vmware-vmmon-vmnet-linux-6.18

# Build and install both modules
make -C vmmon-only
sudo make -C vmmon-only install

make -C vmnet-only
sudo make -C vmnet-only install

# Load modules
sudo modprobe vmmon
sudo modprobe vmnet

Option 2: Manual Installation

# Extract VMware module sources
tar -xf /usr/lib/vmware/modules/source/vmmon.tar
tar -xf /usr/lib/vmware/modules/source/vmnet.tar

# Copy patched files
cp -r vmmon-only/* vmmon-only/
cp -r vmnet-only/* vmnet-only/

# Build
cd vmmon-only
make
sudo make install

cd ../vmnet-only
make
sudo make install

# Load modules
sudo modprobe vmmon
sudo modprobe vmnet

🔧 Technical Details

vmmon Module Changes

New Files

  • driver-config.h: Kernel version macros and configuration
  • include/vm_basic_defs.h: Missing type definitions and macros
    • MASK64/MASK32/PAGE_MASK macros
    • CONC/CONC3 token concatenation
    • Value extraction macros (LODWORD, HIDWORD, etc.)
    • Memory unit conversions (MBYTES_2_PAGES, GBYTES_2_PAGES)
    • DEBUG_ONLY, IMPLIES, VM_PAGE_BASE macros
    • Global debug variables (vmx86_debug, vmx86_log, vmx86_server)

Modified Files

  • linux/hostif.c:
    • del_timer_sync()timer_delete_sync()
    • rdmsrl_safe()rdmsrq_safe()
  • linux/driver.c: Added debug variable definitions
  • include/x86vtinstr.h: Added debug variable extern declarations
  • Makefile.kernel: Added -DVMX86_DEBUG and disabled objtool validation

vmnet Module Changes

Modified Files

  • userif.c:
    • Added kernel 6.18 support path to VNetCsumAndCopyToUser()
    • Replaced csum_partial_copy_nocheck() with unsafe_copy_to_user()
    • Fixed UACCESS validation by computing checksum outside user access block

🧪 Tested Configurations

Distribution Kernel Version Status
Ubuntu 26.04 (dev) 6.18.0-9-generic ✅ Working
VMware Workstation 17.6.4 ✅ Compatible

📁 Project Structure

.
├── vmmon-only/              # vmmon module source
│   ├── driver-config.h      # NEW: Kernel config
│   ├── include/
│   │   └── vm_basic_defs.h  # NEW: Type definitions
│   ├── linux/
│   │   ├── hostif.c         # MODIFIED: API updates
│   │   └── driver.c         # MODIFIED: Debug vars
│   └── Makefile.kernel      # MODIFIED: Build flags
└── vmnet-only/              # vmnet module source
    └── userif.c             # MODIFIED: UACCESS fix

🔍 Troubleshooting

Modules won't load

# Check kernel log
dmesg | tail -20

# Verify module signatures
modinfo /lib/modules/$(uname -r)/misc/vmmon.ko
modinfo /lib/modules/$(uname -r)/misc/vmnet.ko

Compilation errors

# Ensure you have kernel headers installed
sudo apt install linux-headers-$(uname -r)

# Check GCC version
gcc --version

VMware still shows errors

# Unload and reload modules
sudo modprobe -r vmnet vmmon
sudo modprobe vmmon vmnet

# Restart VMware services
sudo systemctl restart vmware

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

📜 License

This project is licensed under GPL v2, matching the Linux kernel license and VMware's open-source components.

🙏 Acknowledgments

⚠️ Disclaimer

These patches are provided as-is. While they have been tested on Ubuntu 26.04 with kernel 6.18.0-9-generic, your mileage may vary. Always backup your system before installing kernel modules.

📊 Changelog

v1.0.0 (2025-01-23)

  • Initial release for kernel 6.18
  • Full vmmon and vmnet module support
  • All API compatibility issues resolved
  • Successfully tested on Ubuntu 26.04

🔗 Links


Made with ❤️ for the Linux and VMware community