3

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

  • 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? – nrolans Sep 18 '16 at 11:58
6

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.

  • i do it, but i got same problem ! – bader alzhrani Sep 30 '16 at 22:21
  • What was the Error you got. After running this command – Ogheneneovie Ralph Otutu Oct 5 '16 at 4:24
  • 2
    I think line 6 should be cd ../vmnet-only. Also, this worked like a charm--thanks. – MatrixManAtYrService Mar 27 '17 at 4:41
  • Worked for me on Mint 18.1 with kernel 4.9.20. Thanks. – Lakshman Chilukuri Apr 2 '17 at 10:11
  • 1
    Worked for me on Kali rolling. – blackappy Aug 25 '17 at 20:45
3

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.

  • 2
    same problem , nothing change – bader alzhrani Sep 30 '16 at 22:21
2

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".

2

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

  • it worked. perfect answer. – t98907 Sep 19 '18 at 3:02
1

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.

  • Even with GCC installed I still get this issue (Fedora 30). It seems like it wants a very specific version of GCC – jocull May 29 at 12:43
0

This is a super nasty hack, but here's what I did to get the version I needed of GCC (8.3.1 in this case). I am on Fedora 30 which has 9.x right now. I'm sure this is not the right way, but I didn't know of a better way to grab the right version of GCC.

  1. Used Docker to start a new container for Fedora 29: docker run --rm -it fedora:29 bash
  2. Installed the needed GCC tools within the container: dnf install @development-tools
  3. Copied the GCC installation out to a folder on my machine: docker cp {containerid}:/usr/ {some_folder_on_my_machine}. You can look at the running containers with docker ps -a to find the container ID :) You may have to do this with sudo
  4. If you had to use sudo, take ownership of the newly copied folder sudo chown -R {user}:{user} {the_folder}
  5. Point VMware at the folder where you copied it out, for example {the_folder}/bin/gcc

protected by Community Jun 10 '18 at 12:46

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.