VMWare Tools Install Error – The path “/usr/bin/gcc” is not valid path to the gcc binary.
Recently I cloned a Debian virtual machine from an ESX 4 host and copied it to a laptop for local use in VMWare Player. After moving a VM to such a different environment I fully expected to have to reinstall vmware-tools. So I mounted the vmware-tools by selecting “Install VMWare Tools” from the player menu, untarred the package and ran the install script. When the installer got to the configure stage I was given the message:
Searching for GCC... The path "/usr/bin/gcc" is not valid path to the gcc binary. Would you like to change it? [yes]
I found this odd since /usr/bin/gcc existed. Eventually I gave up, with plans to take on the error the next day. Later that evening I was setting up a fresh new VM on an ESXi host and ran into the same problem. Now, this was very odd. This was a fresh install of Debian directly on an ESX host. After about 30 minutes of Googling I had found many others with the same problem. Combining the information in all the forum threads and blog posts I assembled a theory on the cause and more importantly, a solution.
The problem seems to be caused by the kernel being compiled with a different version of gcc than the one that is currently installed and active on the system. For example, if the kernel (which comes pre-compiled from the apt repositories) was compiled with gcc 4.3 and gcc 4.4 is currently installed and active on the system you will see this error.
The solution is to install the correct version of gcc and activate it. This is easy since you can have multiple versions of gcc installed on the same system. For Debian based systems (including Ubuntu) the following commands should do the trick.
Run the following commands as root. You will need to modify the gcc version number to fit the version required by your kernel but 4.3 has been the version that works for me.
apt-get install build-essential apt-get install gcc-4.3 linux-headers-`uname -r` export CC=/usr/bin/gcc-4.3
Next run the vmware-tools installer and all should be well.











