If one attempts to install VMware Tools (VMwareTools-9.6.2-1688356) on Centos7 running the 3.10 kernel (i.e. 3.10.0-123.el7.x86_64), you will most likely see the following error:

In file included from /tmp/modconfig-5vxwsx/vmhgfs-only/inode.c:36:0:
/tmp/modconfig-5vxwsx/vmhgfs-only/inode.c: In function ‘HgfsPermission':
/tmp/modconfig-5vxwsx/vmhgfs-only/./shared/compat_dcache.h:57:38: error: ‘struct dentry’ has no member named ‘d_count’
#define compat_d_count(dentry) dentry->d_count
/tmp/modconfig-5vxwsx/vmhgfs-only/inode.c:1904:23: note: in expansion of macro ‘compat_d_count

Although most of the features will get installed, one will not have the ability to use VMware Shared Folders for file sharing between guest and host.

The issue is due to a VMware Tools bug which we can repair via a simple script. This script will replace a reference to kernel 3.11 with kernel 3.10 and then run the installer with default options for non-interactive installation.

Verify that you have the following packages installed before running:

yum -y install kernel-devel gcc dracut make perl

mkdir /tmp/vmfusion
mkdir /tmp/vmfusion-archive
mount /dev/sr0 /tmp/vmfusion
tar xzfv /tmp/vmfusion/VMwareTools-*.tar.gz -C /tmp/vmfusion-archive
tar xfv /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/vmhgfs.tar -C /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/
sed -i -e '/KERNEL_VERSION/{s/3, 11, 0/3, 10, 0/}' /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/vmhgfs-only/shared/compat_dcache.h
rm -rf /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/vmhgfs.tar
tar cfv /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/vmhgfs.tar -C /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/ vmhgfs-only
rm -rf /tmp/vmfusion-archive/vmware-tools-distrib/lib/modules/source/vmhgfs-only/
/tmp/vmfusion-archive/vmware-tools-distrib/vmware-install.pl --default
umount /tmp/vmfusion
rm -rf  /tmp/vmfusion
rm -rf  /tmp/vmfusion-archive

If you exerienced this issue while attempting to build a Vagrant box with Packer, here is a shell provisioner script that I've tested and seems to be working fine: vmtools.sh


comments powered by Disqus