The following error was found during the installation of Vmtools on the CentOS virtual machine
/tmp/modconfig-ygOywn/vmhgfs-only/inode.c: 在函数‘HgfsPermission’中: tmp/modconfig-ygOywn/vmhgfs-only/./shared/compat_dcache.h:57:38: 错误:‘struct dentry’没有名为‘d_count’的成员 #define compat_d_count(dentry) dentry->d_count ^ /tmp/modconfig-ygOywn/vmhgfs-only/inode.c:1904:23: 附注:in expansion of macro compat_d_count’ int dcount = compat_d_count(dentry);
This leads to the virtual machine CentOS cannot share the directory with Windows, it should be noted that the solution of the CentOS virtual machine is different from the Ubuntu virtual machine.
Here, we need to modify the. h file in Source Compat_dcacche.
[Root@localhost ~]# cd/tmp/vmware-tools-distrib/lib/modules/source/
[Root@localhost source]# tar-xf vmhgfs.tar– Extract Vmhgfs.tar, there is a vmhgfs-only folder
[Root@localhost source]# CD vmhgfs-only/– into the unpacked directory
[Root@localhost vmhgfs-only]# CD shared/
[Root@localhost shared]# vim compat_dcache.h– Open header file
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)#define compat_d_count(dentry) d_count(dentry)#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)#define compat_d_count(dentry) dentry->d_count#else#define compat_d_count(dentry) atomic_read(&dentry->d_count);#endif
Here is an error, do not know why this, will
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)
The following # define changes to
#define compat_d_count(dentry) d_count(dentry)
After changing the source, re-archive
[Root@localhost source]# tar-cf Vmhgfs.tar vmhgfs-only/
[Root@localhost Source] Cd/tmp/vmware-tools-distrib
[Root@localhost vmware-tools-distrib]#./VMWARE-INSTALL.P
Re-install. This has succeeded ...
Reprint a solution to the Windows and CentOS virtual machine Shared host directory problem, the method differs from Ubuntu virtual machine