问题描述:
使用vmware10安装tools的时候提示如下错误:
<pre name="code" class="cpp">/tmp/modconfig-ESluHO/vmhgfs-only/inode.c: In function ‘HgfsPermission’:
/tmp/modconfig-ESluHO/vmhgfs-only/inode.c:1978:34: error: ‘struct dentry’ has no member named ‘d_alias’
/tmp/modconfig-ESluHO/vmhgfs-only/inode.c:1978:34: warning: initialisation from incompatible pointer type [enabled by default]
/tmp/modconfig-ESluHO/vmhgfs-only/inode.c:1978:34: warning: (near initialisation for ‘dentry’) [enabled by default]
/tmp/modconfig-ESluHO/vmhgfs-only/inode.c:1978:34: error: ‘struct dentry’ has no member named ‘d_alias’
CC [M] /tmp/modconfig-ESluHO/vmhgfs-only/request.o
make[2]: *** [/tmp/modconfig-ESluHO/vmhgfs-only/inode.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [module/tmp/modconfig-ESluHO/vmhgfs-only] Error 2
make[1]: Leaving directory /usr/src/linux-headers-3.2.0-76-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory/tmp/modconfig-ESluHO/vmhgfs-only'
解决办法:
第一步:
首先解压你的tgz安装包,我这里的安装包名称是
VMwareTools-9.6.1-1378637.tar.gz
1.然后进入源文件文件夹
# cd vmware-tools-distrib/lib/modules/source/
2.将vmhgfs.tar进行解压
# tar cvf vmhgfs.tar
3.编辑解压出来的源文件
# vi vmhgfs-only/inode.c
4.使用vi命令行模式输入命令
":%s/d_alias/d_u.d_alias/g"
(命令为引号内的) 执行之后保存退出.
5.将压缩包压缩回原tar包
# tar cvf vmhgfs.tar vmhgfs-only
6.回到安装目录vmware-tools-distrib进行安装vmtools
# sudo ./vmware-install.pl
第二步:
安装步骤一直回车确认就行,安装好后,设置下虚拟机的共享文件夹,就OK啦!