November 7, 2019

Fixing VMware Workstation's vmmon/vmnet issues on Fedora

So virtual machines are one of my favourite parts of tech, the ability to run many different services, operating systems and even instruction sets (OK its more emulation but you get what I mean). At home I use Vmware ESXi, a type 1 hyperviosr that honestly is the bees knees, but on my laptop where I cant really have my OS be a hypervisor (yes I intend to try out QubesOS) I use VMware Workstation, to run any VM's I need on the go.

Now my OS of choice is Linux, specifically Fedora 31 on my laptop and while VMware is basically install and go on Windows, its a different story on the old Linux systems. VMware Workstation (and Player) suffers from an annoying issue. Every time you update your kernel (which is quite a bit using Fedora) you are greeted with this lovely error and hitting install never works:

thanks I didn't want to run my VMs anyway

The short of it is that the kernel module for Workstation/Player are not compatible with the new kernel you just installed, so we need to install ones that are.

First if you have just installed it, make sure you have the kernel headers, git, make and gcc.

$ sudo dnf install kernel-devel kernel-headers gcc gcc-c++ make git

(Use apt if you are on Ubuntu)

There are two bits off info we need, the version number of Workstation/Player and your kernel version.

$ cat /etc/vmware/config | grep player.product.version

$ sudo uname -r

Now we have those, we are going to grab and install the compatible modules (I'm going to use the commands to fix workstation but just put player where workstation is in the git clone):

$ mkdir -p /tmp/git; cd /tmp/git

$ git clone -b workstation-[VMWARE_VER]

$ cd vmware-host-modules
$ sudo make VM_UNAME=[KERNEL_VER[
$ sudo  make install VM_UNAME=[KERNEL_VERSION]

Now you just need to do

$ sudo modprobe vmmon

Now if you get errors from the virtual network, you might have to add them to systemd services, just follow this from Arch Wiki. Basically create the files, copy the content and then run (for example starting the network service)

$ sudo systemctl start vmware-networks-server.service
$ sudo systemctl enable vmware-networks-server.service

Then hey, presto! You now how VMware Player/Workstation running...Enjoy!