VMware kernel module: a compatible version of gcc was not found
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.
Related videos on Youtube
bader alzhrani
Updated on September 18, 2022Comments
-
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?
-
nrolans over 7 yearsGCC 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 over 7 yearsi do it, but i got same problem !
-
bader alzhrani over 7 yearssame problem , nothing change
-
Ogheneneovie Ralph Otutu over 7 yearsWhat was the Error you got. After running this command
-
MatrixManAtYrService about 7 yearsI think line 6 should be
cd ../vmnet-only
. Also, this worked like a charm--thanks. -
Lakshman Chilukuri about 7 yearsWorked for me on Mint 18.1 with kernel 4.9.20. Thanks.
-
blackappy over 6 yearsWorked for me on Kali rolling.
-
t98907 over 5 yearsit worked. perfect answer.
-
Peng almost 5 yearsEven with GCC installed I still get this issue (Fedora 30). It seems like it wants a very specific version of GCC