How to: Fix Ubuntu VMware Tools vmhgfs Compile Failure








Update: can fix ubuntu 15.04 compile problem while the metod below did work on 14 version only.


While trying to compile support for vmware shared folders on ubuntu with you can get the following error

  CC [M]  /tmp/modconfig-8FzHSB/vmhgfs-only/inode.o
In file included from /usr/src/linux-headers-3.13.0-48-generic/arch/x86/include/asm/percpu.h:44:0,
                 from /usr/src/linux-headers-3.13.0-48-generic/arch/x86/include/asm/preempt.h:5,
                 from include/linux/preempt.h:18,
                 from include/linux/spinlock.h:50,
                 from include/linux/mmzone.h:7,
                 from include/linux/gfp.h:4,
                 from include/linux/mm.h:8,
                 from include/linux/pagemap.h:7,
                 from /tmp/modconfig-8FzHSB/vmhgfs-only/inode.c:29:
/tmp/modconfig-8FzHSB/vmhgfs-only/inode.c: In function ‘HgfsPermission’:

and so on..

Quick and tested fix:

#!/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

You can copy and paste the above lines in a .sh file to execute or run all commands line by line.

Leave a Reply

Your email address will not be published. Required fields are marked *