4

I upgraded to Ubuntu 18.04 and the vmmon.ko module for VMWare Workstation 12.5.9 now fails to build.

vmmon compilation failure output

/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘LinuxDriverInitTSCkHz’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:268:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    tscTimer.function = LinuxDriverEstimateTSCkHzDeferred;
                      ^
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:270:12: error: ‘struct timer_list’ has no member named ‘data’
    tscTimer.data     = 0;
            ^
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c: In function ‘init_module’:
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:312:4: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
    init_timer(&linuxState.pollTimer);
    ^~~~~~~~~~
    init_timers
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:313:24: error: ‘struct timer_list’ has no member named ‘data’
    linuxState.pollTimer.data = 0;
                        ^
/usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:314:34: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    linuxState.pollTimer.function = LinuxDriverPollTimeout;

This seems like a minor change causing vmmon compile to fail, possibly that data structures have changed between versions of the kernel?

Edit: It seems that in Linux kernel v4.15 init_timer() interface has been removed

uname -a
Linux hostnema 4.15.0-22-generic #24-Ubuntu SMP Wed May 16 12:15:17 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Any suggestions on how I could begin to fix this?

4

I found a solution and create a script file based on mkucebek's github sources.

You must create a file with this content and run it each time it's needed :

#!/bin/bash
VMWARE_VERSION=workstation-12.5.9
TMP_FOLDER=/tmp/patch-vmware
rm -fdr $TMP_FOLDER
mkdir -p $TMP_FOLDER
cd $TMP_FOLDER
git clone https://github.com/mkubecek/vmware-host-modules.git
cd $TMP_FOLDER/vmware-host-modules
git checkout $VMWARE_VERSION
git fetch
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 
/usr/lib/vmware/lib/libz.so.1/libz.so.1

sudo /etc/init.d/vmware restart

Then, you just have to launch VMware Workstation without building modules.

  • Thanks alot, works perfect on Gentoo Linux. – wuseman Jul 12 at 23:10
1

Using Charly's suggested script, I was able to build the needed modules for kernel 4.15.0-29-generic on 16.04 LTS. There is a typo at the end of the script, there should not be a line return between sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 and /usr/lib/vmware/lib/libz.so.1/libz.so.1

Another addition I would recommend is to add sudo /etc/init.d/vmware restart command to the end of the above script.

So the actual solution script with tweaks is:

#!/bin/bash
VMWARE_VERSION=workstation-12.5.9
TMP_FOLDER=/tmp/patch-vmware
rm -fdr $TMP_FOLDER
mkdir -p $TMP_FOLDER
cd $TMP_FOLDER
git clone https://github.com/mkubecek/vmware-host-modules.git
cd $TMP_FOLDER/vmware-host-modules
git checkout $VMWARE_VERSION
git fetch
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo /etc/init.d/vmware restart

```

Sorry this isn't a comment on Charly's answer, I don't have the reputation on this account.

Note that this will only work for Workstation 12.5.9, you can easily tell which version you have by running vmware --version

  • Just update to 4.15.0-32-generic and this is still working for me. – NeoGeek Aug 17 '18 at 12:00
  • Phew, glad I found this-- had to do it after upgrading Ubuntu 18.04 to 4.15.0-34-generic kernel – Kelly Adams Sep 12 '18 at 23:15
0

I was facing the same problem on Ubuntu 18.04 on a new vmware worksation (14.1.3 build-9474260) install and after a kernel update. It seems to be a problem with importing modules into the kernel on a machine with secure boot, so based on this article I made this bash script:

#!/bin/bash
sudo vmware-modconfig --console --install-all

echo "signing vmmon module"
sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv 
./MOK.der $(modinfo -n vmmon)

echo "signing vmnet module"
sudo /usr/src/linux-headers-`uname -r`/scripts/sign-file sha256 ./MOK.priv 
./MOK.der $(modinfo -n vmnet)

echo "importing MOK cert"
mokutil --import MOK.der

protected by Community Jan 30 at 9:30

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.