VMWare Workstation vmmon broken on Ubuntu 18.04

6

2

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?

user1330734

Posted 2018-06-04T06:27:36.217

Reputation: 231

Answers

5

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.

Charly

Posted 2018-06-04T06:27:36.217

Reputation: 51

Thanks alot, works perfect on Gentoo Linux. – wuseman – 2019-07-12T23:10:29.360

There should not be a return at the end for sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1 – technogeek1995 – 2019-09-05T18:08:56.927

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

NeoGeek

Posted 2018-06-04T06:27:36.217

Reputation: 11

Just update to 4.15.0-32-generic and this is still working for me. – NeoGeek – 2018-08-17T12:00:49.070

Phew, glad I found this-- had to do it after upgrading Ubuntu 18.04 to 4.15.0-34-generic kernel – Kelly Adams – 2018-09-12T23:15:46.563

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

James Dube

Posted 2018-06-04T06:27:36.217

Reputation: 1