So, you've gone and upgraded to or installed Ubuntu 8.04 Hardy Heron to a VMware virtual machine, but you find that the guest-host directory sharing doesn't work, amongst other things.
You've gone on to do the usual VMware tools install/upgrade via the VM->Install VMware Tools... feature in VMware Workstation, but you run into the following error when compiling the vmhgfs module:
Code:
make -C /lib/modules/2.6.24-19-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-generic'
CC [M] /tmp/tmp/vmhgfs-only/backdoor.o
CC [M] /tmp/tmp/vmhgfs-only/backdoorGcc32.o
CC [M] /tmp/tmp/vmhgfs-only/bdhandler.o
CC [M] /tmp/tmp/vmhgfs-only/cpName.o
In file included from include/linux/string.h:11,
from /tmp/tmp/vmhgfs-only/cpName.h:18,
from /tmp/tmp/vmhgfs-only/cpName.c:18:
include/linux/types.h:40: error: conflicting types for ‘uintptr_t’
/tmp/tmp/vmhgfs-only/vm_basic_types.h:170: error: previous declaration of ‘uintptr_t’ was here
make[2]: *** [/tmp/tmp/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/tmp/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-generic'
make: *** [vmhgfs.ko] Error 2
Below paragraph is some technical info that most users can skip over:
Well, it seems that VMware has not updated their tools to work well with Linux kernel 2.6.24, and the Linux kernel team threw in a definition of uintptr_t outside the usual place it's defined -- in stdint.h. This may mean that they determined that inclusion of stdint.h is not safe to include in kernel code.
Here are the steps to fixing this:
- Perform the VM->Install VMware Tools... action in VMware to get the VMware Tools virtual CD mounted in Ubuntu.
- Bring up a terminal window, existing user is fine (does not have to be root).
- Make sure build-essential package, and the patch package are installed using:
Code:
sudo aptitude install build-essential
sudo aptitude install patch
(I put them separately so you could more easily tell if one or the other failed) - Change to a temporary directory:
- expand the VMware Tools:
Code:
tar zxvf /media/cdrom/VMwareTools-6.0.4-93057.tar.gz
- expand the vmhgfs source code also in the current temp directory using:
Code:
tar xvf vmware-tools-distrib/lib/modules/source/vmhgfs.tar
You should now have a directory called vmhgfs-only which was expanded from the vmhgfs.tar file. - Now, download the patch file I have put together and attached to this post. This patch file fixes the vmhgfs module sources so they properly compile for kernel 2.6.24.
NOTE: This will only apply to the tools package included with Workstation 6.0.4 build 93057. YMMV with other VMware products and versions.
- Apply the patch file to the sources we just expanded. From the directory where vmhgfs-only resides, execute:
Code:
patch -p1 < /path/to/vmhgfs_6.0.4-93057__linux-2.6.24_fix.patch.txt
- Force remove the old vmhgfs.tar file from the extracted tools install files, as the permissions on this file are read-only.
Code:
rm -f vmware-tools-distrib/lib/modules/source/vmhgfs.tar
- Package the modified sources up back into a tar file, replacing the original removed vmhgfs.tar file in vmware-tools-distrib:
Code:
tar cvf vmware-tools-distrib/lib/modules/source/vmhgfs.tar vmhgfs-only
- Make the permissions of the vmhgfs.tar file the same as the original one -- which I see as being -r--r--r-- (444 octal) (this is optional)
Code:
chmod 444 vmware-tools-distrib/lib/modules/source/vmhgfs.tar
- Now all that is left to do is execute the VMware tools installer from the vmware-tools-distrib directory, just like you would normally when installing VMware tools. This time, however, the vmhgfs module should compile successfully when configuring.
Code:
cd vmware-tools-distrib
sudo ./vmware-install.pl
NOTE: The patch file has been named with a .txt extension so that it will properly upload to the Ubuntu forums. This should have no effect on the way the patch file applies.
Bookmarks