Friday 28 May 2010

How To Install VMware Server 1.0.x On A Kubuntu 10.04 Desktop

This tutorial provides step-by-step instructions on how to install VMware Server 1.0.x (1.0.10 at the time of this writing) on a Kubuntu 10.04 desktop system. This is for those who prefer VMware Server 1.0.x over VMware Server 2.

With VMware Server you can create and run guest operating systems ("virtual machines") such as Linux, Windows, FreeBSD, etc. under a host operating system. This has the benefit that you can run multiple operating systems on the same hardware which saves a lot of money, and you can move virtual machines from one VMware Server to the next one (or to a system that has the VMware Player which is also free).

Also, with VMware Server you can let your old Windows desktop (that you previously converted into a VMware virtual machine with VMware Converter, as described in this tutorial: http://www.howtoforge.com/vmware_converter_windows_linux) run under your Kubuntu desktop. This can be useful if you depend on some applications that exist for Windows only, or if you want to switch to Linux slowly.

I do not issue any guarantee that this will work for you!

Installing VMware Server 1.0.x

To download VMware Server, go to http://downloads.vmware.com/d/info/datacenter_downloads/vmware_server/1_0 and click on the VMware Server 1.0.10 link:

On the next page, click on the Download button next to VMware Server for Linux (file type: tar.gz, not rpm!):

Click here to find out more!

Accept the license agreement by clicking on Yes:

Then download the VMware Server for Linux .tar.gz file (not the rpm file!) to your computer (e.g. to /home/mum/Downloads):

To get the serial number that you need to run VMware Server, go to http://register.vmware.com/content/registration.html.

Fill in your personal details. Afterwards you will get a page with a serial number for VMware Server. Write it down or print it out:

Then open a terminal (Applications > System > Terminal):

Run the following command to install some necessary packages:

sudo apt-get install build-essential xinetd

If you are on an x86_64 system, you also need to install the package ia32-libs:

sudo apt-get install ia32-libs

Then go to the location where you saved the VMware Server .tar.gz file, e.g. /home/mum/Downloads (replace mum with your own username!):

cd /home/mum/Downloads

Unpack the VMware Server .tar.gz file and run the installer:

tar xvfz VMware-server-*.tar.gz
cd vmware-server-distrib
sudo ./vmware-install.pl

The installer will ask you a lot of questions. You can always accept the default values simply by hitting . Answer the following question with no...

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] <-- no

.. because you'll get an error like this one otherwise when the installer tries to compile the kernel modules needed by VMware (if you answer with yes and get the errors, that's no problem either - just read on):

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.32-22-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.32-22-generic'
CC [M] /tmp/vmware-config0/vmmon-only/linux/driver.o
In file included from /tmp/vmware-config0/vmmon-only/./include/vmware.h:25,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:48:
/tmp/vmware-config0/vmmon-only/./include/vm_basic_types.h:104:7: warning: "__FreeBSD__" is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/x86.h:20,
from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86apic.h:79:1: warning: "APIC_BASE_MSR" redefined
In file included from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/apic.h:11,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/smp.h:13,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/mmzone_64.h:12,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:773,
from include/linux/gfp.h:4,
from include/linux/kmod.h:22,
from include/linux/module.h:13,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:12:
/usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/apicdef.h:133:1: warning: this is the location of the previous definition
In file included from /tmp/vmware-config0/vmmon-only/./include/x86.h:21,
from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86desc.h:593:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/machine.h:24,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:15,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/x86.h:830:1: warning: "PTE_PFN_MASK" redefined
In file included from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/paravirt.h:7,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/irqflags.h:61,
from include/linux/irqflags.h:57,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/system.h:11,
from /usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/processor.h:17,
from include/linux/prefetch.h:14,
from include/linux/list.h:6,
from include/linux/module.h:9,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:12:
/usr/src/linux-headers-2.6.32-22-generic/arch/x86/include/asm/pgtable_types.h:182:1: warning: this is the location of the previous definition
In file included from /tmp/vmware-config0/vmmon-only/./include/vcpuset.h:78,
from /tmp/vmware-config0/vmmon-only/./include/modulecall.h:22,
from /tmp/vmware-config0/vmmon-only/./common/vmx86.h:18,
from /tmp/vmware-config0/vmmon-only/linux/driver.h:16,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:226:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:230:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:298:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:304:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:357:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:402:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:446:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:489:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:533:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:576:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:620:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:663:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:665:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:705:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:748:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:750:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:790:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:831:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:833:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:871:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:912:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:914:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:952:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1073:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1077:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1124:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1329:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1454:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_atomic.h:1587:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:37:5: warning: "VMW_HAVE_EPOLL" is not defined
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:43:5: warning: "VMW_HAVE_EPOLL" is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/driver.h:20,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:49:
/tmp/vmware-config0/vmmon-only/./include/compat_wait.h:60: error: conflicting types for ‘poll_initwait’
include/linux/poll.h:70: note: previous declaration of ‘poll_initwait’ was here
In file included from /tmp/vmware-config0/vmmon-only/./include/vm_asm_x86_64.h:23,
from /tmp/vmware-config0/vmmon-only/./include/vm_asm.h:28,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:52:
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:430:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:676:7: warning: "_MSC_VER" is not defined
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86.h:716:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config0/vmmon-only/./include/vm_asm.h:28,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:52:
/tmp/vmware-config0/vmmon-only/./include/vm_asm_x86_64.h:40:7: warning: "_MSC_VER" is not defined
In file included from /tmp/vmware-config0/vmmon-only/linux/vmhost.h:13,
from /tmp/vmware-config0/vmmon-only/linux/driver.c:71:
/tmp/vmware-config0/vmmon-only/./include/compat_semaphore.h:5:27: error: asm/semaphore.h: No such file or directory
/tmp/vmware-config0/vmmon-only/linux/driver.c:146: error: unknown field ‘nopage’ specified in initializer
/tmp/vmware-config0/vmmon-only/linux/driver.c:147: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c:150: error: unknown field ‘nopage’ specified in initializer
/tmp/vmware-config0/vmmon-only/linux/driver.c:151: warning: initialization from incompatible pointer type
/tmp/vmware-config0/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/vmware-config0/vmmon-only/linux/driver.c:1650: error: ‘struct task_struct’ has no member named ‘euid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1650: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1651: error: ‘struct task_struct’ has no member named ‘fsuid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1651: error: ‘struct task_struct’ has no member named ‘uid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1652: error: ‘struct task_struct’ has no member named ‘egid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1652: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1653: error: ‘struct task_struct’ has no member named ‘fsgid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1653: error: ‘struct task_struct’ has no member named ‘gid’
/tmp/vmware-config0/vmmon-only/linux/driver.c:1670: error: too many arguments to function ‘smp_call_function’
make[2]: *** [/tmp/vmware-config0/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-config0/vmmon-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.32-22-generic'
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-config0/vmmon-only'
Unable to build the vmmon module.

For more information on how to troubleshoot module-related problems, please
visit our Web site at "http://www.vmware.com/download/modules/modules.html" and
"http://www.vmware.com/support/reference/linux/prebuilt_modules_linux.html".

Execution aborted.

mum@KubuMuM1004lts:~/Downloads/vmware-server-distrib$

Next do this:

cd /home/mum/Downloads
wget -c http://www.insecure.ws/warehouse/vmware-update-2.6.32-5.5.9.tar.bz2
tar xvfj vmware-update*.tar.bz2

Before we finish the VMware Server installation, we must build a new kernel with the init_mm feature enabled. Become root...

sudo su

... and install the kernel source:

apt-get install linux-source-2.6.32

Next we install a few packages that we need to build the kernel:

apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge linux libncurses5-dev kernel-package

If you notice that a new kernel gets installed during this command, please reboot the system:

reboot

Now become root again:

sudo su

Next do this:

cd /usr/src
tar xvfj linux-source-2.6.32.tar.bz2
cd linux-source-2.6.32

Open arch/x86/kernel/init_task.c...

kate arch/x86/kernel/init_task.c

... and add the line

EXPORT_UNUSED_SYMBOL(init_mm);

right at the end of the file, behind

DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS;:

[...]

DEFINE_PER_CPU_SHARED_ALIGNED(struct tss_struct, init_tss) = INIT_TSS;
EXPORT_UNUSED_SYMBOL(init_mm);

Then copy the kernel configuration of the current kernel into the kernel source directory...

cp /boot/config-`uname -r` .config

... and run:

make menuconfig

In the kernel configuration menu, go to Load an Alternate Configuration File...

... fill in .config and select Ok:

Next select Exit in the main kernel configuration menu...

... and then Yes when you're asked: Do you wish to save your new kernel configuration?

Then run

make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers

to build the new kernel. This can take a lot of time so be patient.

Afterwards you can find a linux-image and a linux-headers .deb package in the /usr/src/ directory:

cd /usr/src/
ls -l

root@KubuMuM1004lts:/usr/src# ls -l
totale 105304
drwxrwsr-x 6 root src 4096 2010-05-17 12:36 .
drwxr-xr-x 11 root root 4096 2010-05-10 10:14 ..
drwxr-xr-x 24 root root 4096 2010-05-17 12:36 linux-headers-2.6.32.11+drm33.2-custom
-rw-r--r-- 1 root src 6506940 2010-05-17 12:27 linux-headers-2.6.32.11+drm33.2-custom_2.6.32.11+drm33.2-custom-10.00.Custom_amd64.deb
drwxr-xr-x 24 root root 4096 2010-05-13 13:46 linux-headers-2.6.32-22
drwxr-xr-x 7 root root 4096 2010-05-13 13:47 linux-headers-2.6.32-22-generic
-rw-r--r-- 1 root src 35487712 2010-05-17 12:26 linux-image-2.6.32.11+drm33.2-custom_2.6.32.11+drm33.2-custom-10.00.Custom_amd64.deb
drwxr-xr-x 26 root root 4096 2010-05-17 17:29 linux-source-2.6.32
-rw-r--r-- 1 root root 65806761 2010-04-28 20:17 linux-source-2.6.32.tar.bz2
root@KubuMuM1004lts:/usr/src#

Install both packages as follows...

dpkg -i linux-image-2.6.32.11+drm33.2-custom_2.6.32.11+drm33.2-custom-10.00.Custom_amd64.deb linux-headers-2.6.32.11+drm33.2-custom_2.6.32.11+drm33.2-custom-10.00.Custom_amd64.deb

Check at this time if the initrd image of your freshly compiled kernel is present in the /boot directory, running:

cd /boot
ls -l

totale 56120
-rw-r--r-- 1 root root 634929 2010-04-16 13:32 abi-2.6.32-21-generic
-rw-r--r-- 1 root root 634929 2010-04-28 18:50 abi-2.6.32-22-generic
-rw-r--r-- 1 root root 110372 2010-05-17 10:28 config-2.6.32.11+drm33.2-custom
-rw-r--r-- 1 root root 110365 2010-04-16 13:32 config-2.6.32-21-generic
-rw-r--r-- 1 root root 110365 2010-04-28 18:50 config-2.6.32-22-generic
drwxr-xr-x 3 root root 4096 2010-05-17 14:56 grub
-rw-r--r-- 1 root root 14393788 2010-05-17 14:53 initrd.img-2.6.32.11+drm33.2-custom
-rw-r--r-- 1 root root 8327398 2010-05-07 23:09 initrd.img-2.6.32-21-generic
-rw-r--r-- 1 root root 14447659 2010-05-13 16:32 initrd.img-2.6.32-22-generic
-rw-r--r-- 1 root root 160280 2010-03-23 10:40 memtest86+.bin
-rw-r--r-- 1 root root 2101323 2010-05-17 12:25 System.map-2.6.32.11+drm33.2-custom
-rw-r--r-- 1 root root 2152657 2010-04-16 13:32 System.map-2.6.32-21-generic
-rw-r--r-- 1 root root 2152657 2010-04-28 18:50 System.map-2.6.32-22-generic
-rw-r--r-- 1 root root 1336 2010-04-16 13:35 vmcoreinfo-2.6.32-21-generic
-rw-r--r-- 1 root root 1336 2010-04-28 18:53 vmcoreinfo-2.6.32-22-generic
-rw-r--r-- 1 root root 4008960 2010-05-17 12:25 vmlinuz-2.6.32.11+drm33.2-custom
-rw-r--r-- 1 root root 4037888 2010-04-16 13:32 vmlinuz-2.6.32-21-generic
-rw-r--r-- 1 root root 4038080 2010-04-28 18:50 vmlinuz-2.6.32-22-generic

And if not, then run:

sudo mkinitramfs -k -o /tmp/initramfs-2.6.32.11-custom 2.6.32.11+drm33.2-custom

sudo update-initramfs -c -k 2.6.32.11+drm33.2-custom

Check again if your /boot directory is correctly formed ... and then reboot the system:

reboot

Afterwards, run

uname -a

... as a normal user, and you should see your new kernel:

mum@KubuMuM1004lts:~$ uname -a
Linux KubuMuM1004lts 2.6.32.11+drm33.2-custom #1 SMP Mon May 17 10:55:41 CEST 2010 x86_64 GNU/Linux
mum@KubuMuM1004lts:~$

Now we can continue with the VMware Server installation:

cd /home/mum/Downloads/vmware-update*/
sudo ./runme.pl

Answer the following question with yes:

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

Afterwards you can accept the default values simply by hitting .

When the installer asks you

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]

you can either accept the default value or specify a location that has enough free space to store your virtual machines.

At the end of the installation, you will be asked to enter a serial number:

Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:

Fill in your serial number for VMware Server.

After the successful installation, you can delete the VMware Server download file and the installation directory:

cd /home/mum/Downloads
rm -f VMware-server*
rm -fr vmware-server-distrib/
rm -fr vmware-update*

You will now find VMware Server under Applications > Lost Objects > VMware Server Console:

When you start it, select Local host:

Afterwards, you can create virtual machines (or import your virtual Windows machine that you created with VMware Converter):

Note: May be necessary, sometimes, run it with "sudo" rights. To do so at "application launch", do:

kmenuedit

and add to the command line the gksudo command:

Then save and close the kmenuedit window.

(For installing gksudo if you don't have it, run:

sudo apt-get install gksu

).

From the next lauch on, before VMware starts, the system will ask for your password for "sudo" privileges.

Links