How to Install VMware Tools on Ubuntu: Step-by-Step Guide

How to Install VMware Tools on Ubuntu: Step-by-Step Guide

Installing VMware Tools on Ubuntu is an essential step for enhancing the performance of your virtual machines (VMs). This guide will walk you through each step required to install VMware Tools on Ubuntu, detailing its benefits, complications, and resolution strategies where necessary. Whether you’re a seasoned Linux user or a beginner, this article aims to provide comprehensive insight into the installation process.

Why Install VMware Tools?

VMware Tools is a suite of utilities that enhance the performance of the virtual machine’s guest operating system. The benefits of installing VMware Tools on Ubuntu include:

  1. Improved Graphics Performance: Enhanced video driver functionality enables better performance and experience within graphical programs.
  2. Time Synchronization: VMware Tools helps keep the time on the guest OS synchronized with the host, reducing time discrepancies.
  3. Shared Folders: It allows for easy sharing of files between the host and guest systems, simplifying file management.
  4. Improved Mouse and Keyboard Handling: The tools enable smooth mouse movements and keyboard input without capturing the mouse.
  5. Automatic Resolution Adjustment: Changes the display resolution dynamically based on the VM window size.

Prerequisites

Before you begin the installation process, make sure you meet the following prerequisites:

  1. VMware Installed: Ensure you’ve installed VMware Workstation, VMware Fusion, or VMware ESXi on your host machine.
  2. Ubuntu Installation: You should have a properly running instance of Ubuntu as a VM.
  3. Sudo Privileges: You need to have administrative (sudo) access to the Ubuntu machine.
  4. Internet Access: Ensure your Ubuntu machine can access the internet to download necessary packages if they aren’t already installed.

Step 1: Accessing the Virtual Machine

First, open VMware Workstation or the VMware interface you’re using. Select your Ubuntu VM and power it on.

Once your Ubuntu installation is running, log in with your credentials to access the desktop environment.

Step 2: Switch to Terminal

Although you can perform some actions in the graphical interface, using the Terminal is the most efficient way to install the necessary packages. Open the Terminal using the keyboard shortcut Ctrl + Alt + T.

Step 3: Update Your System

Before installation, ensure your system is up-to-date. Run the following commands to update the package lists and upgrade the installed packages:

sudo apt update
sudo apt upgrade -y

Note:

Make sure to reboot your system if the update process installed a new kernel.

Step 4: Install Required Packages

During the installation of VMware Tools, you may need several development tools and headers. Run the following command to install the essential packages:

sudo apt install gcc make perl open-vm-tools -y

Step 5: Mount VMware Tools Installer

VMware provides a virtual CD image containing the VMware Tools installer. To mount it, go to the VMware interface and follow these steps:

  1. Click on VM in the menu.
  2. Select Install VMware Tools.

This action will generate a virtual CD/DVD in your Ubuntu system. You may need to confirm that you want to mount this disc within the Ubuntu file explorer.

Step 6: Extract VMware Tools

The software is packaged in a tar.gz file. You will need to extract this file first. Find the mounted directory, usually located under /media/cdrom or /mnt/cdrom, and run the following commands in the Terminal:

cd /media/cdrom
tar -zxvf VMwareTools-*.tar.gz -C /tmp

The above command will extract the contents of the archive to the /tmp directory.

Step 7: Running the Installation Script

Now, navigate to the extracted folder in /tmp where the VMware Tools installation files are located. You need to run the VMware installation script:

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

During the installation, the script will prompt you with several options. You can generally accept the default options by pressing "Enter". Here’s a brief overview of a few common prompts:

  1. Directory for the compiled module: Accept the default option (usually /usr/lib/vmware-tools) unless you have a specific reason to change it.
  2. Pre-built modules: If you installed kernel headers, the script will prompt you to use pre-built modules.
  3. VMware Tools services: You may be asked whether to start services automatically during boot. Select "yes."

Each prompt will require you to decide how to proceed. Most users can safely choose the default values.

Step 8: Configuring and Starting VMware Tools

Once the installation is complete, you need to enable the VMware Tools services. Execute the following commands:

sudo systemctl enable vmware-tools
sudo systemctl start vmware-tools

Step 9: Reboot the VM

To apply the changes and ensure that everything is working correctly, reboot your virtual machine:

sudo reboot

Step 10: Verify the Installation

After your VM reboots, you can verify whether VMware Tools has been successfully installed and is running properly. Execute the following command:

vmware-toolbox-cmd -v

If VMware Tools is installed correctly, you will see the version number output.

Troubleshooting Common Issues

While installing VMware Tools usually goes smoothly, you might encounter issues. Here are common situations and how to resolve them:

Error: Missing Build Tools

If you receive an error about missing build tools or headers, ensure that you have installed the "linux-headers" package for your kernel:

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

After installing the required headers, navigate back to the extracted VMware Tools directory and rerun the installation script.

Error: VMware Tools Not Starting

If services aren’t starting after installation, ensure that the VM is set to use the correct compatibility and settings. You can also check service status using:

sudo systemctl status vmware-tools

If it’s inactive, try restarting it with:

sudo systemctl restart vmware-tools

Display Issues After Installation

If you encounter display issues after installing VMware Tools, ensure the display settings of your VM are configured to support 3D acceleration. You can find this option in the VM settings under the "Display" section.

Conclusion

Installing VMware Tools on your Ubuntu virtual machine greatly enhances the overall user experience by optimizing the integration of the guest OS with the host system. By following the steps provided in this guide, you should now be able to comfortably install and manage VMware Tools. Keep this guide handy whenever you need a refresher on installation or troubleshooting.

Whether you’re using your VM for development, testing, or personal projects, having VMware Tools installed will ensure that you get the best performance from your Ubuntu setup.

Leave a Comment