VMWare Tools on Ubuntu 8.04 Server

3joe16th Feb 2009Administration, ,

Introduction

I maintain a VMWare Server (not ESX) that currently hosts 9 Ubuntu 8.04 LTS guests. To my mistake, I never thought of installing VMWare Tools on any of them until I started seeing premature performance bottlenecks. Being tasked with 9 installations, I could either install the Tools on each guest manually or look for a more automated solution. The end result that I came up with was a hybrid of both.

Prerequisites

I first made sure all guests were up to date by doing

apt-get update
apt-get dist-upgrade

on all 9.

Next I made a new virtual machine that would be used solely as a build-server. This allowed me to install build-essential and all other required libraries without dirtying up a production server.

Research

Next I searched around for others who installed the tools on Ubuntu 8.04 and if they ran into any problems. It turns out there is some bug where the stock VMWare Tools will not work on 8.04 and the fix is to use the new Open VM Tools package.

The Perils of Copy-and-Paste Administration

While reading through several blog entries, I noticed that they all followed the same procedure for installing the Open VM Tools. Initially I thought I was lucky to have access to such a widely used recipe — that is until I read through the steps:

apt-get install build-essential linux-headers-`uname -r`
apt-get install libproc-dev libdumbnet-dev libicu-dev
tar -xzvf VMwareTools-1.0.X-XXXX.tar.gz
tar xzvf open-vm-tools-LOOK-UP-LATEST-VERSION.tar.gz
cd open-vm-tools-*
./configure --without-x
cd modules/linux
for i in *; do mv ${i} ${i}-only; tar -cf ${i}.tar ${i}-only; done

wait, what?

The for loop looked absolutely ridiculous. I can understand if you want to tar the directories, but the loop is also taring the individual *.o files that were just compiled. I decided to continue on and brush it off as laziness — the loop still does what it intended to do, it just brings some excess baggage along for the ride.

cd ../../../
mv -f open-vm-tools-*/modules/linux/*.tar vmware-tools-distrib/lib/modules/source/

Again, another red flag.

Why are you moving the modules you just compiled into the source directory where they will be compiled again? This is a total waste of time and this is where I stopped reading the widely circulated instructions. If you’d like to know just how widely circulated they are, do a google search for that infamous for loop.

I’ll also refrain from going into a long rant about how trendy it is to simply copy and paste each other’s blog entries and submit them to Digg without actually knowing if it’s the right way or not.

My hybrid Manual-Automated Solution

I already compiled the Open VM modules — they were sitting in the modules/linux directory as standard *.o files.

I know the vmware-tools-distrib directory has a binary subdirectory where it keeps binaries of known systems.

What if I was able to create my own binary subdirectory that the vmware-install.pl script would detect?

Looking at the vmware-tools-distrib/lib/modules/binary subdirectory yields several binary solutions. I picked one that resembled Ubuntu 8.04 Server:

bld-2.6.15-23-i386server-Ubuntu6.06

Inside this directory is an objects subdirectory and a properties text file. The properties file is simply information returned from uname -a.

Next, I created a new directory called

bld-2.6.24-23-i686server-Ubuntu8.04

I then created an objects subdirectory and moved my Open VM Tools compiled modules in there.

Next, I created the properties file:

UtsRelease 2.6.24-23-server
UtsVersion #1 SMP Mon Jan 26 00:55:21 UTC 2009 
UtsMachine i686
ModVersion yes
SMP yes
PageOffset C0000000
Comment Ubuntu8.04, 2.6.24-23, i686, server

Finally, I simply ran the vmware-install.pl script and it successfully found the modules and installed them automatically. There was no compiling involved.

So I tar’ed the bld-2.6.24-23-i686server-Ubuntu8.04 directory up and distributed it to each of the 9 guests. When I would install the VMWare Tools on each, I untar’ed the directory into the binary subdirectory. It worked without error on all 9 guests.

Result

With the VMWare Tools installed, I was able to apply some well-known performance tricks to both the Server and Guests and achieve a great performance increase. I reduced the average server load from 5 to 1 and my IO dropped by 50%.

Conclusion

I hope you can take away a few points after reading this article. Namely:

  • Installing VMWare Tools is a good thing. While I originally thought they only gave you cosmetic enhancements such as better screen resolution and drag-and-drop capabilities, they can actually help the performance of the guest.

  • Repetitive tasks are a great way to learn about automation and how best to accomplish something in a standard way across all servers. I once read a system administrator’s adage that went something like “Laziness is spending 3 hours to write a Perl script that would take you 30 minutes to do manually.”

  • Please don’t blindly copy and paste someone else’s solution. Remember, if your servers are in production on the Internet, you have a responsibility to understand how they work.

3 Comments Comments Feed

  1. Patrick (April 11, 2009, 1:19 am).

    Consider it dogma but I would prefer to use the stock VMWare tools. I’ve looked around quite a bit and this article has definitely approached the problem with the greatest degree of transparency. By explaining why the other method is wrong and why your method is better, you make a very compelling case.

    However, you say there is “some bug” in the stock VMWare Tools. I’ve tried installing in a completely stock system and did have an error with some of the advanced drivers. However, I’ve seen many people use some very simple instructions to “successfully” install VMWare Tools on a stock system. What I don’t know is if their successful install included those advanced drivers.

    Have you had any success finding out just what the root of the problem is? http://ubuntu-tutorials.com/2008/06/07/how-to-install-vmware-tools-on-ubuntu-804-guests/ suggests you can just install the kernel headers and build-essential. A comment from Dan suggests some errors can be cleared up on 8.04 Server LTS with a change to make sure the right headers are installed the symlink updated.

    http://muffinresearch.co.uk/archives/2008/07/13/ubuntu-hardy-setting-up-vmware-tools-from-the-cli/
    This seems to involve a hybrid of the two approaches. It avoids installing build-essential but it does use Open VM Tools to build the kernel module that allow native WMWare Tools to work.

    Thoughts?

  2. Andres Murillo (October 5, 2009, 11:01 am).

    I’ve created an shell script to automate the process described by the author:
    wget http://www.seancenet.com/blog/wp-content/uploads/2009/10/build-vm-tools-2009.10.03.sh

    Detailed instructions and context can be found here:
    http://www.seancenet.com/blog/?p=13

  3. joe (October 5, 2009, 11:09 am).

    Andres,

    That is an awesome script! Thank you very much for posting it.

Add a Comment