7

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 Answers 4

6

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
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -sv /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.

2
  • Thanks alot, works perfect on Gentoo Linux.
    – user1013015
    Jul 12, 2019 at 23:10
  • 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 Sep 5, 2019 at 18:08
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

2
  • Just update to 4.15.0-32-generic and this is still working for me.
    – NeoGeek
    Aug 17, 2018 at 12:00
  • Phew, glad I found this-- had to do it after upgrading Ubuntu 18.04 to 4.15.0-34-generic kernel Sep 12, 2018 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
0

Another add-on to this fix under Ubuntu 20.04 LTS and Ubuntu 22.04 LTS: It seems that VMware will crash with an exception (Segmentation Fault) on these new versions of the OS even after you follow all the steps here!

However, it can still be easily fixed, just it's not very intuitive --- you just need to invoke 'vmplayer' using the full path to the appLoader!

So, like this, it crashes horribly:

ubuntu@ubuntu:~$ vmplayer

... (harmless errors and warnings)
/usr/bin/vmplayer: line 106: 28048 Segmentation fault      (core dumped) "$BINDIR"/vmware-modconfig --appname="VMware Player" --icon="vmware-player"

But if you load it like this, it starts up perfectly!:

ubuntu@ubuntu:~$ /usr/lib/vmware/bin/vmplayer 

To make the icon work, just edit the desktop file in /usr/share/applications to invoke vmplayer with the full path like that, and it will now launch from the GUI too.

BTW - You can choose to install vmplayer in a different location than /usr/lib. For example, to install under /opt instead, just add the argument --set-setting vmware-installer libdir /opt when running the installer bundle.

Looking forward now to still more startup problems with VMware Player in the later version of Ubuntu, but relieved that it still works in something as recent as 2022 (as well as something as old as 2008, with another small tweak in hardy).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .