An extremely unwieldy title.

This is my set-up for using Linux. My previous experience with Linux, admittedly many years ago, was filled with pain and suffering of endlessly trying different device drivers. Virtual machines on Windows seems to be a good way of skirting that problem. Here is a nice review of virtualization software on the desktop.

I am running a virtual machine using VMWare Workstation 6 on a laptop with Windows XP 32-bit SP 2, running the very nicely packaged Ubuntu 8.04.

None of these choices should be controversial. I chose widely-used components intentionally to make sure most the kinks are ironed out. That is why I was surprised when I had difficulty with installing Shared Folders, where the installer would fail with compilation errors.

The way I interpret this is that while each individual component I am using is popular, the set of people who actually use the exact some package is small. But that is the beauty of the internet… I would like to post my fix to this problem to add to the long tail.

The problem: during installation, we run vmware-config-tools.pl. While installing the shared folder feature–the hgfs component–compilation would fail, complaining about redefinition of uintptr_t.

The issue: in its attempt to sort out 32-bit versus 64-bit OS, the hgfs header file vm_basic_types.h somehow manages to re-define the size of unsigned int pointer as “unsigned int”, whereas the Linux header file types.h defines it as “unsigned long”. The 2 are both 4 bytes long anyway on a 32-bit machine. But gcc (4.2.3) is confused.

The fix:
1. In vm_basic_types.h:

#ifndef _LINUX_TYPES_H
typedef uint32 uintptr_t;
#endif

2. In Linux headers file types.h:

#ifndef _VM_BASIC_TYPES_H
typedef unsigned int uintptr_t;
#endif

3. Edit the right copy of vm_basic_types.h file. One could expand the code tar file in the VMWare-tools distribution, edit the file, re-tar, and re-run the installer… which feels surgical. A more medical solution is to pause the installation process with Ctl-Z right as it starts hgfs installation. Go to /tmp/vmware-configN/vmhgfs-only directory (where N is an incrementing number depending on how many times you invoked the installer program), and change the expanded header file there.

Now hgfs should compile and install!