[解決][VMware 12][CentOS 6] vmware hgfs マウントされない

Kernelのバージョンが上ったら、VMware Toolsでエラーが出るようになって、ファイル共有ができなくなった、その解決方法です。
それは、、、

vmware-tools-distrib/lib/modules/source/vmhgfs.tar 内の
/vmhgfs-only/fsutil.c (74.7KB)

/*
 * Private function implementations.
 */

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0)
 /*
*---------------------------------------------------------------------------- 
*
* set_nlink -- 
*
* Set an inode's link count. 
*
* Results: 
* None 
* 
* Side effects: 
* None 
* 
*---------------------------------------------------------------------------- 
*/ 
static inline void 
set_nlink(struct inode *inode, unsigned int nlink) 
{ 
    inode->i_nlink = nlink;
}
#endif

を一旦解凍して、

#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) 

の一行を

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 0, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 0) || LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 32) 

に修正し、アーカイブに戻すだけ。

該当するエラー(一部)

The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [yes]
Using kernel build system.
make: ディレクトリ `/tmp/modconfig-ulTclh/vmhgfs-only' に入ります
/usr/bin/make -C /lib/modules/2.6.32-754.3.5.el6.centos.plus.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: ディレクトリ `/usr/src/kernels/2.6.32-754.3.5.el6.centos.plus.x86_64' に入ります
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/backdoor.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/backdoorGcc64.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/bdhandler.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/cpName.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/cpNameLinux.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/cpNameLite.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/dentry.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/dir.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/file.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/filesystem.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/fsutil.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/hgfsBd.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/hgfsEscape.o
CC [M]  /tmp/modconfig-ulTclh/vmhgfs-only/hgfsUtil.o
/tmp/modconfig-ulTclh/vmhgfs-only/fsutil.c:117: error: redefinition of ‘set_nlink’
include/linux/fs.h:1892: note: previous definition of ‘set_nlink’ was here
make[2]: *** [/tmp/modconfig-ulTclh/vmhgfs-only/fsutil.o] エラー 1
make[2]: *** 未完了のジョブを待っています....
make[1]: *** [_module_/tmp/modconfig-ulTclh/vmhgfs-only] エラー 2
make[1]: ディレクトリ `/usr/src/kernels/2.6.32-754.3.5.el6.centos.plus.x86_64' から出ます
make: *** [vmhgfs.ko] エラー 2
make: ディレクトリ `/tmp/modconfig-ulTclh/vmhgfs-only' から出ます

The filesystem driver (vmhgfs module) is used only for the shared folder
feature. The rest of the software provided by VMware Tools is designed to work
independently of this feature.

If you wish to have the shared folders feature, you can install the driver by
running vmware-config-tools.pl again after making sure that gcc, binutils, make
and the kernel sources for your running kernel are installed on your machine.
These packages are available on your distribution's installation CD.
[ Press Enter key to continue ]

面倒そうだったので数か月放置していたが、たった一行であっけなく解決!
と云うより、ほかにも修正した方がいい所がたくさんありそうな。。。
後続のエラー”CAF_LIB_DIR not found”, “Common Agent:[失敗]”も自然?消滅!

Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed 
if you want to enable Common Agent (caf). [yes] 
Do you want to enable Common Agent (caf)? [yes] 
CAF_LIB_DIR not found - @libDir@


Detected X server version 1.17.4



Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.

Creating a new initrd boot image for the kernel.

NOTE: both /etc/vmware-tools/GuestProxyData/server/key.pem and 
      /etc/vmware-tools/GuestProxyData/server/cert.pem already exist.
      They are not generated again. To regenerate them by force,
      use the "vmware-guestproxycerttool -g -f" command.

   Starting Virtual Printing daemon:[ done ]

   Checking acpi hot plug[  OK  ]

Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:[  OK  ]

   VMware Automatic Kmods:[  OK  ]

   VM communication interface:[  OK  ]

   VM communication interface socket family:[  OK  ]

   Blocking file system:[  OK  ]

   VMware User Agent:[  OK  ]

   Guest operating system daemon:[  OK  ]

   VGAuthService:[  OK  ]

   Common Agent:[失敗]

Unable to start services for VMware Tools

Execution aborted.

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device
/dev/sr0 ...
Fri Sep 14 19:05:00 2018 vmware-install.pl end

投稿者: うつる? 猫目

猫の目はタマゴ!下界は何と映るか?