无法运行VMware – 无法构建vmnet

我无法运行vmware,下面是错误日志,为什么。

任何想法,但建议表示赞赏。 谢谢。

2014-02-03T16:32:00.904+08:00| vthread-3| I120: Log for VMware Workstation pid=5707 version=10.0.1 build=build-1379776 option=Release 2014-02-03T16:32:00.904+08:00| vthread-3| I120: The process is 64-bit. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: Host codepage=UTF-8 encoding=UTF-8 2014-02-03T16:32:00.904+08:00| vthread-3| I120: Host is Linux 3.13.0-031300-generic Ubuntu 13.10 2014-02-03T16:32:00.903+08:00| vthread-3| I120: Msg_Reset: 2014-02-03T16:32:00.903+08:00| vthread-3| I120: [msg.dictionary.load.openFailed] Cannot open file "/usr/lib/vmware/settings": No such file or directory. 2014-02-03T16:32:00.903+08:00| vthread-3| I120: ---------------------------------------- 2014-02-03T16:32:00.903+08:00| vthread-3| I120: PREF Optional preferences file not found at /usr/lib/vmware/settings. Using default values. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: Msg_Reset: 2014-02-03T16:32:00.904+08:00| vthread-3| I120: [msg.dictionary.load.openFailed] Cannot open file "/root/.vmware/config": No such file or directory. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: ---------------------------------------- 2014-02-03T16:32:00.904+08:00| vthread-3| I120: PREF Optional preferences file not found at /root/.vmware/config. Using default values. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: PREF Unable to check permissions for preferences file. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: Msg_Reset: 2014-02-03T16:32:00.904+08:00| vthread-3| I120: [msg.dictionary.load.openFailed] Cannot open file "/root/.vmware/preferences": No such file or directory. 2014-02-03T16:32:00.904+08:00| vthread-3| I120: ---------------------------------------- 2014-02-03T16:32:00.904+08:00| vthread-3| I120: PREF Failed to load user preferences. 2014-02-03T16:32:00.904+08:00| vthread-3| W110: Logging to /tmp/vmware-root/vmware-modconfig-5707.log 2014-02-03T16:32:00.935+08:00| vthread-3| I120: Obtaining info using the running kernel. 2014-02-03T16:32:00.935+08:00| vthread-3| I120: Created new pathsHash. 2014-02-03T16:32:00.935+08:00| vthread-3| I120: Setting header path for 3.13.0-031300-generic to "/lib/modules/3.13.0-031300-generic/build/include". 2014-02-03T16:32:00.935+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:00.935+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:00.950+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:00.950+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Reading in info for the vmmon module. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Reading in info for the vmnet module. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Reading in info for the vmblock module. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Reading in info for the vmci module. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Reading in info for the vsock module. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Setting vsock to depend on vmci. 2014-02-03T16:32:01.198+08:00| vthread-3| I120: Invoking modinfo on "vmmon". 2014-02-03T16:32:01.203+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 0. 2014-02-03T16:32:01.203+08:00| vthread-3| I120: Invoking modinfo on "vmnet". 2014-02-03T16:32:01.210+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 256. 2014-02-03T16:32:01.210+08:00| vthread-3| I120: Invoking modinfo on "vmblock". 2014-02-03T16:32:01.214+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 256. 2014-02-03T16:32:01.215+08:00| vthread-3| I120: Invoking modinfo on "vmci". 2014-02-03T16:32:01.220+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 256. 2014-02-03T16:32:01.220+08:00| vthread-3| I120: Invoking modinfo on "vsock". 2014-02-03T16:32:01.225+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 0. 2014-02-03T16:32:01.252+08:00| vthread-3| I120: to be installed: vmnet status: 0 2014-02-03T16:32:01.273+08:00| vthread-3| I120: Obtaining info using the running kernel. 2014-02-03T16:32:01.273+08:00| vthread-3| I120: Setting header path for 3.13.0-031300-generic to "/lib/modules/3.13.0-031300-generic/build/include". 2014-02-03T16:32:01.273+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:01.273+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:01.289+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:01.289+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:01.528+08:00| vthread-3| I120: Kernel header path retrieved from FileEntry: /lib/modules/3.13.0-031300-generic/build/include 2014-02-03T16:32:01.528+08:00| vthread-3| I120: Update kernel header path to /lib/modules/3.13.0-031300-generic/build/include 2014-02-03T16:32:01.528+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:01.528+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:01.542+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:01.542+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:01.546+08:00| vthread-3| I120: Found compiler at "/usr/bin/gcc" 2014-02-03T16:32:01.553+08:00| vthread-3| I120: Got gcc version "4.8". 2014-02-03T16:32:01.553+08:00| vthread-3| I120: GCC minor version 4 does not match Kernel GCC minor version 4. But that is ok. 2014-02-03T16:32:01.553+08:00| vthread-3| I120: Using user supplied compiler "/usr/bin/gcc". 2014-02-03T16:32:01.562+08:00| vthread-3| I120: Got gcc version "4.8". 2014-02-03T16:32:01.563+08:00| vthread-3| I120: GCC minor version 4 does not match Kernel GCC minor version 4. But that is ok. 2014-02-03T16:32:01.572+08:00| vthread-3| I120: Trying to find a suitable PBM set for kernel "3.13.0-031300-generic". 2014-02-03T16:32:01.572+08:00| vthread-3| I120: No matching PBM set was found for kernel "3.13.0-031300-generic". 2014-02-03T16:32:01.573+08:00| vthread-3| I120: GCC minor version 4 does not match Kernel GCC minor version 4. But that is ok. 2014-02-03T16:32:01.573+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:01.573+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:01.587+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:01.588+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:02.909+08:00| vthread-3| I120: GCC minor version 4 does not match Kernel GCC minor version 4. But that is ok. 2014-02-03T16:32:02.910+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:02.910+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:02.929+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:02.929+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:02.929+08:00| vthread-3| I120: Using temp dir "/tmp". 2014-02-03T16:32:02.974+08:00| vthread-3| I120: Obtaining info using the running kernel. 2014-02-03T16:32:02.974+08:00| vthread-3| I120: Setting header path for 3.13.0-031300-generic to "/lib/modules/3.13.0-031300-generic/build/include". 2014-02-03T16:32:02.974+08:00| vthread-3| I120: Validating path "/lib/modules/3.13.0-031300-generic/build/include" for kernel release "3.13.0-031300-generic". 2014-02-03T16:32:02.974+08:00| vthread-3| I120: using /usr/bin/gcc for preprocess check 2014-02-03T16:32:02.995+08:00| vthread-3| I120: Preprocessed UTS_RELEASE, got value "3.13.0-031300-generic". 2014-02-03T16:32:02.995+08:00| vthread-3| I120: The header path "/lib/modules/3.13.0-031300-generic/build/include" for the kernel "3.13.0-031300-generic" is valid. Whoohoo! 2014-02-03T16:32:03.237+08:00| vthread-3| I120: Invoking modinfo on "vmnet". 2014-02-03T16:32:03.245+08:00| vthread-3| I120: "/sbin/modinfo" exited with status 256. 2014-02-03T16:32:06.212+08:00| vthread-3| I120: Setting destination path for vmnet to "/lib/modules/3.13.0-031300-generic/misc/vmnet.ko". 2014-02-03T16:32:06.241+08:00| vthread-3| I120: Extracting the vmnet source from "/usr/lib/vmware/modules/source/vmnet.tar". 2014-02-03T16:32:06.370+08:00| vthread-3| I120: Successfully extracted the vmnet source. 2014-02-03T16:32:06.370+08:00| vthread-3| I120: Building module with command "/usr/bin/make -j2 -C /tmp/modconfig-mjoI0c/vmnet-only auto-build HEADER_DIR=/lib/modules/3.13.0-031300-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no" 2014-02-03T16:32:19.531+08:00| vthread-3| W110: Failed to build vmnet. Failed to execute the build command. 

我能够使用此解决方案解决 3.13内核的问题。

作者建议修补vmnet源:

使用以下内容在主目录中创建文件vmnet313.patch

 205a206 > #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) 206a208,210 > #else > VNetFilterHookFn(const struct nf_hook_ops *ops, // IN: > #endif 255c259,263 < transmit = (hooknum == VMW_NF_INET_POST_ROUTING); --- > #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) > transmit = (hooknum == VMW_NF_INET_POST_ROUTING); > #else > transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING); > #endif 

或者, 将此修补程序下载到您的主目录并将其重命名为vmnet313.patch 。 例如:

 wget "http://pastebin.com/raw.php?i=p3bkbAMu" -O vmnet313.patch 

接下来,执行以下命令:

 #Change directory into the vmware module source directory cd /usr/lib/vmware/modules/source # untar the vmnet modules tar -xvf vmnet.tar #run a the patch you should have just saved earlier patch vmnet-only/filter.c < ~/vmnet313.patch # re-tar the modules tar -uvf vmnet.tar vmnet-only #delete the previous working directory rm -r vmnet-only # run the vmware module build program. (alternatively just run the GUI app) /usr/lib/vmware/bin/vmware-modconfig --console --install-all 

现在应该成功运行最后一个命令(或vmplayer )。

使用这个包含几个错字修正的vmnet313.patch(参见@nonsleepr的回答)解决了我在Ubuntu 14.04.4 LTS 64位桌面上使用9.0.2到9.02.4升级进行升级的问题。

这段代码是pastebin.com/raw.php?i=p3bkbAMu的内容; 但最后有2个纠正错别字。

 --- vmnet-only/filter.c 2013-10-18 23:11:55.000000000 +0400 +++ vmnet-only/filter.c 2013-12-03 04:16:31.751352170 +0400 @@ -27,6 +27,7 @@ #include "compat_module.h" #include  #include  +#include  #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0) # include  #else @@ -203,7 +204,11 @@ #endif static unsigned int +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) VNetFilterHookFn(unsigned int hooknum, // IN: +#else +VNetFilterHookFn(const struct nf_hook_ops *ops, // IN: +#endif #ifdef VMW_NFHOOK_USES_SKB struct sk_buff *skb, // IN: #else @@ -252,7 +257,14 @@ /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */ /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */ - transmit = (hooknum == VMW_NF_INET_POST_ROUTING); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) + transmit = (hooknum == VMW_NF_INET_POST_ROUTING); +#else + transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING); +#endif + packetHeader = compat_skb_network_header(skb); + ip = (struct iphdr*)packetHeader; 

我遇到了完全相同的问题(Linux Mint 17, 内核3.17

找到的解决方案是:

 # - as root user $ cd /usr/lib/vmware/modules/source $ tar -xvf vmnet.tar # - edit the file vmnet-only/netif.c and replace the line that looks like dev = alloc_netdev(sizeof *netIf, deviceName, VNetNetIfSetup); to dev = alloc_netdev(sizeof *netIf, deviceName, NET_NAME_UNKNOWN, VNetNetIfSetup); $ tar -cvf vmnet.tar vmnet-only/ $ rm -rf vmnet-only/ 

然后再次运行vmplayer。

资源

VMware需要构建一些模块,因为安装程序并不总是具有适合您系统的版本。

安装build-essential。

 sudo apt-get install build-essential 

这将安装编译器和所有其他需求。 重新启动并尝试再次启动vmware,这应该解决它。

如果在未完全升级整个系统的情况下将12.04硬件启用堆栈升级到14.04版本,则vmnet模块可能无法针对vmplayer 6.0.1进行编译。 我的解决方案是升级到最新的6.0.3 vmplayer。 之后没有问题。

我在64位x86 SMP上将内核映像更新为版本3.13.0的“linux-image-3.13.0-43-generic”,同时使用“linux-image-3.8.0-44-generic”运行Ubuntu Precise 12.04(.. 。但没有升级Ubuntu!)

之后,在启动VMPlayer 6.0时,VMPLayer记录的错误消息之一显示“无法构建vmnet.Failed执行构建命令。”,并且VMPlayer无法启动。

我通过删除更新的内核映像来回滚内核映像。

 apt-get remove 3.13.0-43-generic 

还删除了更新的linux-headers。

 sudo apt-get autoremove 

现在,内核映像返回到前一个:

cat / proc / version:Linux版本3.8.0-44-generic(buildd @ tipua)(gcc版本4.6.3(Ubuntu / Linaro 4.6.3-1ubuntu5))#66~precision1-Ubuntu SMP Tue 7月15日04:01 :04 UTC 2014

之后,VMPlayer 6.0恢复正常,现在可以正常运行。

另一个解决方案是使用VMware-Player-7.1.bundle工作替换/usr/lib/vmware/modules/source/vmnet.tar 。 您甚至不必等待安装程序完成,只需将文件复制到其他位置并中止。 接下来运行VMware-Workstation10.bundle (在我的例子中)替换vmnet.tar并运行您正在运行的Workstation

我的vmware版本不包含filter.c; 我发现我需要使用此处列出的补丁修补vmnet:

https://communities.vmware.com/message/2531821

 diff -ur vmnet-only.a/driver.c vmnet-only/driver.c --- vmnet-only.a/driver.c 2014-11-20 20:13:56.000000000 -0500 +++ vmnet-only/driver.c 2015-02-09 15:40:10.916640592 -0500 @@ -265,10 +265,17 @@ { int ret = -ENOTTY; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) { ret = VNetFileOpIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg); } return ret; +#else + if (filp && filp->f_op && filp->f_op->ioctl == VNetFileOpIoctl) { + ret = VNetFileOpIoctl(filp->f_path.dentry->d_inode, filp, iocmd, ioarg); + } + return ret; +#endif } @@ -1191,11 +1198,19 @@ struct inode *inode = NULL; long err; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) if (filp && filp->f_dentry) { inode = filp->f_dentry->d_inode; } err = VNetFileOpIoctl(inode, filp, iocmd, ioarg); return err; +#else + if (filp && filp->f_path.dentry) { + inode = filp->f_path.dentry->d_inode; + } + err = VNetFileOpIoctl(inode, filp, iocmd, ioarg); + return err; +#endif } #endif diff -ur vmnet-only.a/userif.c vmnet-only/userif.c --- vmnet-only.a/userif.c 2014-11-20 20:13:56.000000000 -0500 +++ vmnet-only/userif.c 2015-02-09 15:41:02.150847338 -0500 @@ -523,7 +523,13 @@ .iov_base = buf, .iov_len = len, }; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) return skb_copy_datagram_iovec(skb, 0, &iov, len); +#else + struct iov_iter to; + iov_iter_init(&to, READ, &iov, 1, len); + return skb_copy_datagram_iter(skb, 0, &to, len); +#endif } 

对我来说,这些解决方案不起作用。 我正在使用Ubuntu 14,所以我继续进行任务并在此处找到解决方案。

命令如下:

 sudo apt-get install build-essential linux-headers-`uname -r` 

在32位系统下,您可以使用以下命令安装VMware Player:

 mkdir ~/VMware && cd ~/VMware wget -c http://goo.gl/kkfRJg -O VMware-Player-i386.bundle.tar tar -xvf VMware-Player-i386.bundle.tar chmod +x VMware-Player-6.0.1-1379776.i386.bundle sudo sh VMware-Player-6.0.1-1379776.i386.bundle mkdir ~/VMware && cd ~/VMware wget -c http://goo.gl/Uxia2s -O VMware-Player-x86_64.bundle.tar tar -xvf VMware-Player-x86_64.bundle.tar chmod +x VMware-Player-6.0.1-1379776.x86_64.bundle sudo sh VMware-Player-6.0.1-1379776.x86_64.bundle 

安装后,一切运行良好,我能够安装Windows XP VM,问题最少。 我不得不更新一些驱动程序,但它没有任何问题。 VMWare Player 6似乎是最适合我的Ubuntu版本的。

这在lubuntu 18.04 LTS上对我有用。 我使用的是vmware-player-14.0.0-6661328.x86_64.bundle。 下载并安装vmplayer之后,当我试图构建模块但失败了。 要修复它你必须从这个工作中下载补丁: https : //github.com/mkubecek/vmware-host-modules/tree/player-14.1.1 。 不要下载master,因为:

分支“master”不能用于构建模块,它只包含公共文件,因此它们中的更改可以轻松地合并到所有其他分支中。 要获得实际来源,请查看“真实”分支

下载后,解压缩并cd到提取的目录中并执行

 make sudo make install 

现在启动vmplayer,它应该工作