VMware Communities
jpierson78
Contributor
Contributor
Jump to solution

Debian Bullseye (testing) unable to compile kernel modules gcc version (null)

I run Debian testing on most of my systems.  I recently upgraded my laptop to the latest patches including Linux Kernel 5.8.0.1.  This broke VMware player 15.5.6 (run workstation pro on my main machine).  I've been waiting for VMWare 16 since.  Now that it's out it won't compile the kernel modules citing it can't find a compatible gcc, but gives a null on which one it is looking for.  I know player/workstation is only designed to work with Debian 10, but I'm more than happy to find a workaround assuming I can figure out what it needs.

1 Solution

Accepted Solutions
gdelcampo
Contributor
Contributor
Jump to solution

It seems to be more related to the kernel version rather than GCC and to the way vmware-modconfig (/usr/lib/vmware/bin/appLoader) retrieves information about Kernel GCC major version. I suspect the culprit is on extracting gcc version: note that from version gcc-10 we have 2 digit instead of 1 for the version number and in the logs we have  "GCC major version 10 does not match Kernel GCC major version 0." where 0 is the last digit of number 10.

Anyway, as user root you can manually compile the vmware host modules.

cd /usr/lib/vmware/modules/source

tar xvf vmnet.tar

cd vmnet-only

make

cd ..

tar xvf vmmon.tar

cd vmmon-only

make

cd ..

cp vmmon.o /lib/modules/`uname -r`/kernel/drivers/misc/vmmon.ko

cp vmnet.o /lib/modules/`uname -r`/kernel/drivers/misc/vmnet.ko

depmod -a

systemctl restart vmware.service

View solution in original post

16 Replies
hotvooboy
VMware Employee
VMware Employee
Jump to solution

Thank you for posting your query in community. We are investigating it. And what is your gcc version by gcc --version ?

Reply
0 Kudos
zwierbel
Enthusiast
Enthusiast
Jump to solution

I have the same problem.

2020-09-22T19:49:30.361+02:00| modconfig| I005: The header path "/lib/modules/5.8.0-2-amd64/build/include" for the kernel "5.8.0-2-amd64" is vali

d.  Whoohoo!

2020-09-22T19:49:30.486+02:00| modconfig| I005: found symbol version file /lib/modules/5.8.0-2-amd64/build/Module.symvers

2020-09-22T19:49:30.486+02:00| modconfig| I005: Reading symbol versions from /lib/modules/5.8.0-2-amd64/build/Module.symvers.

2020-09-22T19:49:30.500+02:00| modconfig| I005: Read 21597 symbol versions

2020-09-22T19:49:30.500+02:00| modconfig| I005: Reading in info for the vmmon module.

2020-09-22T19:49:30.500+02:00| modconfig| I005: Reading in info for the vmnet module.

2020-09-22T19:49:30.508+02:00| modconfig| I005: Trying to find a suitable PBM set for kernel "5.8.0-2-amd64".

2020-09-22T19:49:30.508+02:00| modconfig| I005: No matching PBM set was found for kernel "5.8.0-2-amd64".

2020-09-22T19:49:30.508+02:00| modconfig| I005: Found compiler at "/usr/bin/gcc"

2020-09-22T19:49:30.509+02:00| modconfig| I005: Got gcc version "9".

2020-09-22T19:49:30.509+02:00| modconfig| I005: GCC major version 9 does not match Kernel GCC major version 0.

2020-09-22T19:49:30.509+02:00| modconfig| I005: No usable gcc found.  Can't find a valid compiler despite our best efforts.

2020-09-22T19:49:30.511+02:00| modconfig| I005: We are now shutdown.  Ready to die!

# gcc --version
gcc (Debian 9.3.0-18) 9.3.0
Copyright (C) 2019 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.

# uname -a
Linux ivy 5.8.0-2-amd64 #1 SMP Debian 5.8.10-1 (2020-09-19) x86_64 GNU/Linux

# vmware --version
VMware Workstation 16.0.0 build-16894299

Also not working with gcc 10.

Any ideas? Is kernel under debian not compiled by gcc anymore?

Reply
0 Kudos
jpierson78
Contributor
Contributor
Jump to solution

gcc 10 is the main, but I've tried all 3 gcc versions installed.

$ gcc --version

gcc (Debian 10.2.0-7) 10.2.0

$ gcc-9 --version

gcc-9 (Debian 9.3.0-18) 9.3.0

$ gcc-8 --version

gcc-8 (Debian 8.4.0-4) 8.4.0

Probably add the kernel info

$ cat /proc/version

Linux version 5.8.0-1-amd64 (debian-kernel@lists.debian.org) (gcc-10 (Debian 10.2.0-6) 10.2.0, GNU ld (GNU Binutils for Debian) 2.35) #1 SMP Debian 5.8.7-1 (2020-09-05)

Reply
0 Kudos
gdelcampo
Contributor
Contributor
Jump to solution

It seems to be more related to the kernel version rather than GCC and to the way vmware-modconfig (/usr/lib/vmware/bin/appLoader) retrieves information about Kernel GCC major version. I suspect the culprit is on extracting gcc version: note that from version gcc-10 we have 2 digit instead of 1 for the version number and in the logs we have  "GCC major version 10 does not match Kernel GCC major version 0." where 0 is the last digit of number 10.

Anyway, as user root you can manually compile the vmware host modules.

cd /usr/lib/vmware/modules/source

tar xvf vmnet.tar

cd vmnet-only

make

cd ..

tar xvf vmmon.tar

cd vmmon-only

make

cd ..

cp vmmon.o /lib/modules/`uname -r`/kernel/drivers/misc/vmmon.ko

cp vmnet.o /lib/modules/`uname -r`/kernel/drivers/misc/vmnet.ko

depmod -a

systemctl restart vmware.service

jpierson78
Contributor
Contributor
Jump to solution

Thank you.  That did the trick and I suspect you may be right about the version number reaching double digits now.  Hopefully this will get patched soon, but the workaround is very easy to do.

Reply
0 Kudos
jpierson78
Contributor
Contributor
Jump to solution

Well now I don't seem to have any networking for my guest OS.  Attempted to update vmware-tools and it balked at that.  Problems downloading components.  Still checking the system though.

Reply
0 Kudos
jpierson78
Contributor
Contributor
Jump to solution

Turns out it's just the bridged networking that's broken, but I'm not sure how.  NAT networking works fine.

Reply
0 Kudos
jpierson78
Contributor
Contributor
Jump to solution

Finally figured it out.  In Bridged mode the settings seemed to have switched to auto-detect.  In this case I think it picks up the wired connection first which isn't currently in use.  If I switched the bridged to only use the wireless it works fine.  However bridged mode seems to cause my entire system to hang occasionally.  This has been happening during recent updates even in VMWare 15.x.  I can't replicate it reliably.  Sometimes opening a single webpage will hang it, other times downloading large files.  Interestingly enough, NAT mode never seems to hang.

At any rate your workaround works fine and there's still some quirks specific to my system that I need to work out.  Thanks again.

DefaultInternet
Contributor
Contributor
Jump to solution

thank you for this solution. even with the latest version of VMware workstation I'm having the same issue. 

Reply
0 Kudos
b0s0z0ku
Contributor
Contributor
Jump to solution

Hi gdelcampo,

As I get the same problem with gcc, I've tryied your solution but I get this error :

Using standalone build system.
In file included from geninclude.c:20:
compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory
   38 | #   include <generated/autoconf.h>
      |             ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
cc1: error: code model kernel does not support PIC mode
make: *** [<builtin>: driver.o] Error 1
john@XPS13:/usr/lib/vmware/modules/source/vmnet-only$ make
Using standalone build system.
In file included from geninclude.c:20:
compat_autoconf.h:38:13: fatal error: generated/autoconf.h: No such file or directory
   38 | #   include <generated/autoconf.h>
      |             ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
cc1: error: code model kernel does not support PIC mode
make: *** [<builtin>: driver.o] Error 1

 Despite the last time I've upgraded my system (1 month ago) everything went fine...

Any clues would be great.

Thanks for your help.

Regards

Reply
0 Kudos
b0s0z0ku
Contributor
Contributor
Jump to solution

I've found a solution, I was missing :

sudo apt install build-essential linux-headers-`uname -r`

 Everything is fine now.

Regards.

Reply
0 Kudos
sabennett
Enthusiast
Enthusiast
Jump to solution

Thank you.

This worked perfectly on my Kali Linux setup.

 

 

Reply
0 Kudos
tps800
Contributor
Contributor
Jump to solution

This is not the solution. following these instructions you'll run into various compiler errors and warnings treatened as errors with Workstation 16.1.0 install.

  1. The compiler is found, but mentioned als version "0". Maybe VMware build in build searches the compiler, interpreting gcc-10 als compiler version 0?

 

 

# gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 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.

 

 

  • If following the given instructions:
    • cd /usr/lib/vmware/modules/source
    • tar xf vmmon.tar
    • cd vmmon-only
    • make leads to various compiler erros and warnings treated as erros:

 

 

   39 | #define CR3_PCID_MASK 0xFFFull
      |
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c: In function ‘isVAReadable’:
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:2354:13: error: implicit declaration of function ‘get_fs’; did you mean ‘sg
et_fc’? [-Werror=implicit-function-declaration]
 2354 |    old_fs = get_fs();
      |             ^~~~~~
      |             sget_fc
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:2354:13: error: incompatible types when assigning to type ‘mm_segment_t’ fr
om type ‘int’
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:2355:4: error: implicit declaration of function ‘set_fs’; did you mean ‘sge
t_fc’? [-Werror=implicit-function-declaration]
 2355 |    set_fs(KERNEL_DS);
      |    ^~~~~~
      |    sget_fc
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:2355:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did yo
u mean ‘KERNEL_2_1’?
 2355 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNEL_2_1
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:2355:11: note: each undeclared identifier is reported only once for each fu
nction it appears in
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c: In function ‘HostIFFastClockThread’:
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:3248:12: error: incompatible types when assigning to type ‘mm_segment_t’ fr
om type ‘int’
 3248 |    oldFS = get_fs();
      |            ^~~~~~
/usr/lib/vmware/modules/source/vmmon-only/linux/hostif.c:3249:11: error: ‘KERNEL_DS’ undeclared (first use in this function); did yo
u mean ‘KERNEL_2_1’?
 3249 |    set_fs(KERNEL_DS);
      |           ^~~~~~~~~
      |           KERNEL_2_1
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.10.0-4-common/scripts/Makefile.build:284: /usr/lib/vmware/modules/source/vmmon-only/linux/hos
tif.o] Fehler 1
make[2]: *** [/usr/src/linux-headers-5.10.0-4-common/Makefile:1813: /usr/lib/vmware/modules/source/vmmon-only] Fehler 2
make[1]: *** [/usr/src/linux-headers-5.10.0-4-common/Makefile:185: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-5.10.0-4-amd64“ wird verlassen
make: *** [Makefile:117: vmmon.ko] Fehler 2
​

 

 

  • cd ..
  • tar xf vmnet.tar
  • cd vmnet-only
  • make

 

 

Using kernel build system.
make -C /lib/modules/5.10.0-4-amd64/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Verzeichnis „/usr/src/linux-headers-5.10.0-4-amd64“ wird betreten
  CC [M]  /usr/lib/vmware/modules/source/vmnet-only/userif.o
/usr/lib/vmware/modules/source/vmnet-only/userif.c: In function ‘VNetCsumCopyDatagram’:
/usr/lib/vmware/modules/source/vmnet-only/userif.c:564:11: error: too many arguments to function ‘csum_and_copy_to_user’
  564 |    csum = csum_and_copy_to_user(skb->data + offset, curr, len, 0, &err);
      |           ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-5.10.0-4-common/arch/x86/include/asm/checksum.h:8,
                 from /usr/src/linux-headers-5.10.0-4-common/include/net/checksum.h:22,
                 from /usr/src/linux-headers-5.10.0-4-common/include/linux/skbuff.h:28,
                 from /usr/src/linux-headers-5.10.0-4-common/include/linux/if_ether.h:19,
                 from /usr/lib/vmware/modules/source/vmnet-only/userif.c:27:
/usr/src/linux-headers-5.10.0-4-common/arch/x86/include/asm/checksum_64.h:136:15: note: declared here
  136 | extern __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len);
      |               ^~~~~~~~~~~~~~~~~~~~~
/usr/lib/vmware/modules/source/vmnet-only/userif.c:578:13: error: too many arguments to function ‘csum_and_copy_to_user’
  578 |   tmpCsum = csum_and_copy_to_user(vaddr + skb_frag_off(frag),
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from /usr/src/linux-headers-5.10.0-4-common/arch/x86/include/asm/checksum.h:8,
                 from /usr/src/linux-headers-5.10.0-4-common/include/net/checksum.h:22,
                 from /usr/src/linux-headers-5.10.0-4-common/include/linux/skbuff.h:28,
                 from /usr/src/linux-headers-5.10.0-4-common/include/linux/if_ether.h:19,
                 from /usr/lib/vmware/modules/source/vmnet-only/userif.c:27:
/usr/src/linux-headers-5.10.0-4-common/arch/x86/include/asm/checksum_64.h:136:15: note: declared here
  136 | extern __wsum csum_and_copy_to_user(const void *src, void __user *dst, int len);
      |               ^~~~~~~~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-5.10.0-4-common/scripts/Makefile.build:284: /usr/lib/vmware/modules/source/vmnet-only/userif.o]
 Fehler 1
make[2]: *** [/usr/src/linux-headers-5.10.0-4-common/Makefile:1813: /usr/lib/vmware/modules/source/vmnet-only] Fehler 2
make[1]: *** [/usr/src/linux-headers-5.10.0-4-common/Makefile:185: __sub-make] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-headers-5.10.0-4-amd64“ wird verlassen
make: *** [Makefile:117: vmnet.ko] Fehler 2
​

 

 

Since there are no modules build, there is nothing to copy.

  • It is related to both: compiler (gcc-10) and kernel version.(uname -r: 5.10.0-4-amd64).

Meanwhile I've tried various solutions, but none gave me a working compile and a loadable module in tune.

 

BTW: VMware Workstation 16.1.0, Kernel: 5.10.0-4-amd64, gcc 10.2.1-6 on Debian Testing (Buster).
Same on Debian Stable, Ubuntu 20.10 (groovy), Ubuntu 21.04 (hirsuit), Fedora 33, 34, 35 (rawhide).

Looks like the old problem of redefining things already defined elsewhere ...

Tags (2)
Reply
0 Kudos
tps800
Contributor
Contributor
Jump to solution

Reply
0 Kudos
AnonymousTacos
Contributor
Contributor
Jump to solution

Download the github repo, cd into the folder, run the same commands, should work.

Reply
0 Kudos
john7523
Contributor
Contributor
Jump to solution

It seems to be an old thread, so the VMware shell script vmware-modconfig might have not existed at the time nor provided with the VMware installer. But now that it does, the vmmon and vmnet modules may be built from the same tarballs, with one command-line only, at least from Debian :

 

 

$ sudo /usr/bin/vmware-modconfig --console --install-all

 

 

As mentioned on https://kb.vmware.com/s/article/1002411  ; an additional step (module signing, using sign-file tool and your MOK key pair, as described on https://gist.github.com/gabrieljcs/68939c7eeadfabfdbc6b40100130270d ) might be required when using SecureBoot. I did not test it, though.

Reply
0 Kudos