在18.04上安装VMware:无法构建vmmon


10

我正在尝试按照https://help.ubuntu.com/community/VMware/Player中的说明安装VMware

我收到一个错误,告诉我要查看一个包含以下内容的日志文件:

Extracting the vmmon source from "/usr/lib/vmware/modules/source/vmmon.tar".
Successfully extracted the vmmon source.
Building module with command "/usr/bin/make -j4 -C /tmp/modconfig-GoVdrH/vmmon-only auto-build HEADER_DIR=/lib/modules/4.15.0-22-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no"
Failed to build vmmon.  Failed to execute the build command.

为了弄清楚到底出了什么问题,我vmware-modconfig --console --install-all在命令行上运行了,发现了以下错误:

./arch/x86/include/asm/processor-flags.h:39:0: note: this is the location of the previous definition
 #define CR3_PCID_MASK 0xFFFull

                      ^
/tmp/modconfig-3S1CBa/vmmon-only/linux/driver.c:256:12: error: ‘struct timer_list’ has no member named ‘data’
    tscTimer.data     = 0;
    unsigned int lockedPages = global_page_state(NR_PAGETABLE) +
                               ^~~~~~~~~~~~~~~~~
                               global_numa_state
/tmp/modconfig-3S1CBa/vmmon-only/linux/driver.c: In function ‘init_module’:
/tmp/modconfig-3S1CBa/vmmon-only/linux/driver.c:338:4: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
    init_timer(&tscTimer);
    ^~~~~~~~~~
    init_timers
/tmp/modconfig-3S1CBa/vmmon-only/linux/hostif.c: In function ‘HostIF_InitUptime’:
    init_timers
/tmp/modconfig-3S1CBa/vmmon-only/linux/hostif.c:1754:31: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
    uptimeState.timer.function = HostIFUptimeResyncMono;
 LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
 ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/tmp/modconfig-3S1CBa/vmmon-only/linux/hostif.o' failed
make[2]: *** [/tmp/modconfig-3S1CBa/vmmon-only/linux/hostif.o] Error 1
Makefile:110: recipe for target 'vmmon.ko' failed
make: *** [vmmon.ko] Error 2

如何解决它,或使隐式函数声明和不兼容指针类型不被视为错误?
还是在18.04上安装最新VMware的简便方法?

注意:与Ubuntu 16.04上的VMWare Workstation Pro 12不同的错误无法编译vmmon


您可以在此处
ptetteh227 '18

Answers:



15

我找到了一个解决方案,并根据mkucebek的github来源创建了一个脚本文件。

您必须创建一个具有此内容的文件,并在每次需要时运行它(通常在安装新内核时):

#!/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

然后,您只需要启动VMware Workstation而无需构建模块。


嗨,查理,欢迎光临askubuntu!请在您的下一篇文章中添加链接。
abu_bua

与vmmon模块的版本不匹配:预期为329.0,得到309.0。您的'vmmon'内核模块版本不正确。尝试重新安装VMware Workstation。
altagir '18

1
此解决方案在Ubuntu 19.04和Workstation 15.0.4上对我来说非常有效
Lukas Bradley

我在使用“ VMware Workstation 15.0.4”时遇到了同样的问题,通过编译并安装了“ vmware-host-modules”解决了该问题。如果您使用的是另一版本的VMWare,请使用查找适当的版本 git branch -a,然后使用进行检出git checkoutlibz.so.1我不需要删除和链接并重新启动vmware服务。
soroosh

3
#!/bin/bash
VMWARE_VERSION=`vmware-installer -l |grep workstat|awk '{print $2}' |awk 'BEGIN {FS="."}{print "workstation-"$1"."$2"."$3}'`
echo $VMWARE_VERSION
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

这在Fedora 30和Workstation 15.1.0上适用于我


1
您可以添加一些有关脚本执行方式和方式的更多详细信息吗?
西蒙·苏德勒

它与显示的脚本版本相同,但是“检测”了vmware工作站的安装版本
RaulPeñaloza19年

工作openSUSE的Tumbleweed公司
blissini
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.