Signing kernel modules with a machine-owner key (MOK) that you generate and enroll in your system’s firmware.
- To run VMware Workstation on Fedora with Secure Boot enabled, you must sign the
vmmonandvmnet
Phase 1: Generate a Key Pair#
You only need to do this once. This creates a trusted “identity” for you to sign drivers with.
- Create a directory for your keys (for safekeeping):
bashsudo mkdir -p /root/module-signing cd /root/module-signing - Generate the public and private keys:
Run this command exactly. It creates a certificate valid for 10 years.
bashsudo openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=VMware/"MOK.priv: Private key (Keep safe! Used to sign modules).MOK.der: Public key (This gets enrolled in your BIOS/EFI).
Phase 2: Enroll the Key in Firmware#
You must tell your computer’s firmware (BIOS/UEFI) to trust this new key.
- Import the public key:
plaintextsudo mokutil --import MOK.der- It will ask you to create a one-time password. Remember this password; you will need it in the next step.
- Reboot your computer:
plaintextsudo reboot - Perform the Enrollment (The “Blue Screen”):
During boot, before Fedora loads, you will see a blue screen labeled Shim UEFI key management.- Press any key to interrupt the boot.
- Select Enroll MOK.
- Select Continue.
- Select Yes.
- Enter the password you created in Step 1.
- Select Reboot.
Phase 3: Sign the Modules#
Now that your system trusts the key, you must sign the specific VMware modules. You will need to repeat this phase every time you update your Linux kernel or VMware version.
- Locate the sign-file utility:
Fedora puts this in the kernel headers.
SIGNER="/usr/src/kernels/$(uname -r)/scripts/sign-file"plaintext- Locate your VMware modules:
They are usually in /lib/modules/$(uname -r)/misc/.
(Note: If the files end in .ko.xz, you must decompress them using xz -d before signing, then recompress them. However, manually compiled VMware modules are usually just .ko). - Run the signing commands:
# Sign vmmon
sudo $SIGNER sha256 /root/module-signing/MOK.priv /root/module-signing/MOK.der $(modinfo -n vmmon)
# Sign vmnet
sudo $SIGNER sha256 /root/module-signing/MOK.priv /root/module-signing/MOK.der $(modinfo -n vmnet)plaintextPhase 4: Load and Verify#
- Load the signed modules:
sudo modprobe vmmon
sudo modprobe vmnetplaintext- Verify they are loaded:
lsmod | grep vmplaintext_If you see `vmmon` and `vmnet` in the output, you are successful._plaintext2. Restart VMware Service:
sudo systemctl restart vmware.serviceplaintextTroubleshooting#
- “Key rejected by service”: This means the enrollment in Phase 2 didn’t happen correctly. Run
mokutil --test MOK.derto see if the key is enrolled. If it says “not enrolled,” try Phase 2 again. - “File not found”: Ensure you have
kernel-develinstalled (sudo dnf install kernel-devel). Thesign-filetool is part of that package.