Monday, February 10, 2014

Installing VMware Tools on Ubuntu 12.04 LTS

VMware tools is a very helpful item when used with the VMware Workstation as it increases performance and adds features not able to be done by default. This tutorial is based on vSphere 5.1 however it should translate to newer builds. The official documentation doesn't take into consideration if you are missing gcc or kernel-headers and I will go through how to install these and make the installation much easier.

Taken from the VMware Tools Documentation:

"With the VMware Tools SVGA driver installed, Workstation supports significantly faster graphics performance.

The VMware Tools package provides support required for shared folders and for drag and drop operations.
Other tools in the package support synchronization of time in the guest operating system with time on the host, automatic grabbing and releasing of the mouse cursor, copying and pasting between guest and host, and improved mouse performance in some guest operating systems."

Project: Installing VMware Tools (Ubuntu 12.04 LTS)
Difficulty: 1/10
Prior knowledge required: none - understanding of apt repositories suggested but not required.
Time: 10-20 minutes

The entire setup process is very straight forward, however, once you get to the actual install it will ask for gcc location (not installed by default) and your kernel-header location (also not installed by default). While gcc was a very easy install, the kernel headers took a little bit of research.

Getting Started

Begin by turning on the VM (virtual machine) that you intend on installing VMware Tools onto. Once the machine is booted, right click on the VM's name in the console, then under the guest submenu, select "Install/Upgrade VMware Tools"; this will mount a cd to /dev/cdrom.
This CD will be mounted read-only so you will have to mount the CD, copy the contents to a different location (we will be using the /tmp directory) and complete the installation from the new directory.
Before we are able to mount the CD we need to create a mount point which will be in /mnt.

 user@xynteq~$ mkdir /mnt/cdrom
Once you have created a mount point, go ahead and mount the CD to this folder.
 user@xynteq~$ mount /dev/cdrom /mnt/cdrom
 mount: block device /dev/sr0 is write-protected, mounting read-only
Navigate into the mounted directory and copy the tar ball into /tmp then extract.
 user@xynteq~$ cp VMwareTools-9.0.5* /tmp
 user@xynteq~$ cd /tmp
 user@xynteq~$ tar zxfv VMwareTools*
Because the drive is write-protected and mounted as read-only you cannot extract the tarball on the drive (or in the folder we mounted to) and it needs to be done in a different location.

Once you have successfully extracted the installer, navigate into the new folder created, vmware-tools-distrib. In here you will see quite a few files, however you only need to run vmware-install.pl. Here is where the installation differs from the documentation. Try to run the vmware-install.pl, if it fails it will remove itself when you run the command again (it will detect a previous install and remove it), however if it runs and does not have any errors, you're done!
 user@xynteq~$ ./vmware-install.pl
Accept all of the default locations until it asks for your gcc location. If the gcc location is specified as "" this needs to be installed to continue, however this one is very easy.
 user@xynteq~$ apt-get install gcc
Try running vmware-install.pl and it should go through the gcc part smoothly now, however the next part will ask for your kernel-headers, and again like gcc if it states the location is "", you will need to install these. After quite a bit of research I finally found an answer to how to easily install these, and it is quite simple once I figured it out, just run the following command and you'll be ready to run the install script one last time.
 user@xynteq~$ apt-get install linux-headers-$(uname -r)
Run vmware-install.pl one last time and you should see it sucessfully install! Once you are finished with the install you need to kick start the process to get it initially running.

 user@xynteq~$ /usr/bin/vmware-user

If this command returns an error, just log out of your server and re-login and the service will be started. To verify this worked try ps aux | less to find the service name.

No comments:

Post a Comment