#!/bin/bash
set -e
KERNEL_MODDIR="/lib/modules/$(uname -r)"
if [ ! -f "$KERNEL_MODDIR/misc/vmmon.o" ]; then
echo "Compiling required modules..."
cd /usr/lib/vmware/modules/source
sudo make -BC vmmon-only
sudo make -BC vmnet-only
sudo mkdir -p "$KERNEL_MODDIR/misc"
sudo cp *.o "$KERNEL_MODDIR/misc"
cd -
fi
sudo insmod "$KERNEL_MODDIR/misc/vmmon.o" && true
sudo insmod "$KERNEL_MODDIR/misc/vmnet.o" && true
(sudo vmware-networks --status > /dev/null) || (sudo vmware-networks --start);
# NOTE: You may need to change these lines
echo "Success. Launching vmplayer..."
/usr/lib/vmware/bin/vmplayer
This script is going to solve the following problem on VMware / VMware Player. If you encounter the following message:
```
/usr/lib/vmware/bin/vmware-modconfig: Relink `/lib/x86_64-linux-gnu/libbsd.so.0' with `/lib/x86_64-linux-gnu/librt.so.1' for IFUNC symbol `clock_gettime'
```
Then you should apply a patch. The solution is from [https://askubuntu.com/a/968429/719742](https://askubuntu.com/a/968429/719742). After applying the patch you still need to **launch the executable directly** to bypass the doomed gcc version checking to launch VMware / VMware Player (I don't know why QQ). This is a tedious process, and the kernel modules are needed to be re-inserted after each reboot, though. So I wrote this script to automate this process.