Last active
July 23, 2022 04:28
-
-
Save imShakil/91c62cd5d526a3d48819d9c9a8bab02c to your computer and use it in GitHub Desktop.
vmware vmmon and vmnet issue fix with this script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Author: @vcont | |
#Source: gist#https://gist.github.com/vcont/1c76ff2954481e5c95cb361ea0c856a2 | |
# Uncomment this is you want some more verbose output to see what is happening | |
#set -x | |
## Variables | |
# Change this directory name if you want to place these somewhere else | |
_projectdir=~/projects | |
_gitrepo=https://github.com/mkubecek/vmware-host-modules.git | |
if [ $(grep -q "workstation.product.version" /etc/vmware/config;echo $?) -eq 0 ];then | |
_product=workstation | |
else | |
_product=player | |
fi | |
_vmwversion=$(awk '/^player.product.version/{gsub("\"","");print $3}' /etc/vmware/config) | |
## Main | |
echo;echo "Checking out the patches for the vmware modules and installing as necessary ... ";echo | |
if [ ! -d ${_projectdir} ];then | |
mkdir -p ${_projectdir} | |
fi | |
if [ ! -d ${_projectdir}/vmware-host-modules ];then | |
cd ${_projectdir} | |
git clone ${_gitrepo} | |
fi | |
cd ${_projectdir}/vmware-host-modules/ | |
git checkout ${_product}-${_vmwversion} | |
git pull | |
make clean | |
make tarballs | |
if [ ! -e /usr/lib/vmware/modules/source/vmmon.tar.org.${_vmwversion} -a ! -e /usr/lib/vmware/modules/source/vmnet.tar.org.${_vmwversion} ];then | |
sudo cp /usr/lib/vmware/modules/source/vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar.org.${_vmwversion} | |
sudo cp /usr/lib/vmware/modules/source/vmnet.tar /usr/lib/vmware/modules/source/vmnet.tar.org.${_vmwversion} | |
fi | |
sudo cp vmmon.tar vmnet.tar /usr/lib/vmware/modules/source/ | |
# Build the modules for the current kernel | |
# If you get errors make sure you are running the msst recently installed kernel | |
# If you've updated, and there was a new kernel you will get errors if you haven't rebooted to it | |
sudo vmware-modconfig --console --install-all | |
# Completed | |
echo;echo "DONE";echo |
Hey @Vcont, I just made a copy that time for having it. My intention was not like that. Sorry for that.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👋 if you are going to copy the code of others and repost it, at least give recognition to the author :)