Installing VMWare Server 1.0 on Ubuntu 6.06LTS

Ubuntu 6.06LTS is a useful platform for VMWare because it has a small footprint by todays standards and is supported by Canonical until 2011. Unfortunately installing VMWare Server 1.0 can be a little painful given there are no binary kernel modules for Ubuntu in this release.

Fortunately there are some excellent guides for installing VMWare on this platform such as this one from HowtoForge. What follows is an installation script based on the HowtoForge guide that saves the administrator a lot of time and solves a bug along the way.

Build your Ubuntu server

A basic install of 6.06LTS is pretty light weight and by default doesn't have anything running that isn't needed. A few things that you may want to install is the openssh-server package for remote access and ntp-server for keeping your system clock accurate.

sudo apt-get install openssh-server ntp-server

By default Ubuntu 6.06 configures its network via DHCP which is fine for a desktop system but probably not ideal for a server. To set a static IP address edit the /etc/network/interfaces file and set the relevant static network interface and address parameters. For example:

iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1

Also check the /etc/resolv.conf file contains the correct DNS server details before restarting the network interfaces with:

sudo /etc/init.d/network restart

The VMWare Installation Script

1. Create a vmware directory somewhere handy to store the installation files, your home directory is a good place. Once the installation is complete you can remove this directory although it is worth making a backup should you wish to install VMWare again.

2.Download the Linux tar archives of VMWare Server 1.0 and the Management User Interface (MUI) from the VMWare website. The current stable release of VMWare Server at the time of writing was version 1.0.4-56528. Also as you are downloading remember to record your serial code as this will be needed during the installation process.

3. In the same directory where you have downloaded these install archives create a new file named rundir.httpd.vmware with the following contents:

#! /bin/sh
# /var/run gets purged at every reboot!

RUNDIR="/var/run/vmware/httpd"
OWNER="www-data"
GROUP="www-data"

/usr/bin/test -d "$RUNDIR" || \
/bin/mkdir -p "$RUNDIR" && /bin/chown "$OWNER:$GROUP" "$RUNDIR"

This file is copied to the /etc/init.d/ directory by the installation script and overcomes an permissions issue which stops the VMWare MUI from loading.

4. Now create a file called install-vmare.sh with the following contents:

#! /bin/sh
TMP="/tmp"
VERSION="1.0.4-56528"

echo "Installing VMware Server for Ubuntu 6.06"

echo "Installing application requirements"
echo "---------------------------------------------------"
echo "Installing dev headers and xinetd..."
sudo apt-get -y install libx11-6 libx11-dev libxtst6 xlibs-dev xinetd wget
echo "---------------------------------------------------"

echo "Installing Linux Kernel headers..."
sudo apt-get -y install linux-headers-`uname -r` build-essential
echo "---------------------------------------------------"

echo "Installing build utilities..."
sudo apt-get -y install gcc binutils-doc cpp-doc make manpages-dev autoconf \
automake1.9 libtool flex bison gdb gcc-doc gcc-4.0-doc libc6-dev-amd64 lib64gcc1

# Install VMWare Server
echo "---------------------------------------------------"
echo "Uncompressing the VMware Server $VERSION archive..."

# Copy files to revelant locations
cp VMware-server-$VERSION.tar.gz $TMP
cp VMware-mui-$VERSION.tar.gz $TMP
sudo cp rundir.httpd.vmware /etc/init.d/

cd $TMP
tar -xzf VMware-server-$VERSION.tar.gz
rm VMware-server-$VERSION.tar.gz

echo "---------------------------------------------------"
echo "Installing VMware Server $VERSION..."
cd vmware-server-distrib
sudo ./vmware-install.pl


# Install the VMWare web management console
echo "---------------------------------------------------"

echo "Uncompressing the VMware MUI $VERSION archive..."

cd $TMP
tar -xzf VMware-mui-$VERSION.tar.gz
rm VMware-mui-$VERSION.tar.gz

echo "---------------------------------------------------"
echo "Installing VMware MUI $VERSION..."

# Configure the MUI rundir fix
sudo chmod 755 /etc/init.d/rundir.httpd.vmware
sudo ln -s /etc/init.d/rundir.httpd.vmware /etc/rc2.d/S90rundir.httpd.vmware

cd vmware-mui-distrib
sudo ./vmware-install.pl


echo "---------------------------------------------------"
echo "Cleaning up..."
cd $TMP
rm -rf vmware-server-distrib
rm -rf vmware-mui-distrib
echo "---------------------------------------------------"
echo "VMWare installation complete"

echo ""
echo "To administer VMWare you will need to either:"
echo "1. Enable root logon access (sudo passwd root)"
echo "2. Set set the uid of a designated user to 0 (sudo nano /etc/passwd)"
echo ""
echo ""

This is the script that handles installation of all the required dependencies, kernel sources and VMWare packages.

NOTE: You may need to tweak the TMP and VERSION variables to suit your server environment and downloaded VMWare version.

5. Finally enable execute permissions on this file and run the script:

chmod a+x install-vmware.sh./install-vmware.sh

The script will prompt you for your password in order to gain administrator privileges (sudo). It will then install all the required packages via apt before copying the rundir.http.vmware file into the correct location and running the VMWare installers.

For the most part the default VMWare install options can be accepted without much thought. The only settings that may need tweaking is the location of the VMWare images (default /var/lib/vmware/Virtual Machines) and the MUI's default login time of 60 minutes which seems a little long for my liking (15 minutes would seem more appropriate).

All going well at the end of the process you should have a fully functional VMWare Server with a web management console operating at https://server-ip-address:8333/. Whilst you cannot create or install virtual machines via the web console you can download the Windows or Linux VMWare Console installers which will get you going.

Kernel Updates

Be aware that each time you upgrade the Ubuntu kernel to a different version the VMWare kernel module must be recompiled. After upgrading your kernel and rebooting the system you will find VMWare fails to load. At this point do not panic, it only takes a few steps to rectify the situation.

1. First download the headers for your current kernel.

sudo apt-get install linux-headers-`uname -r`

2. Now run the vmware-config.pl script, accept the default settings and rebuild the VMWare kernel module.

sudo vmware-config.pl

Once this script completes VMWare should once again be operational. The only thing left to do is remove the old kernel headers if you feel you won't be needing them again:

sudo apt-get remove linux-headers-(old kernel version)