VMware Communities
rgadsdon
Enthusiast
Enthusiast
Jump to solution

Linux Kernel 6.5-rc - vmmon compile fails..

Tested with VMware 2023 tech preview:
.................................

CC [M] /home/rgadsdon/kernel/vmmon-only/bootstrap/monLoaderVmmon.o
CC [M] /home/rgadsdon/kernel/vmmon-only/bootstrap/vmmblob.o
LD [M] /home/rgadsdon/kernel/vmmon-only/vmmon.o
/home/rgadsdon/kernel/vmmon-only/vmmon.o: warning: objtool: CrossPage_CodePage+0x207: 'naked' return found in RETHUNK build
MODPOST /home/rgadsdon/kernel/vmmon-only/Module.symvers
ERROR: modpost: "__pte_offset_map" [/home/rgadsdon/kernel/vmmon-only/vmmon.ko] undefined!
make[3]: *** [scripts/Makefile.modpost:144: /home/rgadsdon/kernel/vmmon-only/Module.symvers] Error 1
make[2]: *** [/usr/src/kernels/6.5.0-0.rc1.11.fc39.x86_64/Makefile:1990: modpost] Error 2
make[1]: *** [Makefile:246: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/kernels/6.5.0-0.rc1.11.fc39.x86_64'
make: *** [Makefile:117: vmmon.ko] Error 2

Labels (3)
1 Solution

Accepted Solutions
comphilip
Contributor
Contributor
Jump to solution

Open vmmon-only/include/pgtbl.h and replace pte_offset_map to pte_offset_kernel

View solution in original post

14 Replies
comphilip
Contributor
Contributor
Jump to solution

Open vmmon-only/include/pgtbl.h and replace pte_offset_map to pte_offset_kernel

rgadsdon
Enthusiast
Enthusiast
Jump to solution

Applied this, and vmmon now compiles OK with Kernel 6.5 (and 6.6-rc1).    This is also a solution for version 17.0.2..

Thank you.

RG.

Reply
0 Kudos
jparanoid
Contributor
Contributor
Jump to solution

amazing!, i applied this and everything works fine!! Thx

 

Reply
0 Kudos
Patan_cl
Contributor
Contributor
Jump to solution

Thanks! You can also download and replace the original modules from https://github.com/mkubecek/vmware-host-modules/blob/tmp/workstation-17.0.2-k6.5/INSTALL

Reply
0 Kudos
andreaplanet
Enthusiast
Enthusiast
Jump to solution

Here the steps for a lazy fix for kernel 6.5.5 and VMWare 17.0.2 as described here for the kernel 6.4:

 

 

# Cd to the dir where the vmware modules are.
cd /usr/lib/vmware/modules/source
# Unpack vmmon.
tar -xvf vmmon.tar
# Fix by replacing replace pte_offset_map with pte_offset_kernel	
sed -i 's/pte_offset_map/pte_offset_kernel/g' vmmon-only/include/pgtbl.h
# Backup original vmmon.tar
mv vmmon.tar vmmon.tar.original
# Pack the patched vmmon.
tar -cf vmmon.tar vmmon-only

 

 

Then recompile

 

vmware-modconfig --console --install-all

 

felicityspyder
Contributor
Contributor
Jump to solution

VMware now works after updating kernel to 6.5.4 on Pop!_OS. Thank you! 

Reply
0 Kudos
AndreD
Enthusiast
Enthusiast
Jump to solution

Unfortunately, even with this fix, with 6.5.0-9 kernel I get:

 

/tmp/modconfig-cRIzDl/vmnet-only/bridge.c:1413:11: error: implicit declaration of function ‘skb_gso_segment’; did you mean ‘tcp_gso_segment’? [-Werror=implicit-function-declaration]
1413 | segs = skb_gso_segment(skb, 0);

 

Sadly, there are small open source projects that are better at upgrading kernel modules in a timely fashion than VMWare.  This mess happens now and then, and Vmware does not seem to care/learn, or provide a simple fix.

andreaplanet
Enthusiast
Enthusiast
Jump to solution

You need also the patch for Kernel 6.4:

# Cd to te dir where the vmware modules are.
cd /usr/lib/vmware/modules/source
# Unpack vmnet.
tar -xvf vmnet.tar
# Add the missing include (code is just there now)
sed -i '46 a#include <net/gso.h>' vmnet-only/bridge.c
# Backup original vmnet.tar
mv vmnet.tar vmnet.tar.original
# Pack the patched vmnet.
tar -cf vmnet.tar vmnet-only
AndreD
Enthusiast
Enthusiast
Jump to solution

Thank you, at first glance, I thought those were the same - just referring to some other post.

Reply
0 Kudos
bithack3r
Contributor
Contributor
Jump to solution

sudo vmware-modconfig --console --install-all
[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-qiW8D9/vmmon-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/6.5.0-9-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-6.5.0-9-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
You are using: gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/linux/driver.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/linux/driverLog.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/linux/hostif.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/apic.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/comport.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/cpuid.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/crosspage.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/memtrack.o
/tmp/modconfig-qiW8D9/vmmon-only/common/crosspage.o: warning: objtool: CrossPage_CodePage+0x207: 'naked' return found in RETHUNK build
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/moduleloop.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/phystrack.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/sharedAreaVmmon.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/statVarsVmmon.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/task.o
In file included from /tmp/modconfig-qiW8D9/vmmon-only/./include/cpu_types.h:29,
from /tmp/modconfig-qiW8D9/vmmon-only/./include/modulecall.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/common/moduleloop.c:33:
/tmp/modconfig-qiW8D9/vmmon-only/./include/vm_basic_defs.h:779: warning: "DO_ONCE" redefined
779 | #define DO_ONCE(code) \
|
In file included from ./include/linux/prandom.h:12,
from ./include/linux/random.h:153,
from ./include/linux/nodemask.h:97,
from ./include/linux/sched.h:23,
from /tmp/modconfig-qiW8D9/vmmon-only/common/moduleloop.c:31:
./include/linux/once.h:46: note: this is the location of the previous definition
46 | #define DO_ONCE(func, ...) \
|
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/common/vmx86.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/bootstrap/bootstrap.o
/tmp/modconfig-qiW8D9/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Add() falls through to next function PhysTrack_Remove()
/tmp/modconfig-qiW8D9/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Remove() falls through to next function PhysTrack_Test()
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/bootstrap/monLoader.o
In file included from /tmp/modconfig-qiW8D9/vmmon-only/./include/cpu_types.h:29,
from /tmp/modconfig-qiW8D9/vmmon-only/./include/modulecall.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/linux/hostif.c:58:
/tmp/modconfig-qiW8D9/vmmon-only/./include/vm_basic_defs.h:779: warning: "DO_ONCE" redefined
779 | #define DO_ONCE(code) \
|
In file included from ./include/linux/prandom.h:12,
from ./include/linux/random.h:153,
from ./include/linux/nodemask.h:97,
from ./include/linux/sched.h:23,
from ./include/linux/binfmts.h:5,
from /tmp/modconfig-qiW8D9/vmmon-only/linux/hostif.c:31:
./include/linux/once.h:46: note: this is the location of the previous definition
46 | #define DO_ONCE(func, ...) \
|
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/bootstrap/monLoaderVmmon.o
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/bootstrap/vmmblob.o
/tmp/modconfig-qiW8D9/vmmon-only/bootstrap/monLoader.c: In function ‘MonLoader_Process’:
In file included from /tmp/modconfig-qiW8D9/vmmon-only/./include/cpu_types.h:29,
from /tmp/modconfig-qiW8D9/vmmon-only/./include/modulecall.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/./common/vmx86.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/linux/driver.h:32,
from /tmp/modconfig-qiW8D9/vmmon-only/linux/driver.c:47:
/tmp/modconfig-qiW8D9/vmmon-only/./include/vm_basic_defs.h:779: warning: "DO_ONCE" redefined
779 | #define DO_ONCE(code) \
|
In file included from ./include/linux/prandom.h:12,
from ./include/linux/random.h:153,
from ./include/linux/nodemask.h:97,
from ./include/linux/list_lru.h:12,
from ./include/linux/fs.h:13,
from ./include/linux/highmem.h:5,
from /tmp/modconfig-qiW8D9/vmmon-only/linux/driver.c:25:
./include/linux/once.h:46: note: this is the location of the previous definition
46 | #define DO_ONCE(func, ...) \
|
/tmp/modconfig-qiW8D9/vmmon-only/bootstrap/monLoader.c:794:24: warning: the comparison will always evaluate as ‘false’ for the address of ‘entries’ will never be NULL [-Waddress]
794 | if (header->entries == 0 || header->count == 0) {
| ^~
In file included from /tmp/modconfig-qiW8D9/vmmon-only/bootstrap/monLoader.c:57:
/tmp/modconfig-qiW8D9/vmmon-only/./include/monLoader.h:239:19: note: ‘entries’ declared here
239 | MonLoaderEntry entries[];
| ^~~~~~~
In file included from /tmp/modconfig-qiW8D9/vmmon-only/./include/cpu_types.h:29,
from /tmp/modconfig-qiW8D9/vmmon-only/./include/modulecall.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/common/vmx86.h:33,
from /tmp/modconfig-qiW8D9/vmmon-only/common/vmx86.c:38:
/tmp/modconfig-qiW8D9/vmmon-only/./include/vm_basic_defs.h:779: warning: "DO_ONCE" redefined
779 | #define DO_ONCE(code) \
|
In file included from ./include/linux/prandom.h:12,
from ./include/linux/random.h:153,
from ./include/linux/nodemask.h:97,
from ./include/linux/sched.h:23,
from /tmp/modconfig-qiW8D9/vmmon-only/common/vmx86.c:31:
./include/linux/once.h:46: note: this is the location of the previous definition
46 | #define DO_ONCE(func, ...) \
|
/tmp/modconfig-qiW8D9/vmmon-only/common/task.o: warning: objtool: .text: unexpected end of section
LD [M] /tmp/modconfig-qiW8D9/vmmon-only/vmmon.o
MODPOST /tmp/modconfig-qiW8D9/vmmon-only/Module.symvers
CC [M] /tmp/modconfig-qiW8D9/vmmon-only/vmmon.mod.o
LD [M] /tmp/modconfig-qiW8D9/vmmon-only/vmmon.ko
BTF [M] /tmp/modconfig-qiW8D9/vmmon-only/vmmon.ko
Skipping BTF generation for /tmp/modconfig-qiW8D9/vmmon-only/vmmon.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.5.0-9-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-qiW8D9/vmmon-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-qiW8D9/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory '/tmp/modconfig-qiW8D9/vmmon-only'
make: Entering directory '/tmp/modconfig-qiW8D9/vmnet-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/6.5.0-9-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-6.5.0-9-generic'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: x86_64-linux-gnu-gcc-13 (Ubuntu 13.2.0-4ubuntu3) 13.2.0
You are using: gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/driver.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/hub.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/userif.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/netif.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/bridge.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/procfs.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/smac_compat.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/smac.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/vnetEvent.o
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/vnetUserListener.o
/tmp/modconfig-qiW8D9/vmnet-only/userif.o: warning: objtool: VNetCsumAndCopyToUser+0x2d: call to csum_partial_copy_nocheck() with UACCESS enabled
LD [M] /tmp/modconfig-qiW8D9/vmnet-only/vmnet.o
MODPOST /tmp/modconfig-qiW8D9/vmnet-only/Module.symvers
CC [M] /tmp/modconfig-qiW8D9/vmnet-only/vmnet.mod.o
LD [M] /tmp/modconfig-qiW8D9/vmnet-only/vmnet.ko
BTF [M] /tmp/modconfig-qiW8D9/vmnet-only/vmnet.ko
Skipping BTF generation for /tmp/modconfig-qiW8D9/vmnet-only/vmnet.ko due to unavailability of vmlinux
make[1]: Leaving directory '/usr/src/linux-headers-6.5.0-9-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-qiW8D9/vmnet-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-qiW8D9/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory '/tmp/modconfig-qiW8D9/vmnet-only'
Starting VMware services:
Virtual machine monitor failed
Virtual machine communication interface done
VM communication interface socket family done
Virtual ethernet failed
VMware Authentication Daemon done
Unable to start services

I've followed your steps but it still doesn't work. I'm on Ubuntu 23.10.

 

andreaplanet
Enthusiast
Enthusiast
Jump to solution

In your case the error is "Skipping BTF generation xxx. due to unavailability of vmlinux". If you search for that error you find some answers. In the meantime 17.5 is out so you may try that too.

punit_arya
Contributor
Contributor
Jump to solution

Thank you!  Installing the latest version fixed the issue instead of having to compile (which just wasn't working).

cd_kagaya
Contributor
Contributor
Jump to solution

It works.
Operating System: Ubuntu 22.04.3 LTS                 
         Kernel: Linux 6.5.0-14-generic

 

Many thanks!!!

ehummel1970
Contributor
Contributor
Jump to solution

Thank you!!!

Ubuntu 22.04.3 LTS

Linux ubuntu 6.5.0-15-generic #15~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Jan 12 18:54:30 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

17.0.2 build-21581411

Reply
0 Kudos