
At the moment, the vmware-tools provided with workstation 6.0.2 do not compile under Ubuntu Gutsy 7.10.
Only one module fails: vmhgfs. This module allow one to share a folder on the host with the guest.
This tutorial will show the few changes required in order to be able to compile this module, and therefore ease file sharing between the host and the guest.
The original error that one might get while compiling the tools will have the following:
CC [M] /tmp/vmware-config0/vmhgfs-only/filesystem.o
/tmp/vmware-config0/vmhgfs-only/filesystem.c: In function ‘HgfsInitFileSystem':
/tmp/vmware-config0/vmhgfs-only/filesystem.c:582: error: too few arguments to function ‘kmem_cache_create'
/tmp/vmware-config0/vmhgfs-only/filesystem.c:593: error: too few arguments to function ‘kmem_cache_create'
In this tutorial, I will consider that the vmware-tools's .tar.gz is already untarred in your home dir and that user can gain root credential with sudo.
First of all, you need to get in the working directory of vmware-tools:
$ cd ~/vmware-tools-distrib
Then, we will back up the old vmhgfs.tar:
$ mv lib/modules/source/vmhgfs.tar vmhgfs.tar.orig
Now, we untar vmhgfs.tar.orig:
$ tar -xvf vmhgfs.tar.orig
Now edit vmhgfs-only/compat_slab.h:
$ vim vmhgfs-only/compat_slab.h
and change:
if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR)
with
if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR)
Finally, re-tar vmhgfs-only directory in lib/modules/source/vmhgfs.tar:
$ tar -cvf lib/modules/source/vmhgfs.tar vmhgfs-only
Then copy this new tar into /usr/lib/vmware-tools/modules/source/ :
$ sudo cp lib/modules/source/vmhgfs.tar /usr/lib/vmware-tools/modules/source/vmhgfs.tar
That's it, now you can re-run the tools config script:
$ sudo vmware-config-tools.pl








Missing file: vmhgfs-only/compat_slab.h
There is no file named compat_slab.h in my vmware-tools-distrib?
I'm using VmWare-server v1.0.4 build-56528
Here's what I get: (nothing):
### drwxr-xr-x 3 root root 4.0K 2007-09-06 17:16 vmhgfs-only
### -r--r--r-- 1 root root 330K 2007-09-06 17:16 vmhgfs.tar.orig
find . -name '*slab*' returns nothing...
Any ideas?
Fix for missing compat_slab.h file
I found a fix for this at:
http://kamilkisiel.blogspot.com/2007/11/installing-vmware-tools-on-kernel-2622.html
Here's what that page says (in case the link dies):
Fortunately the fix is fairly straightforward. Go to the vmware-tools-distrib/lib/modules/source directory, and untar the driver's tar file: tar xvf vmhgfs.tar Now edit vmhgfs/driver.c and change lines 44 and 45 from #define INODE_SET_II_P(inode, info) do { (inode)->u.generic_ip = (info); } while (0) #define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->u.generic_ip) to #define INODE_SET_II_P(inode, info) do { (inode)->i_private = (info); } while (0) #define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->i_private) Also, remove line 763: inode->i_blksize = HGFS_BLOCKSIZE; Now just tar everything back up (tar cvf vmhgfs.tar vmhgfs-only) and rerun vmware-config.pl, or vmware-install.pl if you haven't yet installed the tools.Network problem as a side-effect
I used this how-to to successfully get the hgfs module working, but whenever i run vmware-config-tools.pl with this modification I lose my network connection in the ubuntu VM (eth0 seems to pretty much disappear). Re-running the config script with the modification removed gets networking going again. Any idea what's going wrong here (and how to get both working)?
Fix for network problem
To fix your network problem (ethX disappearing), do this:
To use the vmxnet driver, restart networking using the following commands:
sudo /etc/init.d/networking stop
sudo rmmod pcnet32
sudo rmmod vmxnet
sudo depmod -a
sudo modprobe vmxnet
sudo /etc/init.d/networking start