1. Introduction

There are many virtualization software choices. One of the first companies to provide many end-user tools and support for different guest operating systems is VMWare. To enable and facilitate better integration between the host and guest such as time synchronization, file and clipboard sharing, driver optimization, and others, VMWare products often provide special utility packages such as VMWare Tools.

In this tutorial, we talk about ways to install the VMWare Tools package on Linux as a guest operating system. To begin with, we show the fairly easy automatic package installation that newer VMWare Tools versions support. After that, we focus on the process for older versions. First, we ensure the software has the proper interface to the kernel. Next, we provide the tools to build and link the package. Finally, we go through the steps for manual installation via virtual CD that ships with many VMWare applications.

Unless otherwise specified, all installations are performed on the guest operating system.

We tested the code in this tutorial on Debian 12 (Bookworm) with GNU Bash 5.2.15. It should work in most POSIX-compliant environments.

2. Automatic VMWare Tools Package Installation

Newer VMWare Tools versions come in the form of a prepackaged bundle called open-vm-tools.

Notably, to install it, we can just use the package manager of any major Linux distribution:

$ apt-get install open-vm-tools

In fact, VMWare also offers the open-vm-tools-desktop additional package that depends on open-vm-tools and Xorg libraries:

$ apt-get install open-vm-tools-desktop

Now, we should be able to see major visual improvements to our interface.

This should take care of all other dependencies.

If using an older VMWare Tools version, we might need to take care of the dependencies one by one and build the bundle at the end.

3. Install Kernel Headers

Perhaps one of the most challenging steps when attempting to build kernel-linked packages is acquiring and deploying the relevant kernel headers. This is no different for VMWare Tools.

Kernel headers are part of the kernel source code that roughly shows the interface of a given kernel version.

3.1. Basic Install

As long as we have the proper repositories configured in our package manager, this process should be fairly simple:

$ apt-get install linux-headers-$(uname -r)

In this case, we use APT to install the current linux-headers-<VERSION> package with the proper VERSION extracted from the output of uname.

3.2. Generic Install

Still, we might encounter an issue when attempting the linux-headers-$(uname -r) approach:

$ apt-get install linux-headers-$(uname -r)
Hit:1 http://deb.debian.org/debian stable InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package linux-headers-5.10.0-666-amd64
E: Couldn't find any package by glob 'linux-headers-5.10.0-666-amd64'
E: Couldn't find any package by regex 'linux-headers-5.10.0-666-amd64'

Here, we see that headers for our 5.10.0-666 kernel version aren’t available as a separate package.

In this case, we can turn to the linux-headers-generic package:

$ apt-get install linux-headers-generic

It should point to the latest supported kernel and get the correct headers.

However, this method might also upgrade our kernel as a side effect.

3.3. Troubleshooting

Sometimes, the correct kernel headers can be available, but applications might be looking for files in the wrong path. This happens when changes are introduced to the kernel header organization.

For example, the file include/generated/uapi/linux/version.h switched its location to include/linux/version.h between two kernel versions. In this case, using or building an application that expects the old path might result in an error.

To remedy this, we can create symbolic links via ln:

$ ln --symbolic /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

Notably, as we can see from the paths as well, the current system kernel version should match the header packages we supply and use.

4. Install Build Tools

To compile applications from their source code, we use the relevant build tools.

In most cases, including VMWare Tools, the package that we require for that is build-essential:

$ apt-get install build-essential

In practice, this package contains several fundamental tools and libraries:

Now, we should have everything necessary to install most applications from source or provide kernel interface support.

5. Manual VMWare Tools Installation

After we meet all requirements, we proceed with installing VMWare Tools from within the VMWare product of our choice. For older versions, this is usually done manually.

5.1. Update and Upgrade Guest

It’s always a good idea to ensure our guest operating system is running the latest available software:

$ apt-get update && apt-get upgrade

In this case, we use the update and upgrade options of apt to upgrade the system.

5.2. Get VMWare Tools in Guest

In all VMWare applications that support it, we have an option on the host to mount a virtual CD with the VMWare Tools installation files. To begin with, we should do that via the relevant option.

In case of issues at this stage, we should turn to the specific documentation, depending on the product.

Once the CD is attached, we can use mount as usual:

$ mkdir --parent /media/cdrom
$ mount /dev/cdrom /media/cdrom

Thus, we should be able to access the contents of the VMWare Tools virtual disk at /media/cdrom:

$ cp /media/cdrom/VM*.tar.gz /tmp
$ cd /tmp

Here, we copy the VMWare Tools setup archive to /tmp and change to that directory.

Now, we can umount:

$ umount /media/cdrom

At this point, we have the VMWare Tools archive in /tmp and this is also our current working directory.

5.3. Install VMWare Tools

To install VMWare Tools from the archive, we first extract it:

$ tar -xzvf VM*.tar.gz

In particular, we e[x]tract the g[z]ipped TAR [f]ile with [v]erbose output.

After that, we go install via the provided Perl script:

$ ./vmware-tools-distrib/vmware-install.pl -d

Finally, we reboot.

5.4. Configure and Maintain VMWare Tools

Notably, there is a vmware-config-tools.pl script included in older VMWare Tools packages. With it, we can ensure VMWare Tools works in case our kernel upgrades in the future.

6. Summary

In this article, we talked about installing VMWare Tools on a Linux guest.

In conclusion, depending on the version of VMWare Tools we aim for, we can either automatically install newer versions with relative ease, or manually take care of different dependencies if using an older version.

Comments are open for 30 days after publishing a post. For any issues past this date, use the Contact form on the site.