Wednesday, May 28, 2008

VMWARE on Ubuntu

I decided to try VMware on Ubuntu, i've used VMware workstation on windows and for quite a while and found it an excellent product.

First i tried Automatix to install VMware server but the serial number i got from Vmware was rejected during the install which caused the script to freeze up and i had to abort the install.

So next we download the files directly from the Vmware web site. Trying to drag the folder in the gzipped tarball caused the extraction utility to seize up. So next we tried to extract the files from the archive which seemed to lock it up again but it was working - it just gave no indication or feedback that is was functioning and not frozen. After a minute or so it created a folder called vmware-server-distrib which as a script called vmware.install.pl

We want to see what happens if we double click the script file. A dialog box appears asking if we want to view the contents or run in the terminal. We choose run in terminal and nothing seems to happen which makes sense as we are not logged in as root. We recall from long ago that we have to run the file in terminal but the exact syntax escapes me at the moment.

You would think a readme.txt file could be included in the package. We find a readme in the doc folder. It says:

For complete VMware Server product documentation please use the
product Help menu or refer to "http://www.vmware.com/support/pubs".

Screw that - it's off to google to see who has done this before - nothing like an example to see what to do. We find an article at Ubuntu Geek:

http://www.ubuntugeek.com/how-to-install-vmware-server-in-ubuntu-710-gutsy-gibbon.html

Which contains the information that after unpacking the archive to start the installation using the following comamnd:

sudo ./vmware-install.pl

So we open up the shell and issue the command.

A previous installation of VMware software has been detected.
The previous installation was made by the tar installer (version 3).
Keeping the tar3 installer database format.
Error: Unable to execute "/usr/bin/vmware-uninstall.pl.
Failure
Execution aborted.

So the previous install froze but is still there. We take a look for the uninstall script. It is not in /usr/bin but we see all the vmware files from the previous install. We could rm them but what if that does not solve the problem? Best to use the uninstall script. We find it in the new vmware download in the /bin directory.

We evoke sudo ./vmware-uninstall.pl

Uninstalling the tar installation of VMware Server.
xinetd: no process killed
inetd: no process killed
The removal of VMware Server 1.0.5 build-80187 for Linux completed
successfully. Thank you for having tried this software.

Best to check /usr/bin to confirm. Success they are gone! Ok let's try the install again.

Damn - same error message as before - it says vmware is installed. Check /usr/bin again and yes, farther down there are some vmware files. Let's see if deleting them helps. Ok so we removed the vmware files with:

gnickers@godzilla:/usr/bin$ sudo rm vmnet*
gnickers@godzilla:/usr/bin$ sudo rm vmstat
gnickers@godzilla:/usr/bin$ sudo rm vm-support
gnickers@godzilla:/usr/bin$ sudo rm vmrun
gnickers@godzilla:/usr/bin$

Now we try the install again. Same error as before. We are going at this the wrong way. Maybe there is a record of installs done by tar and we need to remove that data. So we take a look at the package database and lo there is vmware listed. So the automatix install did 'take' as far as the package manager is concerned. So we completely remove the vmware server package. There are some other vmware packages such as x.org and kernel stuff but we leave them alone for now.

We return to the terminal to execute the script in the shell again. Success!

gnickers@godzilla:~/vmware-server-distrib$ sudo ./vmware-install.pl
Creating a new installer database using the tar3 format.
Installing the content of the package.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc]

What is the directory that contains the init scripts?
[/etc/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware]

The path "/usr/lib/vmware" does not exist currently. This program is going to
create it, including needed parent directories. Is this what you want?
[yes]

In which directory do you want to install the manual files?

[/usr/share/man]

In which directory do you want to install the documentation files?
[/usr/share/doc/vmware]

The path "/usr/share/doc/vmware" does not exist currently. This program is going to create it, including needed parent directories. Is this what you want?
[yes]

The installation of VMware Server 1.0.5 build-80187 for Linux completed successfully. You can decide to remove this software from your system at any time by invoking the following command: "/usr/bin/vmware-uninstall.pl".

Before running VMware Server for the first time, you need to configure it by invoking the following command: "/usr/bin/vmware-config.pl". Do you want this
program to invoke the command for you now? [yes]

Making sure services for VMware Server are stopped.

Stopping VMware services:
Virtual machine monitor done
Configuring fallback GTK+ 2.4 libraries.

In which directory do you want to install the mime type icons?
[/usr/share/icons]

What directory contains your desktop menu entry files? These files have a .desktop file extension. [/usr/share/applications]

In which directory do you want to install the application's icon?
[/usr/share/pixmaps]

Trying to find a suitable vmmon module for your running kernel.

None of the pre-built vmmon modules for VMware Server is suitable for your running kernel. Do you want this program to try to build the vmmon module for your system (you need to have a C compiler installed on your system)? [yes]

This is a good question - best check the package manager before we continue. We see that the GNU C compiler is installed. So we continue.

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

What is the location of the directory of C header files that match your running
kernel? [/lib/modules/2.6.22-14-generic/build/include]

Extracting the sources of the vmmon module.

Building the vmmon module.

Using 2.6.x kernel build system.
make: Entering directory `/tmp/vmware-config0/vmmon-only'
make -C /lib/modules/2.6.22-14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.22-14-generic'
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
CC [M] /tmp/vmware-config0/vmmon-only/linux/hostif.o
CC [M] /tmp/vmware-config0/vmmon-only/common/cpuid.o
CC [M] /tmp/vmware-config0/vmmon-only/common/hash.o
CC [M] /tmp/vmware-config0/vmmon-only/common/memtrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/phystrack.o
CC [M] /tmp/vmware-config0/vmmon-only/common/task.o
CC [M] /tmp/vmware-config0/vmmon-only/common/vmx86.o

LD [M] /tmp/vmware-config0/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/linux-headers-2.6.22-14-generic'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
The module loads perfectly in the running kernel.

Do you want networking for your virtual machines? (yes/no/help)

Damn - pressed the wrong keys when copying the install text from the terminal and aborted the install! So we restart the install - this time it knows how to uninstall the aborted install.

We have been accepting the defaults - when asked if we want NAT on the virtual machine we reject the default and answer NO. We are assuming we can bridge to the real network from the vm and thus get to the outside world.

We not get an error message warning that the default port of 902 is not free - it has selected port 903 to communicate with the vmware server for remote console connections to use.

inetd: no process killed
Unable to make the Internet super-server (inetd) re-read its configuration
file. Please restart inetd by hand:
killall -v -HUP inetd

We are now asked to enter the serial number we got from vmware.

The answer "9154n-y0pau-2a0ap-4h12t" is invalid. It must be of the form XXXXX-XXXXX-XXXXX-XXXXX where X is a digit 0-9 or a capital letter A-Z

Ahh - we had to enter it all in upper case - that is why the first install failed. Stupid - all these things do is to annoy users - no wonder many people prefer oss. Ok now it is accepted.

Starting VMware services:
Virtual machine monitor done
Virtual ethernet done
Bridged networking on /dev/vmnet0 done

The configuration of VMware Server 1.0.5 build-80187 for Linux for this running
kernel completed successfully. A menu item is added to the applications, system menu called vmware server console.

We decide to look at this tomorrow after we search the pile of dvd's for the one with the downloaded VM's...

Well, we could not find it without more searching than it is worth so we decide to get new images anyway. This required installing a bittorrent client as many images can only be downloaded in that way.

Once done we had a folder of the nostalgia virtual appliance which creates a DOS box. We select Applications, System tools, Vmware server console from the menu.


Next it asks if we want to connect to localhost or to a remote host. This is interesting - it will run vmware images stored on a server. Sweet - we could set up a NAS arrangement with all the images stored centrally. This would be neat to use with a network device where you could choose your OS at boot time, wonder if there is a 'dumb pc' that boots vmware images. I used to have some HP thin client boxes that booted from unix and a citrix thin client box.

Anyway we choose local host and click CONNECT.

The menu appears and we select CREATE A NEW Virtual Machine to see what would happen. A wizard appears to guide us through the process.

We choose Typical setting, and then select an operating system. It support all versions of Microsoft Windows from 3.1 to Vista, a large list of Linuxes including the most popular ones, plus Solaris, Novell, the various BSD forks and ms-dos.

This looks promising, later we will try the windows98 vm as that defeated virtualbox. For now we cancel out of the wizard.

We now select Open a Virtual Machine. The list is empty so we click Browse, navigate to our home folder, choose nostaglia and select dos.vmx and click OPEN and the details are displayed.

We click Start up to start the guest os. That didn't go well - a black window. And when we exited it our desktop is screwed up. We shut down the dos vm but all we get is a beige screen. We use alt-tab to get to the dock and close the VMware server console which restores our desktop from the beige 'fog' which obscured everything.

Tomorrow - we try again with some other VM's we have downloaded from VMware.

We tried the ubuntu-server-6.06.1 which has a copy of the Koha library system. We got the VM to run but the beige screen is back - it is hard to switch between the guest OS and the host OS. Doesn't seem as polished as virtualbox but there are so many community contributed VM's that it is a shame. The answer seems to be to run VMworkstation which works great - on windows XP to use VM appliances but to use Virtualbox on Linux to run other OS like windows 98 or DOS.






No comments: