Getting Vmware Tools VMHGFS working on BackTrack 4 Beta

Posted by Zac on Apr 16th, 2009 and filed under Security, Software. You can follow any responses to this entry through the RSS 2.0. You can skip to the end and leave a response. Pinging is currently not allowed.

I came across this the other day on the BT4 beta blog. It is really handy when running BT4 in a VMWare session where you may have tools, or store logs on the host machine

Getting Vmware Tools VMHGFS working on BackTrack 4 Beta: “The stock Vmware Tools compile almost perfectly on BackTrack 4, with the exception of VMHGFS, which provides file sharing between the guest and host machine.


The compile error looks like this :

CC [M]  /tmp/vmware-config0/vmhgfs-only/module.oCC [M]  /tmp/vmware-config0/vmhgfs-only/page.o/tmp/vmware-config0/vmhgfs-only/page.c: In function ‘HgfsDoWriteBegin’:/tmp/vmware-config0/vmhgfs-only/page.c:763: warning: ISO C90 forbids mixed declarations and code/tmp/vmware-config0/vmhgfs-only/page.c: In function ‘HgfsWriteBegin’:/tmp/vmware-config0/vmhgfs-only/page.c:867: error: implicit declaration of function ‘__grab_cache_page’/tmp/vmware-config0/vmhgfs-only/page.c:867: warning: assignment makes pointer from integer without a castmake[2]: *** [/tmp/vmware-config0/vmhgfs-only/page.o] Error 1make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] Error 2make[1]: Leaving directory `/usr/src/linux-source-2.6.28.1'make: *** [vmhgfs.ko] Error 2make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'Unable to build the vmhgfs module.

A quick Google search brought me to a vmhgfs patch that fixes this compile error.
To fix this:

0) Extract kernel sources and build dependancy scripts!
1) Start the Vmware tools install
2) Copy the vmware tools to /tmp
3) Replace the vmhgfs package with the patched one and install vmware tools

root@bt# tar zxpf VMwareTools-7.9.3-159196.tar.gzroot@bt# cd vmware-tools-distrib/root@bt# cd lib/modules/source/root@bt# rm vmhgfs.tarroot@bt# wget www.offensive-security.com/vmhgfs.tarroot@bt# cd /tmp/vmware-tools-distrib/root@bt# ./vmware-install.pl

Don’t forget to enable file sharing in VMWare after installing the tools.

After a restarting the vmware-tools service (or a reboot), you should see your share with a ‘mount’ command.

root@bt# mount |grep hgfs

.host:/ on /mnt/hgfs type vmhgfs (rw,ttl=5)

root@bt# ls -l /mnt/hgfs/

total 1

drwxr-xr-x 1 501 dialout 204 2009-04-12 11:48 bt4

root@bt#

(Via Back|Track LiveCD Blog.)

Leave a Reply