无法运行 VMware - 无法构建 vmnet

无法运行 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.

答案1

我能够使用以下方法修复 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)现在应该可以成功运行。

答案2

使用这个 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 <linux/mutex.h>
 #include <linux/netdevice.h>
+#include <linux/version.h>
 #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
 #   include <linux/module.h>
 #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;

答案3

我遇到了完全一样的问题(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。

来源

答案4

如果您将 12.04 硬件支持堆栈升级到 14.04 版本,而没有完全升级整个系统,则 vmnet 模块可能无法为 vmplayer 6.0.1 编译。我的解决方案是升级到最新的 6.0.3 vmplayer。之后没有出现任何问题。

相关内容