8

将我的来宾 ubuntu 升级到 linux-image-3.13.0-46 后,安装 vmware-tools 时出现错误,我无法再共享文件夹。

我在 Windows 8 和 Ubuntu 14.04 LTS 主机上都运行了 vmware player 7.0.0 build-2305329,在安装过程中出现以下错误注销:

                 from /tmp/modconfig-NVbKuD/vmhgfs-only/inode.c:29:
include/linux/kernel.h:793:27: error: ‘struct dentry’ has no member named ‘d_alias’
  const typeof( ((type *)0)->member ) *__mptr = (ptr); \
                           ^

有没有关于这个问题的解决方法?

谢谢

4

4 回答 4

11

vmware-tools-distrib-9.9.2-2496486:

我已通过转到 vmhgfs.tar 所在的目录(在我的情况下为 /usr/lib/vmware-tools/modules/source),解压缩 tar 并手动编辑 inode.c 来解决问题。

在第 1925 行(只需搜索“d_alias”即可找到确切的行),您需要添加一个 if。最后看起来像这样:

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
                           d_alias) {
#else
                           d_u.d_alias) {
#endif

然后再次在 1983 行附近(再次搜索“d_alias”):

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
         struct dentry *dentry = list_entry(pos, struct dentry, d_alias);
#else
         struct dentry *dentry = list_entry(pos, struct dentry, d_u.d_alias);
#endif

警告:不确定内核版本,但我已将 3,13,0 放在那里,尽管我的 Ubuntu 报告:

# uname -a
Linux md-ubuntu 3.13.0-46-generic #76-Ubuntu SMP Thu Feb 26 18:52:13 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

这在 3.13.0-45 中运行良好。

因此,如果您降级内核,上述黑客可能无法正常工作。

然后你需要再次打包 tar 存档(只需将旧的移开:

# mv vmhgfs.tar vmhgfs.tar.orig

并再次打包目录:

# tar cvf vmhgfs.tar vmhgfs-only

)

希望能帮助到你。

于 2015-02-27T14:48:21.103 回答
1

这个补丁应该可以解决问题。

编辑 工作要点补丁

使用说明:

cd vmware-tools-distrib/lib/modules/source/
tar -xvf vmhgfs.tar
cd vmhgfs-only
patch inode.c < inode.patch
cd ..
mv vmhgfs.tar vmhgfs.tar.orig
tar cvf vmhgfs.tar vmhgfs-only
cd vmware-tools-distrib
sudo ./vmware-install.pl
于 2015-02-18T08:49:32.830 回答
0

至于 VMWare Fusion,该错误已在 7.1.2 版本 [1] 中修复。vmware-tools 的版本是 9.9.3。

[1] VMware Fusion 7.1.2 发行说明https://www.vmware.com/support/fusion/doc/fusion-712-release-notes.html

于 2015-06-26T02:47:20.383 回答
0

VMware 支持并推荐 open-vm-tools 用于 Ubuntu。因此,如果您在使用 VMware Tools 时遇到问题,可以轻松安装 open-vm-tools。希望能帮助到你。

于 2015-10-13T11:27:55.197 回答