Ubuntu – vmhgfs module not compilable for VMware Tools 9.9.0 (Fusion7.1) after Ubuntu Linux kernel update to 3.13.0-46-generic

14.04compilingkernelvmware

vmhgfs module not compilable for VMware Tools 9.9.0 (Fusion7.1) and VMware Tools 9.9.2 (Fusion7.1.1 Build 2496486) after Ubuntu Linux kernel update to 3.13.0-46-generic (Febr. 2015) (Shared Folder Feature of VMware Tools not working in Ubuntu 14.04 LTS (Guest) on MacOSX Yosemite (Host))? 


Hello Community and the VMware Developer Team,


On February, 13th 2015 we lost the Shared Folder Feature between Ubuntu and MacOSX. Probably, the update of the Linux kernel to 3.13.0-46-generic caused this problem (although the existing, compiled vmhgfs module of the VMware Tools in Ubuntu wouldn't be damaged by the Linux kernel update!). We use VMware Fusion 7.0.0 with Ubuntu 14.04 LTS and MacOSX for one year without problems with older Linux kernels.
We updated to VMware Fusion 7.1.0 and Fusion7.1.1 Build 2496486 with VMware Tools 9.9.2 in the hope to fix the Shared Folder Feature problem that occured first in vers. 7.0.0.

We can suppose that there is an incompatibility between the compiled vmhgfs module and the new Linux kernel 3.13.0-46-generic.

We tried to reinstall VMware tools 9.9.0 and vers. 9.9.2 but the vmhgfs module couldn't be compiled and the Shared Folder Feature is not working. All other VMware tool features are working fine.

In Ubuntu 14.04 LTS the terminal command lsmod | grep "vm." lists no vmhgfs module

During vmhgfs module compilation there were several "errors" near "/vmhgfs-only/" and "make[]:"


Here is one of our terminal journals for you: 


include/linux/compiler-gcc4.h:14:34: error: ‘struct dentry’ has no member named ‘d_alias’
#define __compiler_offsetof(a,b) __builtin_offsetof(a,b)
                                  ^
include/linux/stddef.h:17:31: note: in expansion of macro ‘__compiler_offsetof’
#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
                               ^
include/linux/kernel.h:794:29: note: in expansion of macro ‘offsetof’
  (type *)( (char *)__mptr - offsetof(type,member) );})
                             ^
include/linux/list.h:687:40: note: in expansion of macro ‘container_of’
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
                                        ^
include/linux/list.h:698:15: note: in expansion of macro ‘hlist_entry’
     ____ptr ? hlist_entry(____ptr, type, member) : NULL; \
               ^
include/linux/list.h:710:13: note: in expansion of macro ‘hlist_entry_safe’
       pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member))
             ^
/tmp/modconfig-h4Zwi0/vmhgfs-only/inode.c:1920:7: note: in expansion of macro ‘hlist_for_each_entry’
       hlist_for_each_entry(dentry,
       ^
make[2]: *** [/tmp/modconfig-h4Zwi0/vmhgfs-only/inode.o] Error 1
make[1]: *** [_module_/tmp/modconfig-h4Zwi0/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-46-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-h4Zwi0/vmhgfs-only'

And /mnt/hgfs is empty but folder sharing is enabled for Mac's "Documents" directory for example. If we run vmware-hgfsclient in a terminal, we get the list of shared folders but /mnt/hgfs is empty. 


Could you fix the incompatibility between the vmhgfs module and the new Linux kernel 3.13.0-46-generic, please?

Best regards,

Toni


Best Answer

The tools can be patched manually. In vmhgfs.tar, inode.c d_alias must be changed to d_u.d_alias , put back to the tar and then recompile tools.

A script that does that (tested on 32-bit ubuntu 14.04, vmware workstation 11.1 on a windows host) is here:

#!/bin/sh -x
cd /usr/lib/vmware-tools/modules/source
tar xf vmhgfs.tar
grep -q d_u.d_alias vmhgfs-only/inode.c && echo "already patched" && exit 0
sed -i -e s/d_alias/d_u.d_alias/ vmhgfs-only/inode.c
cp -p vmhgfs.tar vmhgfs.tar.orig
tar cf vmhgfs.tar vmhgfs-only
vmware-config-tools.pl -d -m

NOTE: this makes the tools incompatible with older kernel versions, i.e. 3.13.0-45.

Related Question