Monday, April 01, 2019

Ubuntu 16 - VMWare Player 12 - GCC Not found


First solution
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


Second solution

mkdir ~/vmmodules #create a temp folder and copy files.
cp /usr/lib/vmware/modules/source/vmnet.tar /usr/lib/vmware/modules/source/vmmon.tar ~/vmmodules/ 
# make the modules manually 
tar -xvf vmmon.tar 
cd vmmon-only 
make 
cd .. 
sudo cp vmmon.o /lib/modules/`uname -r`/kernel/drivers/misc/vmmon.ko.gz 
tar -xvf vmnet.tar 
cd vmnet-only 
make 
cd .. 
sudo cp vmnet.o /lib/modules/`uname -r`/kernel/drivers/misc/vmnet.ko.gz 
#Then reload the modules and restart vmware service, vmplayer should works now. 
sudo depmod -a 
sudo systemctl restart vmware


Thrid solution

#install the right version of gcc
$sudo apt-get install g++-4.9 

Trick

$sudo sed 's/gcc version 5.4.0/gcc version 6.4.0/' /proc/version > /tmp/version
$sudo mount --bind /tmp/version /proc/version
$sudo vmware-modconfig --console --install-all
$sudo umount /proc/version && rm /tmp/version


Final solution 2019
Update kernel from 4.4 to 4.11 works good[2] and download from [3].

References:
[1] https://unix.stackexchange.com/questions/310637/vmware-kernel-module-a-compatible-version-of-gcc-was-not-found
[2] Update kernel https://www.howtoforge.com/tutorial/how-to-upgrade-linux-kernel-in-ubuntu-1604-server/
[3] Ubuntu kernels https://kernel.ubuntu.com/~kernel-ppa/mainline/
[4] Update Ubuntu 18 kernel https://www.tecmint.com/upgrade-kernel-in-ubuntu/ 

No comments:

Running apps

Runtastic (I uninstalled because force to update your device - Internet connection problems) Runkeeper  (Wrong GPS tracking) Strava   (Curr...