Skip to content

Instantly share code, notes, and snippets.

@mtovmassian
Created December 8, 2020 08:42
Show Gist options
  • Save mtovmassian/8e8f199dea6136a4dca46c48c5014b29 to your computer and use it in GitHub Desktop.
Save mtovmassian/8e8f199dea6136a4dca46c48c5014b29 to your computer and use it in GitHub Desktop.
VMware drivers, such as vmmon and vmnet, are not able to be loaded if not signed before (this is likely to happen after update). This script helps to automaticly sign vmon and vmnet drivers.
#!/usr/bin/env bash
main() {
today_date=$(date +%Y%m%d)
key_filename="VMWARE${today_date}.priv"
cert_filename="VMWARE${today_date}.der"
openssl req -new -x509 -newkey rsa:2048 -keyout "${key_filename}" -outform DER -out "${cert_filename}" -nodes -days 36500 -subj "/CN=VMWARE/"
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./"${key_filename}" ./"${cert_filename}" $(modinfo -n vmmon)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./"${key_filename}" ./"${cert_filename}" $(modinfo -n vmnet)
# You will be prompt to set a password.
# Type 'bcde' to avoid azerty vs qwerty issue.
sudo mokutil --import "${cert_filename}"
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment