Categories
Apps & OS's Technology

Installing VMWare Server 2 on Ubuntu 10.04 Server

Ok well today I’m going to outline how I managed to install VMWare Server 2 on my Quad core Xeon 3.2GHz rack server running Ubuntu Server 10.04 as the host operating system…

In the past I have used VMWare Server on Microsof t Windows based operating systems but in all truth I would much prefer to run VMWare Server on a smaller footprint, In the past I tried installing VMWare ESXi as a baremetal hypervisor but the server’s hardware was not supported so the next best thing…. I managed to install VMWare Server 2.0.2 on Ubuntu 10.04 which after installation was reporting only 104MB of RAM used which I think it pretty damn good!

So I thought I’d share with you what I did….

You may already be aware that VMWare Server 2 is NOT officially supported on Ubuntu so we have to patch the source before compiling but don’t worry, with the instructions below its all very easy 🙂

So lets begin….

Firstly you’ll need to obtain (if you don’t already have it) the Ubuntu 10.04 server installation disk from the Ubuntu website, install it and configure it with a static IP address…

Next up, log in to the server (as Root) and follow these simple steps:-

Create a directory in /root named ‘vm’ this will be used to temporarily storing the VMWare package prior to installation:-

mkdir /root/vm
cd /root/vm

To download VMware, you need to register at: https://www.vmware.com/tryvmware/?p=server20&lp=1. They (VMWare) will send you an email. Follow the instructions in the email, and download and save VMware-server-2.0.2-203138.i386.tar.gz in /root/vm and remember to write down the key for VMware Server for Linux (looks like: XXXXX-XXXXX-XXXXX-XXXXX).

Now we need to ‘Untar’ the downloaded package as follows:-

tar -xzf VMware-server-2.0.2-203138.i386.tar.gz

So before we install VMWare Server we must patch it, for now, lets create another and changin into the folder:-

mkdir /root/dev
cd /root/dev

Lets download the patch files using the commands below:-

wget http://blog.bobbyallen.me/scripts/2.6.32-22/00-vmware-2.6.32_functional.diff.txt
wget http://blog.bobbyallen.me/scripts/2.6.32-22/02-vmnet-include.diff.txt.gz
wget http://blog.bobbyallen.me/scripts/2.6.32-22/01-vmware-2.6.32_cosmetic.diff.txt
wget http://blog.bobbyallen.me/scripts/2.6.32-22/vmware-config.pl.diff.txt
wget http://blog.bobbyallen.me/scripts/2.6.32-22/patch-vmware_2.6.3x.sh.txt

Note:- The above files where mirrored on my personal server from: http://nerdbynature.de/bits/2.6.32-22/

Unzip the following file:

gunzip 02-vmnet-include.diff.txt.gz

Change the names of the five files:

mv 00-vmware-2.6.32_functional.diff.txt 00-vmware-2.6.32_functional.diff
mv 01-vmware-2.6.32_cosmetic.diff.txt 01-vmware-2.6.32_cosmetic.diff
mv 02-vmnet-include.diff.txt 02-vmnet-include.diff
mv patch-vmware_2.6.3x.sh.txt patch-vmware_2.6.3x.sh
mv vmware-config.pl.diff.txt vmware-config.pl.diff

Edit the file patch-vmware_2.6.3x.sh:

nano patch-vmware_2.6.3x.sh

Delete everything and replace with:

#!/bin/sh
#
# (C) 2010 lists@nerdbynature.de
#
# 00-vmware-2.6.32_functional.diff
# – based on vmware-server-modules-linux-2.6.32.patch
# – see http://communities.vmware.com/message/1389232#1389232
#
# 01-vmware-2.6.32_cosmetic.diff
# – based on rbihlmeyer’s comments in http://communities.vmware.com/thread/232842
#
# 02-vmnet-include.diff
# – stuff .h and .c files in separate directories, as the other
# modules do it
#
# vmware-config.pl.diff
# – based on http://communities.vmware.com/message/1398525#1398525
#
DIR=/root/dev/
PATCHES=”00-vmware-2.6.32_functional.diff 01-vmware-2.6.32_cosmetic.diff 02-vmnet-include.diff”

# unset me!
# DEBUG=echo

if [ -z “$1” -o ! “`ls “$1″/*tar 2>/dev/null | wc -l`” = 4 ]; then
echo “Usage: `basename $0` [vmware-modules-source directory]”
exit 1
else
SRC=”$1″
fi

cd $SRC
$DEBUG mkdir orig || exit 1
$DEBUG mv *tar orig/

# untar
for t in orig/*.tar; do
$DEBUG tar -xf $t
done

# patch
for p in $PATCHES; do
$DEBUG patch -p1 < “$DIR”/”$p”
done

# tar
for d in *-only; do
$DEBUG tar -cf `echo $d | sed ‘s/-only/.tar/’` $d
done
$DEBUG rm -rf *-only

# vsock.ko needs symbols from vmci
$DEBUG cd ../../../bin || exit 2
if [ -x vmware-config.pl -a -f $DIR/vmware-config.pl.diff ]; then
$DEBUG patch -p0 < $DIR/vmware-config.pl.diff
fi

Save the file (CTRL+O) and quit.

Now we execute the patch process:-

chmod u+x patch-vmware_2.6.3x.sh
./patch-vmware_2.6.3x.sh /root/vm/vmware-server-distrib/lib/modules/source

And then we install VMWare Server:-

cd /root/vm/vmware-server-distrib
./vmware-install.pl

You can press ENTER to accept all default values. Accept the license. Enter the VMware Server key that VMware gave to you. That’s it. If the installation is successful, it ends like this:

Starting VMware management services:
VMware Server Host Agent (background) done
VMware Virtual Infrastructure Web Access
Starting VMware autostart virtual machines:
Virtual machines done

The configuration of VMware Server 2.0.2 build-203138 for Linux for this
running kernel completed successfully.

Housekeeping…
Thank you for using the script!
Patch provided by:
Ramon de Carvalho Valle
http://risesecurity.org
Script author:
Radu Cotescu
http://radu.cotescu.com

And then simply reboot your server using:-

shutdown -r now

Once your server is back online you should be able to access the VMWare Server web interface; type https://{your_server_ip}:8333/ (make sure you use the correct IP address!), then hit ENTER… Click Proceed anyway. – The login would be your server’s root account details eg. root/yourpassword

There is a know issue at the moment with Firefox 3.6 but Mozilla has reportedly stated this issue will be fixed in Firefox 4.0 (Expected out in November 2010) – I personally use Google Crome and have no problems what-so-ever! Internet Explorer should work fine too! – Failing that you can use VMWare’s VIC (Virtual Infrastructure client) to connect to and manage the server.

I would like to note that the patch files where kindly provided by Nerdybynature.com and I take no praise for this work!