Automate kernel module installations for VMware Workstation on your Linux distro

VMWare Archives - The CloudStack Company
VMware Robot does a little dance

Update April 2021: I noticed VMware Workstation 16 in Ubuntu tends to install kernel modules fine through its GUI now, so a lot of this info about how to compile and install vmmon and vmnet is probably obsolete. But since it may be useful to someone using an older version of Workstation, I’ll leave it up for the time being.

In reference to this post I made earlier: https://develmonk.com/2020/10/20/solve-the-system-cannot-find-the-file-specified-error-in-vmware-workstation/

I found the most helpful script, just drop this in a text file called /etc/kernel/install.d/vmmodules.install

#!/usr/bin/bash

export LANG=C

COMMAND="$1"
KERNEL_VERSION="$2"
BOOT_DIR_ABS="$3"
KERNEL_IMAGE="$4"

ret=0

case "$COMMAND" in
    add)
       VMWARE_VERSION=$(cat /etc/vmware/config | grep player.product.version | sed '/.*\"\(.*\)\".*/ s//\1/g')

       [ -z VMWARE_VERSION ] && exit 0

       mkdir -p /tmp/git; cd /tmp/git
       git clone -b workstation-${VMWARE_VERSION} https://github.com/mkubecek/vmware-host-modules.git
       cd vmware-host-modules
       make VM_UNAME=${KERNEL_VERSION}
       make install VM_UNAME=${KERNEL_VERSION}

       ((ret+=$?))
       ;;
    remove)
        exit 0
        ;;
    *)
        usage
        ret=1;;
esac

exit $ret

It’s so exciting! That should download, compile, and install the proper vmmon and vmnet kernel extensions required for Workstation every time a new kernel is installed (!!).

Now I just have to work out a way to get the MOKutil key submission in there for secure boot, but it’s definite a good start to making the installation of new kernels less painful for Workstation users on Linux.

Tested in: Ubuntu 20.10

Reference:
https://docs.fedoraproject.org/en-US/quick-docs/how-to-use-vmware/

Author: Avery Freeman

MBA / Audio Engineering alumnus enjoys taking adjunct courses in data sciences, management, and software development. Passionate about collaboratively improving humanity through open source information ecosystems. Tenaciously solves problems of near-universally intolerable tediousness. Proficient in SQL, Python, Javascript, has forgotten SAS, and misses OpenSolaris. Eminently effervescent about Unix-like operating systems and software defined networks, including an unmistakable urge to Berkeley packet filter all the things. Fanatically fond of zfs and linux volume manager. Has lived in Tokyo, SF, Oakland, and now Seattle. Can't forget cooking, hiking, gardening, and playing with your cat.

Leave a Reply

Your email address will not be published. Required fields are marked *