Reprint a solution to the Windows and CentOS virtual machine Shared host directory problem, the method differs from Ubuntu virtual machine

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.