酷徒LOGO

18.04: 构建vmmon失败,安装 VMware


问题:

我尝试在 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



如何修复它,或者使implicit-function-declaration和incompatible-pointer-types不被视为 errros?
或者任何简单的方法安装最新的VMware 18.04?

注意:来自 16.04上工作站 Pro 12的不同错误无法编译 vmmon


回答 1:

将最新版本的14.1.2 安装为 Bug 已经被修复。 请参见这里的这里是下载链接。


回答 2:

我找到一个解决方案,并创建了一个基于的脚本文件,它是mkucebek源代码的

必须创建具有这里内容的文件,并在每次需要( 通常在安装新内核时) 时运行该文件:


#!/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工作站。






Copyright © 2011 HelpLib All rights reserved.    知识分享协议 京ICP备17041772号-2  |  如果智培  |  酷兔英语  |  帮酷