VMWare Tools on Ubuntu 8.04 Server
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.
|
About Joe: Joe Topjian is the owner of Terrarum -- a system administration company that specializes in Linux Infrastructure and Automation. More information about Terrarum can be found here.
|

Add A Comment