39

After exhausting research online and youtube videos and facing failure to all those suggested solutions, I need your professional help with this please.

Installed VMWare workstation 15 on Ubuntu 18.4 (please see screenshot) and got kernel error.

These are the steps I already performed with no solution:

sudo vmware-modconfig --console --install-all

Registered a new key and enrolled by the following commands in order:

  1. Run OpenSSL:

    openssl req -new -x509 -newkey rsa:2048 -keyout VMWARE.priv -outform DER -out VMWARE.der -nodes -days 36500 -subj "/CN=VMWARE/"
    
  2. Run sign-file:

    sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vboxdrv)
    
  3. Run tail:

    tail $(modinfo -n vboxdrv) | grep "Module signature appended"
    
  4. Run mokutil:

    sudo mokutil --import VMWARE.der
    

Then I rebooted --> registered the key upon booting successfully and confirmed by:

mokutil --test-key VMWARE.der

Also manually signed up the drivers by:

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmmon)

Finally:

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmnet)

Please note that I am new in the Linux world, so step-by-step instructions will be appreciated!

System Info

VMWare Error 1

VMWare Error 2

damadam
  • 2,815
  • 3
  • 17
  • 38
Afshin
  • 541
  • 1
  • 5
  • 7
  • Complete instructions are provided by VMWare support, related to key generation, signing etc.: https://kb.vmware.com/s/article/58533?lang=en_US After completing the above instructions and rebooting your system, follow [these instructions](https://sourceware.org/systemtap/wiki/SecureBoot) in order to 'Enroll MOK'. – dropdown Apr 24 '19 at 10:09
  • useful link https://kb.vmware.com/s/article/2146460 – Ferroao Jun 30 '20 at 14:58
  • The folks at VMWare have a KB page on this issue: https://kb.vmware.com/s/article/2146460 – GMaster Aug 23 '20 at 12:44
  • sudo vmware-modconfig --console --install-all solves the problem @Afshin – akikara Oct 14 '20 at 10:44
  • Dissaster Ubuntu & vmware :-( – Jeroen van Langen Jan 19 '22 at 10:14

11 Answers11

75

Accepted answer is OK but doing it a little better formatted and reordered steps, added expected feedback etc. The OP has some info for VirtualBox which gives confusing errors if you don't have it.

This problem essentially happens because of secure boot which does not allow kernel modules to load without being digitally signed with a trusted certificate. So we need to create a trusted key and use it to sign the newly compiled modules vmmon and vmnet.

These instructions have been tested for VMWare 15 and Ubuntu 18.04 up to 19.04.

  1. Install VMWare

  2. Run this

    sudo vmware-modconfig --console --install-all
    

You'll see that there are issues with monitor and net, that's OK.

  1. Generate a key

    openssl req -new -x509 -newkey rsa:2048 -keyout VMWARE15.priv -outform DER -out VMWARE15.der -nodes -days 36500 -subj "/CN=VMWARE/"
    

You'll see info that it did it OK.

  1. Use this key we just generated to sign the two kernel modules.

    sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE15.priv ./VMWARE15.der $(modinfo -n vmmon)
    sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE15.priv ./VMWARE15.der $(modinfo -n vmnet)
    

This does not give any feedback

  1. Check that signatures are applied correctly.

    tail $(modinfo -n vmmon) | grep "Module signature appended"
    

You should get Binary file (standard input) matches

  1. Now we make this key trusted by importing it to machine owner key (MOK) management system with the command below. Here you can read more about MOK’s job in Linux.

    sudo mokutil --import VMWARE15.der
    

This will ask you for a password, enter some new password a bit long like 1515vmware. Reenter same password.

  1. Reboot, When reboot you should be presented with a menu with blue screen background, you have to make your way to enroll the key and enter the password you just created, this happens only once, then continue to boot.

  2. To test the driver / module installed correctly enter the command

    mokutil --test-key VMWARE15.der
    

You should get VMWARE15.der is already enrolled and that means VMWare should be working.

All credits to OP.

Notice: I've found out that after some Linux updates which involves the kernel (or something like that) this fix stops working and you have to do all the steps again to get it working again. (No need to re-install vmware)

BHP
  • 423
  • 4
  • 7
13

I have made a simple bash script to make a small amount of automation to the process. It seems to be a recurring problem when patching Ubuntu and I find my self Googling for the solution everytime.

cd /tmp
wget https://raw.githubusercontent.com/rune1979/ubuntu-vmmon-vmware-bash/master/wm_autoupdate_key.sh
chmod +x wm_autoupdate_key.sh
./wm_autoupdate_key.sh

You can also find it in my github repo (https://github.com/rune1979/ubuntu-vmmon-vmware-bash)

Rune79
  • 131
  • 1
  • 3
  • 3
    Thank you! I can confirm this still works for Ubuntu 20 and the current version of VMware Player (15.5.6) – Dan Dascalescu Jul 26 '20 at 22:10
  • 1
    Lovely share @Rune79! Rarely to see automate-mindset and sharing manner like yours. Tons of thanks! – Nam G VU Sep 08 '20 at 17:18
  • 2
    @Rune79 gives error: "EFI variables are not supported on this system". Any ideas? – akikara Oct 14 '20 at 08:44
  • [link] https://www.youtube.com/watch?v=6JhMSKvf6Kw [/link] (https://www.youtube.com/watch?v=6JhMSKvf6Kw) I think this guy might show some direction on this issue. – Rune79 Oct 17 '20 at 10:35
  • I do not have EFI enabled, have same problem and when try to use solutin, get same error as @Run79: 'EFI variables are not supported on this system' – schmoopy May 11 '21 at 18:15
  • I have been using Ubuntu since 18LTS and now running 20LTS but have had secure boot enabled since the very beginning and suddenly this issue began a few days ago (maybe there was a kernel update and I missed it?). Anyhow, this script worked like a charm. – ubuntux Jul 21 '22 at 14:22
  • 1
    Works fine in Ubuntu 22.04LTS with Vmware 16. Thanks for making things super easy. – sam Nov 13 '22 at 13:16
  • Works great using Ubuntu 22.04 and VMWare Workstation Player 17. Thanks so much for the time-saving solution! – KBurchfiel Jul 07 '23 at 21:11
5

Problem solved! I followed the same exact steps in my original post EXCEPT that I changed the name of the key to something else! The new key successfully signed vmmon in dev directory and vmware worked!

Afshin
  • 541
  • 1
  • 5
  • 7
  • 1
    I didn't understand what did you exactly changed and it worked – Fatemeh Karimi Jan 19 '19 at 19:24
  • 1
    Hi Fatemeh! Basically, when you install VirtualBox or VmWare, a new kernel is introduced to Linux. When you install Linux, a safe boot is set up (most of the time) and a safe boot prevents any new kernel to work unless a secure key is attached to it. The solution was to create a new secure key, install it, reboot and register the key so that the new kernel from vmware would work with it. It was a frustrating process but worked finally! haha let me know if you have any other questions... – Afshin Jan 20 '19 at 20:43
  • I followed the instructions and changed the name, and when I run the command 'mokutil --test-key VMWARE.der' the terminal returns 'mokutil --test-key VMWARE.der', which I assume means it worked; however when I try to load my VM on VMplayer it gives me the same two errors as what you originally had. – WitchsFISTS Aug 15 '19 at 00:34
2

I also had this issue and resolved it by the steps mentioned above but had to reperform these steps after every update. So instead I realized that I could disable secure boot on in my bios and the problem was immediately resolved.

2

In my case, I also ran into these errors when trying to launch a VM from VMware player. I am not using secure boot, but I installed VMware player back when I was running Ubuntu 16.04. VMware was working fine back then. A week ago, I upgraded to Ubuntu 18.04 and that's when these problems started. For, me all I had to do was the first step pointed out by the OP:

$ sudo vmware-modconfig --console --install-all

There was no need to uninstall or reinstall the app or sign any kernel modules. You don't even need to reboot - just launch VMware player again.

Gary
  • 121
  • 2
1

I did the following combination to get it working.

Uninstall:

sudo vmware-installer -u vmware-player
Install build essentials and gtk module
sudo apt install build-essential gcc
sudo apt install libcanberra-gtk-module

Install Vmware player again

sudo ./VMware-Player-15.0.2-10952284.x86_64.bundle

Run ubuntu-vmmon-vmware-bash as explained here on the script's GitHub repository:

wget https://raw.githubusercontent.com/rune1979/ubuntu-vmmon-vmware-bash/master/wm_autoupdate_key.sh
sudo chmod +x wm_autoupdate_key.sh
./wm_autoupdate_key.sh 
Zanna
  • 69,223
  • 56
  • 216
  • 327
1

I had to repeat the whole procedure again because of an update of my Ubuntu 18.04.5 LTS kernel, so I wrote it down exactly what I did.

What you have to do after you have installed VMWARE-Player (a new installation but if you already have VMWARE-Player on your machine you don't have to do a new installation of it), OR after an update of your Linux kernel:

Because after you updated your Ubuntu kernel your VMWARE has to do an update and will also try to run/sign and execute an key for vmmon and vmnet but that second part will in most of the cases not work, you have to run some scripts and reboot your system see the sequence below.

sudo vmware-modconfig --console --install-all
openssl req -new -x509 -newkey rsa:2048 -keyout VMWARE.priv -outform DER -out VMWARE.der -nodes -days 36500 -subj "/CN=VMWARE/"
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vboxdrv)       

The above will generate an error because it's for vbox but I run it anyway.

sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmmon)
sudo /usr/src/linux-headers-$(uname -r)/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmnet)
sudo mokutil --import VMWARE.der

IMPORTANT: your password SHOULD NOT be longer then 5 characters, I just choose exact 5 characters long lowercase.

  • I rebooted the machine, a cold reboot.
  • When starting I hit the space bar several times. I got a menu:
  • I choose for Enroll Mock
  • Continue
  • yes
  • password
  • reboot

After the reboot I started VMWARE-Player and opened my kali virtual machine or any VM which you want to start, and it started well.

Zanna
  • 69,223
  • 56
  • 216
  • 327
Mr. LabMan
  • 11
  • 1
  • The "reboot" steps here with the space bar were the missing piece for me, thank you for adding it in! That combined with https://askubuntu.com/a/1145426/1652162 fixed the problem. – DriveItLikeYouStoleIt Nov 23 '22 at 21:02
0

What I would do would be to first uninstall VMWare Workstation from your system like this:

sudo vmware-installer -u vmware-workstation

Now let's re-install it, but before we install the Vmware Workstation Player 15 package, let’s install/update to newer versions of packages and their dependencies by using the command below:

sudo apt-get update

Now we need to install some dependencies which are required for the Vmware Workstation Player 15 Installation (by default these should already be installed in Ubuntu 18.04, but if not, they will be):

First Install build-essential and gcc as shown:

sudo apt install build-essential gcc

Then install libcanberra-gtk-module as shown:

sudo apt install libcanberra-gtk-module

So let’s proceed with the Vmware Workstation installation.

Run the following commands in the terminal to install VMware Workstation Player 15:

mkdir ~/vmware
cd ~/vmware
wget -c https://download3.vmware.com/software/player/file/VMware- 
Player-15.0.2-10952284.x86_64.bundle

(Currently, as of today, the latest bundle)

OR

forget the "wget" part and download the bundle here:

https://my.vmware.com/en/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/15_0

and put it in the vmware directory you just made.

Give the package permissions:

sudo chmod u+x VMware-Player-15.0.2-10952284.x86_64.bundle

Finally, install:

sudo ./VMware-Player-15.0.2-10952284.x86_64.bundle

As soon as the installer starts, follow the on screen instructions to complete the installation.

Select I accept the terms in the license agreement and then click on "Next". Update on startup; select yes (if you want). Feedback; select yes or no. License Key is optional (needed for Workstation Pro, but can be left blank).

Click "Install" on next screen.

Close when finished.

---NOTE---

If 3D acceleration is not enabled: Edit hidden file /.vmware/preferences and look for a line that starts with:

mks.gl.allowBlacklistedDrivers

If it is not present - you can add it into the file.

This should be changed to:

mks.gl.allowBlacklistedDrivers = "TRUE"

---also---

go to /vmware/ /.vmx open it with gedit (or equivalent) and add the line:

mks.gl.allowBlacklistedDrivers = "TRUE"

For a Windows guest I add these lines, also, to the hidden file and the ".vmx" file (mentioned above):

mks.enableDX11Renderer = "FALSE"
mks.enableGLRenderer = "TRUE"

This switches the 3D acceleration from the default DX11 to OpenGL.

This should get you up and running and solve the issues.

Dave
  • 1,434
  • 1
  • 7
  • 12
  • 1
    Thanks for the effort but it did not work! This solution is basically uninstalling and re-installing vmware which I already did; but thanks anyways. – Afshin Nov 27 '18 at 03:32
  • I'm glad to see you managed to solve the problem. Yeah, you were right; it was uninstalling and re-installing it. This is how I install it and I have never had any problems. – Dave Nov 27 '18 at 23:11
0

In my case, I ran into these errors too when trying to launch a VM from VMware player Version 17.0.1. I am not using secure boot, but I installed VMware player back when I was running Ubuntu 22.04 LTS. VMware was working fine since months. When logging in I got the message "/dev/vmmon ..." pops up. The following solved it:

$ sudo vmware-modconfig --console --install-all

There was no need to uninstall or reinstall the app or sign any kernel modules. You don't even need to reboot - just launch VMware player again.

System info: Jammy 22.04 LTS; Kernel 5.15.0-60 x86-64

Paul
  • 1
  • 1
-1

(03-Sep-2019)

The solution for me:

(

Uninstall:

sudo vmware-installer -u vmware-workstation 

OR

Uninstall:

sudo vmware-installer -u vmware-player

)

AND

Install:

sudo ./VMware-Player-15.1.0-13591040.x86_64.bundle
Zanna
  • 69,223
  • 56
  • 216
  • 327
-1

This should definitely work on debian based Distros... executing these command u will just enable mokutility you have to reboot your computer once the code part has been completed and press any key to import the VMWARE.der

openssl req -new -x509 -newkey rsa:2048 -keyout VMWARE.priv -outform DER -out VMWARE.der -nodes -days 36500 -subj "/CN=VMware/"


sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmmon)


sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./VMWARE.priv ./VMWARE.der $(modinfo -n vmnet)


mokutil --import VMWARE.der


mokutil --test-key VMWARE.der

reboot

thats it you are ready to go, just reboot,
press any key during BOOTING to register in mokutils, complete registration and your error will dissapear. TESTED ON LINUX MINT 19.3