VMware Tools and DKMS

I was installing an Ubuntu LTS 8.04 server as a virtual machine on our VMware Infrastructure 3 solution, and wanted to use DKMS for automating kernel module builds.

I searched the web, and found only DKMS solutions for open-vm-tools. One posting I found interesting, was Frederik Vos' nice step-by-step guide.

I had a look at the dkms.conf from open-vm-tools and made the needed changes to make a version for the official VMware Tools. After som playing around, I quickly got the need to automate this, and started building a script.

Couple of hours later, I had an automatic installation of VMware Tools and DKMS.

$ sudo ./vmware-tools-dkms.sh
Already mounted device.. umounting
Mounting /dev/scd0: Ok
Starting installation of VMware Tools version 3.5.0-143128
Removing old version of /usr/src/vmware-tools-3.5.0-143128: Ok
Removing old version of /tmp/vmware-tools-distrib: Ok
Extracting VMwareTools-3.5.0-143128: Ok
Extracting /tmp/vmware-tools-distrib/lib/modules/source/vmblock.tar: Ok
Extracting /tmp/vmware-tools-distrib/lib/modules/source/vmdesched.tar: Ok
Extracting /tmp/vmware-tools-distrib/lib/modules/source/vmhgfs.tar: Ok
Extracting /tmp/vmware-tools-distrib/lib/modules/source/vmmemctl.tar: Ok
Extracting /tmp/vmware-tools-distrib/lib/modules/source/vmxnet.tar: Ok
Generating /usr/src/vmware-tools-3.5.0-143128/dkms.conf: Ok
Removing old dkms definitions: 3.5.0-130756 3.5.0-143128
Installing linux-headers-server: Ok
Installing build-essential: Ok
Adding vmware-tools to dkms: Ok
Building kernel modules for 2.6.24-23-server: Ok
Installing kernel modules for 2.6.24-23-server: Ok
Installing vmware-tools: Ok

To use this, you should download my script or you could just download the dkms.conf

Before running the script, you should start Install/Upgrade VMware Tools on your VMware Server.

This script might work on other versions of Ubuntu having DKMS and VMware Workstation and Server as well.


  1. We found a potential problem; the script downloads dkms.conf from the web, but that did not work on one of our boxes. I have now changed the script and embedded the dkms.conf inside the vmware-tools-dkms.sh so it's no longer needs a working network connection to the Internet.

  2. I found more problems. DKMS is dependent on the meta package linux-headers, the first version of the script did just install the current running version of the header package. When upgrading the kernel, I did not get a new version of the header package, and DKMS did therefore not build new modules.

    I also upgraded my VMware servers, and got a new version of vmware-tools. DKMS is not able to guess what version it should build for, so I added some cleanup in the script (removes all previous vmware-tools from DKMS and from /usr/src)

  3. Just tried out your script on Debian Squeeze and it works great (Even with vmware-tools 8.3.2).

    Thank you very much.

  4. Hi Rune, thank you for this script. I've updated it so that it works with VMWare Fusion 5.0.3 (VMWare Tools 9.2.2-893683). I've also added various other changes, such as allowing specifying the mount point through environment variables (so that this script can be called in an automated manner without needing modifications), as well as support for noexec /tmp partitions. You can find my version at https://gist.github.com/FooBarWidget/5983942