VMware kernel module: a compatible version of gcc was not found

35,132

Solution 1

I hope this solves your problems.

Upgrade Kali to the Latest Which is 4.8.0-kali1-amd64

cd /usr/lib/vmware/modules/source

tar xf vmmon.tar

tar xf vmnet.tar

cd vmmon-only

make

cd ../vmnet-only

make

cd ..

mkdir /lib/modules/`uname -r`/misc

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

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

depmod -a

/etc/init.d/vmware restart

Every time there's a new build for Kali, you have to go through these steps again.

Solution 2

You will need to install the basic development tools and libraries for this. Depending if you are using a Debian derivative (Ubuntu/Mint/Kali) or a Red Hat based system (RHEL/CentOS) the commands to install are different:

Debian based

apt-get install build-essential

Red Hat based

yum groupinstall 'Development Tools'

As a side note there is a package called open-vm-tools that provides the same functionality as VMware tools but are fully open source and better supported.

Solution 3

I followed the answer by Ogheneneovie Ralph Otutu which used to work in previous kernels but does not seem to work on newer kernels. I was trying to compile the modules for vmware 12.5.9 on kernel 4.15.0-kali3-amd64 when I got some errors:

/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘LinuxDriverInitTSCkHz’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:268:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]                                 
    tscTimer.function = LinuxDriverEstimateTSCkHzDeferred;
                      ^
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:270:12: error: ‘struct timer_list’ has no member named ‘data’
    tscTimer.data     = 0;
            ^
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘init_module’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:312:4: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
    init_timer(&linuxState.pollTimer);
    ^~~~~~~~~~
...

Apparently changes in the Linux kernel made the VMware module sources incompatible.

To make this work I downloaded the patched source files for my version of VMware from https://github.com/mkubecek/vmware-host-modules/branches and followed the same steps as described by Ogheneneovie Ralph Otutu, i.e.:

cd /usr/lib/vmware/modules/source

wget https://github.com/mkubecek/vmware-host-modules/archive/player-12.5.9.zip

unzip player-12.5.9.zip

cd vmware-host-modules-player-12.5.9/vmmon-only/

make

cd ../vmnet-only/

make

cd ..

mkdir /lib/modules/`uname -r`/misc

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

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

depmod -a

/etc/init.d/vmware restart

Solution 4

If you are using Kali Linux Rolling Edition, just browse and select gcc-5 which is in /usr/bin or just type /usr/bin/gcc-5 in the location field, and press "Install".

Solution 5

You probably don't have gcc installed.

Just try this:

gcc --version

You will probably get that gcc command is not installed or something like that.

Solution? Simple!

apt-get update
apt-get install gcc

In case you are missing gcc, there is good change that make is also not installed.

apt-get install make

and then re-run instalation of vmware tools.

Share:
35,132

Related videos on Youtube

bader alzhrani
Author by

bader alzhrani

Updated on September 18, 2022

Comments

  • bader alzhrani
    bader alzhrani over 1 year

    When running the VMware kernel module updater, I get the following message:

    A compatible version of gcc was not found.

    How can I setup GCC to compile the VMware kernel module?

    enter image description here

    enter image description here

    • nrolans
      nrolans over 7 years
      GCC is the compiler used to build the kernel module. It is possible it is not currently installed. Can you specify which distribution you are using?
  • bader alzhrani
    bader alzhrani over 7 years
    i do it, but i got same problem !
  • bader alzhrani
    bader alzhrani over 7 years
    same problem , nothing change
  • Ogheneneovie Ralph Otutu
    Ogheneneovie Ralph Otutu over 7 years
    What was the Error you got. After running this command
  • MatrixManAtYrService
    MatrixManAtYrService about 7 years
    I think line 6 should be cd ../vmnet-only. Also, this worked like a charm--thanks.
  • Lakshman Chilukuri
    Lakshman Chilukuri about 7 years
    Worked for me on Mint 18.1 with kernel 4.9.20. Thanks.
  • blackappy
    blackappy over 6 years
    Worked for me on Kali rolling.
  • t98907
    t98907 over 5 years
    it worked. perfect answer.
  • Peng
    Peng almost 5 years
    Even with GCC installed I still get this issue (Fedora 30). It seems like it wants a very specific version of GCC