Thursday, April 17, 2008

Installing VMware Server on Ubuntu 7.10

If you're thinking about virtualizing your IT environment but you don't necessarily have a lot of budget/money to do it with, here are a few tips that may help you on your way.

Most of us already know about VMware's offering of VMware Server for free. This, coupled with some great open-sourced operating systems can make for some pretty efficient hypervisors.

I recently had to install a few VMware Server hosts using Ubuntu 7.10 Gutsy as the base host system. We chose Ubuntu because: the distribution CD is relatively small (~510Mb), it is simple to install and it provides the basic functionality needed. Furthermore, it uses the Debian packaging system which means you have access to potentially hundreds of additional packages (such as webmin) - should you choose to install them.

The process is pretty simple:

Step 1: Install your new system using the Ubuntu Server CD.

Step 2: Answer through the normal set of questions.

The actual Ubuntu installation procedure is a bit beyond the scope of this post, but suffice it to say that you should provide a nice big partition for where your VMs will reside. We like to put them in /home/vm)

When prompted to configure your server, select the options you want. We selected "OpenSSH server" and "Samba File Server" (we work in a mixed Linux/Windows environment here). Generally, it is a good idea to keep these selections to a minimum to save resources.

Once the install has finished, reboot.

Step 3: Next, install some packages that are necessary for VMware but that the base installer doesn't install by default, namely:

sudo apt-get install linux-headers-`uname -r` libx11-6 libx11-dev libxrender1 libxt6 libxtst6 libxext6 psmisc build-essential iceauth xinetd.

Note, you need to do this as a sudo user.

(Incidentally, if you don't install these packages, you will probably get an error like this if you try to install VMware Server:)

The correct version of one or more libraries needed to run VMware Server may be

missing. This is the output of ldd /usr/bin/vmware:
linux-gate.so.1 => (0xffffe000)
libm.so.6 => /lib32/libm.so.6 (0xf7f93000)
libdl.so.2 => /lib32/libdl.so.2 (0xf7f8f000)
libpthread.so.0 => /lib32/libpthread.so.0 (0xf7f76000)
libX11.so.6 => not found
libXtst.so.6 => not found
libXext.so.6 => not found
libXt.so.6 => not found
libICE.so.6 => not found
libSM.so.6 => not found
libXrender.so.1 => not found
libz.so.1 => /usr/lib32/libz.so.1 (0xf7f60000)
libc.so.6 => /lib32/libc.so.6 (0xf7e16000)
/lib/ld-linux.so.2 (0xf7fc6000)



Now you're ready to install VMWare.

Step 4: Obtaining VMware Server.

Go to http://www.vmware.com/download/server/ and download the latest version of
the VMware Server install package. The way I did this was to browse to the appropriate page on VMware's site using another computer (my workstation), register and accept license agreements then when it came time to actually download the file, I copied the link onto my clipboard and pasted it into my ssh session with my new server.

At the time of writing, this is what I executed:

wget http://download3.vmware.com/software/vmserver/VMware-server-1.0.5-80187.tar.gz

Similarly for the management interface and client packages:

wget http://download3.vmware.com/software/vmserver/VMware-mui-1.0.5-80187.tar.gz

wget http://download3.vmware.com/software/vmserver/VMware-server-linux-client-1.0.5-80187.zip


Once you have the files, untar/gunzip them using the following command:

tar -xvzf ./VMware-server-1.0.x-xxxxx.tar.gz
tar -xvzf ./VMware-mui-1.0.x-xxxxx.tar.gz

where xxxxx represents the proper version numbers.

Two new directories called vmware-server-distrib and vmware-mui-distrib will be created.

Step 5: Installing VMware

Change directories to vmware-server-distrib. Run the vmware-install.pl script. In our case, we answered the default for most questions except where we wanted the VMs to reside. We entered "/home/vm" for this but it is up to you where you want to put them on your system.

Step 6: Installing the VMware Management UI.

The VMware Management UI is a good way to get an overall view of the VMware server host. It presents you with helpful averages of CPU and memory usage per VM. We use it to guage approximately how many VMs a given physical server can handle.

To install it, change to your vmware-mui-distrib directory and run the vmware-installer.pl script. When you do this, you *may* get a message indicating that VMware is not installed. This error is in fact a misnomer - as it just means you have some missing libraries, AND it also may mean that your "sh" is pointing to something called "dash" instead of the more full fledged "bash".

To resolve these problems, try any or all of the following:

Needed packages not installed
sudo apt-get install libx11-6 libxtst6 libXt6 libXrender1 libXi6 libstdc++5 libssl0.9.7 libcrypto++5.2c2a

Incorrectly linked Library
ln -s /usr/lib/libdb-4.3.so
/usr/lib/libdb.so.3

Incorrectly pointed sh command
Determine if it is the case by doing an "ls -l /bin/sh" ... if it shows that sh is actually pointing to a program called "dash", remove the link and relink it to bash. (You may safely do this, then reverse it back to dash after running the install script).

Then correct the problem by:

rm /bin/sh
ln -s /bin/bash /bin/sh

One more note...
In our case, we decided to use a single user on our server host for all VMs. All VMs were then owned and write permissible for this single user. Depending on your environement, this approach may be feasible, or it may not. The advantage is simplicity, the disadvantage is privacy and flexibility. You decide.

Conclusion and Verification
If you've done the above steps correctly, you now have a functional VMware Server host machine. To verify:

1. Try installing and connecting with a VMware Server Console client. You should be able to create new virtual machines.

2. Try connecting to the management console, by pointing your browser to https://servername:8333.

If you've found this article useful or you have any compliments, constructive criticisms etc., please feel free to leave a comment!

1 comment:

Joe said...

You should check out Nerd Boys!