Ubuntu Hardy: Setting up VMWare-tools from the CLI

First you need the vmware tools tar from the cd image. This is found at /media/cdrom once you've run "install vmware tools" from the server console. When I did this the CD didn't seem to be available even though it looked like it had mounted correctly. To get past this I simply grabbed a copy of /usr/lib/vmware/isoimages/linux.iso and extracted the vmware-tools tar file from there.

Note it's not totally necessary but I ran this after upgrading the system to the latest kernel - these optional steps are as follows:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade # if there's a new kernel available
sudo shutdown -r now # if you've updated the kernel

After unpacking the VMware tools package when simply trying to install the vmware tools from the tar file I got the following error:

tar -xzf VMwareTools-1.0.5-80187.tar.gz
cd vmware-tools-distrib/
sudo ./vmware-install.pl

…Snip…

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-only'
make -C /lib/modules/2.6.24-19-server/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-server'
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpName.o
In file included from include/linux/string.h:11,
                 from /tmp/vmware-config0/vmhgfs-only/cpName.h:18,
                 from /tmp/vmware-config0/vmhgfs-only/cpName.c:18:
include/linux/types.h:40: error: conflicting types for 'uintptr_t'
/tmp/vmware-config0/vmhgfs-only/vm_basic_types.h:161: error: previous declaration of 'uintptr_t' was here
make[2]: *** [/tmp/vmware-config0/vmhgfs-only/cpName.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
make: *** [vmhgfs.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'
Unable to build the vmhgfs module.

To fix this you need to use the open-vmware-tools to create the kernel modules and then install the vmware tools as normal. The problem was solved on the vmware forum: and this fix was then neatly wrapped up on the "Et Cetera" blog.

Installing VMWare-tools on Ubuntu Hardy Heron from the Command Line

Note: These instructions were carried out on kernel 2.6.24-19-server.

First install the headers for your kernel these are needed for compilation:

sudo apt-get install linux-headers-`uname -r`

Now install the following dependency requirements and install the open-vmware-tools:

sudo apt-get install libproc-dev libdumbnet-dev libicu-dev

wget http://mesh.dl.sourceforge.net/sourceforge/open-vm-tools/open-vm-tools-2008.07.01-102166.tar.gz
tar -xzf open-vm-tools-*.tar.gz
cd open-vm-tools-*

./configure --without-x
 make

cd modules/linux

for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done
cd ../../../
mv -f open-vm-tools-*/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/

Finally install the vmware tools as required.

cd vmware-tools-distrib/
sudo ./vmware-install.pl

All being well this should look like this (it's pretty much a case of saying yes to every default)

Creating a new installer database using the tar3 format.

Installing the content of the package.

In which directory do you want to install the binary files? 
[/usr/bin]     

What is the directory that contains the init directories (rc0.d/ to rc6.d/)? 
[/etc] 

What is the directory that contains the init scripts? 
[/etc/init.d] 

In which directory do you want to install the daemon files? 
[/usr/sbin] 

In which directory do you want to install the library files? 
[/usr/lib/vmware-tools] 

The path "/usr/lib/vmware-tools" does not exist currently. This program is 
going to create it, including needed parent directories. Is this what you want?
[yes] 

In which directory do you want to install the documentation files? 
[/usr/share/doc/vmware-tools] 

The path "/usr/share/doc/vmware-tools" does not exist currently. This program 
is going to create it, including needed parent directories. Is this what you 
want? [yes] 

The installation of VMware Tools 1.0.5 build-80187 for Linux completed 
successfully. You can decide to remove this software from your system at any 
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by 
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want 
this program to invoke the command for you now? [yes] 


Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:-ne                                   done

Trying to find a suitable vmhgfs module for your running kernel.

None of the pre-built vmhgfs modules for VMware Tools is suitable for your 
running kernel.  Do you want this program to try to build the vmhgfs module for
your system (you need to have a C compiler installed on your system)? [yes] 

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.24-19-server/build/include] 

Extracting the sources of the vmhgfs module.

Building the vmhgfs module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmhgfs-only'
make -C /lib/modules/2.6.24-19-server/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-server'
  CC [M]  /tmp/vmware-config0/vmhgfs-only/backdoor.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/backdoorGcc32.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/bdhandler.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpName.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLite.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/dentry.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/dir.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/file.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/filesystem.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/fsutil.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsBd.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsEscapeLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/hgfsUtil.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/inode.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/kernelStubsLinux.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/link.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/messageBackdoor.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/message.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/module.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/page.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/request.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/rpcout.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/staticEscape.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/stubs.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/super.o
  CC [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.mod.o
  LD [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmhgfs-only/vmhgfs.mod.o
  LD [M]  /tmp/vmware-config0/vmhgfs-only/vmhgfs.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
cp -f vmhgfs.ko ./../vmhgfs.o
make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'
The module loads perfectly in the running kernel.

pcnet32                35460  0 
Unloading pcnet32 module

Extracting the sources of the vmxnet module.

Building the vmxnet module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmxnet-only'
make -C /lib/modules/2.6.24-19-server/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-19-server'
  CC [M]  /tmp/vmware-config0/vmxnet-only/vmxnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/vmware-config0/vmxnet-only/vmxnet.mod.o
  LD [M]  /tmp/vmware-config0/vmxnet-only/vmxnet.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-19-server'
cp -f vmxnet.ko ./../vmxnet.o
make: Leaving directory `/tmp/vmware-config0/vmxnet-only'
The module loads perfectly in the running kernel.

No X install found.

Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:-ne                                done

   Guest filesystem driver:-ne                                         done

   Guest vmxnet fast network device:-ne                                done

   DMA setup:-ne                                                       done

   Guest operating system daemon:-ne                                   done


The configuration of VMware Tools 1.0.5 build-80187 for Linux for this running 
kernel completed successfully.

You must restart your X session before any mouse or graphics changes take 
effect.

You can now run VMware Tools by invoking the following command: 
"/usr/bin/vmware-toolbox" during an X session.

To make use of the vmxnet driver you will need to rebooot.
Enjoy,

--the VMware team
comments powered by Disqus