Shared Folders Error in 13.04 - VMware Tools 9.2.3 - vmhgfs problem

Asked by Charlie Smith

After installing VMware Tools without a problem, when I run the vmware-config-tools.pl script there is an error when trying to build/load the vmhgfs driver. The gcc, binutils and make modules are installed. (See error messages below.)

Since the driver is not loaded, the Shared Folders option does not work. Any ideas how to solve this problem?

(There are no problems when running Ubuntu 12.04 or 12.10 in the same setup of Vmplayer 5.02 with Vmware Tools 9.2.3.)

System Info:
Windows 7 host, Ubuntu 13.04 32 bit Guest - Daily build: 16 April 2013, VMware Tools 9.2.3

Code:

/tmp/modconfig-5e6o62/vmhgfs-only/inode.c: In function ‘HgfsTruncatePages’:
/tmp/modconfig-5e6o62/vmhgfs-only/inode.c:888:4: error: implicit declaration of function ‘vmtruncate’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-5e6o62/vmhgfs-only/inode.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-5e6o62/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-18-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-5e6o62/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 ]

End Code

This problem has been reported in the Ubuntu Forum under thread

http://ubuntuforums.org/showthread.php?t=2136277

and it has since been confirmed by three other users.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Fabio Marconi (fabiomarconi) said :
#1

Thank you for taking the time to report this issue and helping to make Ubuntu better. Examining the information you have given us, this does not appear to be a bug report so we are closing it and converting it to a question in the support tracker. We understand the difficulties you are facing, but it is better to raise problems you are having in the support tracker at https://answers.launchpad.net/ubuntu if you are uncertain if they are bugs. You can also find help posting your problem in the support forum of your local Ubuntu's community http://loco.ubuntu.com/ or asking at http://askubuntu.com. For help on reporting bugs, see https://help.ubuntu.com/community/ReportingBugs.

Revision history for this message
Carlos Viegas (cmdviegas) said :
#2

A workaround for this problem is to edit 'inode.c' and change the line '888' to remove 'compat_truncate' function call (that is responsible for this problem on kernels 3.8.x). This file is inside 'vmware-tools-distrib', so you need to perform the following steps:

Extract VMWare-Tools (probably you will get a folder called vmware-tools-distrib).
Then:
> cd /vmware-tools-distrib/lib/modules/source
> tar xf vmhgfs.tar
> cd vmhgfs-only/
> sudo gedit inode.c
Go to line 888: result = compat_vmtruncate(inode, newSize);
And change it to: result = 0;
Then save the file and exit gedit.
> cd ..
> rm -rf vmhgfs.tar
> tar cf vmhgfs.tar vmhgfs-only/
> rm -rf vmhgfs-only/

Now restart the installing procedure. It worked for me in Xubuntu 13.04.

Revision history for this message
Carlos Viegas (cmdviegas) said :
#3

I made a patch to simplify my workaround...

You just need to download these two files:
https://dl.dropboxusercontent.com/u/16521384/vmhgfs-fix.sh
https://dl.dropboxusercontent.com/u/16521384/vmtools.inode.c.patch

Instructions:
Create a folder and copy 'vmhgfs-fix.sh', 'vmtools.inode.c.patch' and 'VMwareTools-9.x.x.tar.gz' inside.
If needed, give permission to execute vmhgfs-fix.sh: chmod +x vmhgfs-fix.sh
Then type: ./vmhgfs-fix.sh

This script will extract VMwareTools, patch it and make it ready to be installed.

It is working for me at Xubuntu 13.04 (but it will run fine on Ubuntu, Kubuntu, Edubuntu 13.04...)

vmhgfs-fix.sh:

#!/bin/bash
#
# Patch to fix VMware-Tools installation in kernel 3.8.x
# Working for Ubuntu 13.04 (Xubuntu and Kubuntu also)
#

# Get VMwareTools file (it should be in the default format VMwareTools-9.x.x...)
VMFILE=`ls | grep VMwareTools-9.*`

if [[ ! $VMFILE ]]
then
  printf "\nERROR: \nVMwareTools-9.(...).tar.gz not found.\n\nYou should place it in the current folder and/or \nRename it as VMwareTools-9... (default format name)\n\n"
  exit
fi

# Check for vmware-tools-distrib folder
if [[ ! -d vmware-tools-distrib ]]
then
  printf "\nExtracting VMware-tools...\n"
  # Extract VMware Tools
  tar xf $VMFILE
else
  printf "\n/vmware-tools-distrib already exists.\nPlease remove it before applying this patch.\n\n"
  exit
fi

# Record the current directory
PATCH_DIR=$PWD

printf "\nApplying patch to VMware-Tools...\n\n"
sleep 3
pushd vmware-tools-distrib/lib/modules/source

# Make a backup of vmhgfs.tar
cp vmhgfs.tar vmhgfs.tar.backup
# Extract vmhgfs.tar
tar xf vmhgfs.tar
# Go to extracted vmhgfs.tar
pushd vmhgfs-only/
# Apply patch
patch -p1 < $PATCH_DIR/vmtools.inode.c.patch
popd
# Remove old vmhgfs.tar
rm -rf vmhgfs.tar
# Repack new vmhgfs.tar
tar cf vmhgfs.tar vmhgfs-only
# Remove vmhgfs-only dir which is not needed
rm -rf vmhgfs-only
popd

printf "\nPatch Applied!\n"
printf "Now try to install VMware-Tools.\n\n"

vmtools.inode.c.patch:

--- ./inode.c 2013-02-26 02:18:24.000000000 +0000
+++ ./inode.c 2013-05-03 00:34:59.995053850 +0100
@@ -885,7 +885,8 @@
    ASSERT(inode);

    LOG(4, (KERN_DEBUG "VMware hgfs: HgfsTruncatePages: entered\n"));
- result = compat_vmtruncate(inode, newSize);
+ //result = compat_vmtruncate(inode, newSize);
+ result = 0; // Fix for kernels 3.8.x due to an error in truncate function
    if (result) {
       LOG(4, (KERN_DEBUG "VMware hgfs: HgfsTruncatePages: vmtruncate failed "
               "with error code %d\n", result));

Revision history for this message
vorbisset (vorbisset) said :
#4

worked on 12.04 for me

error :

/tmp/modconfig-ncbUfe/vmhgfs-only/inode.c: In function ‘HgfsTruncatePages’:
/tmp/modconfig-ncbUfe/vmhgfs-only/inode.c:888:4: error: implicit declaration of function ‘vmtruncate’ [-Werror=implicit-function-declaration]
cc1: some warnings being treated as errors
make[2]: *** [/tmp/modconfig-ncbUfe/vmhgfs-only/inode.o] Error 1
make[1]: *** [_module_/tmp/modconfig-ncbUfe/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-29-generic'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/modconfig-ncbUfe/vmhgfs-only'

solution :

Extract VMWare-Tools (probably you will get a folder called vmware-tools-distrib).
Then:
> cd /vmware-tools-distrib/lib/modules/source
> tar xf vmhgfs.tar
> cd vmhgfs-only/
> sudo gedit inode.c (OR vi inode.c)
Go to line 888: result = compat_vmtruncate(inode, newSize);
And change it to: result = 0;
Then save the file and exit gedit. OR vi ==> :wq!
> cd ..
> rm -rf vmhgfs.tar
> tar cf vmhgfs.tar vmhgfs-only/
> rm -rf vmhgfs-only/
Now restart the installing procedure. It worked for me in Xubuntu 13.04.

Revision history for this message
CHANGALRAYUDU (changal-bcr) said :
#5

Hai,

I thanked 'Carlos Viegas (cmdviegas) '

for providing solution to successfully install vmware -tools on ununtu12.04 .

and it works for shared folders from host to vm ware.

Thanks " Carlos.........." once again .........

it rocks

Thanks Regards
BC Rayudu

Can you help with this problem?

Provide an answer of your own, or ask Charlie Smith for more information if necessary.

To post a message you must log in.