Last active
February 21, 2021 10:09
-
-
Save PotatoMaster101/91c526ef392d5c0c9c03fba01d845258 to your computer and use it in GitHub Desktop.
Fixes VMWare after Linux kernel update
This file contains 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 | |
#################################################################################################### | |
# Fixes VMWare after Linux kernel update. | |
# https://askubuntu.com/questions/1096052/vmware-15-error-on-ubuntu-18-4-could-not-open-dev-vmmon-no-such-file-or-dire | |
# | |
# Usage: /bin/sh vmfix.sh | |
#################################################################################################### | |
if [ "$(id -u)" -ne 0 ]; then | |
echo 'ERROR: Must be run as root' 1>&2 | |
exit 1 | |
fi | |
if ! type 'vmware-modconfig' 2>&1 > /dev/null; then | |
echo 'ERROR: Program not found: vmware-modconfig' 1>&2 | |
exit 1 | |
fi | |
vmware-modconfig --console --install-all | |
openssl req -new -x509 -newkey rsa:2048 -keyout VMWARE15.priv -outform DER -out VMWARE15.der -nodes -days 36500 -subj "/CN=VMWARE/" | |
/usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE15.priv ./VMWARE15.der $(modinfo -n vmmon) | |
/usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE15.priv ./VMWARE15.der $(modinfo -n vmnet) | |
mokutil --import VMWARE15.der | |
echo 'Restart computer to enroll the key' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment