Install VMWare on Debian

October 17th, 2007

Tags: , ,

Today I tried to install the latest VMWare server on my debian system, but ran into unexpected problems. The reason: it was partly written against an API which changed with the 2.6.22 kernel. With some patching I got it running though. It is not too hard to do, but requires you to unpack the package, change some files, and pack it pack again (so really not too hard).
Since I really trust the package system and didn’t want the vmware scripts messing around my configuration I used the package ‘vmware-package’ to create vmware packages which eases the management.

Don’t be afraid of the article’s length, it is really not that bad.

1. At first, download the VMware Server for Linux TAR Binary from the VMWare site and unpack it into an appropriate directory. Lets say it is called vmware-server-distrib
2. Next we modify the sources in two steps.

2.1 Change to vmware-server-distrib/lib/modules/source. In this directory two further archives are located: vmmon and vmnet.
2.2 At first we adapt the VM monitor.
2.2.1 Unpack the vmmon archive.
2.2.2 Open UNPACKED-VMMON/include/compat_kernel for edit.
2.2.3 Here you will find the following line

  1. static inline _syscall1(int, compat_exit, int, exit_code);

We will disable this line for our kernel by surrounding it like this

  2. static inline _syscall1(int, compat_exit, int, exit_code);
  3. #endif
  4. &#91;/code&#93;
  5. 2.2.4 Now repack the vmmon archive and move it back into <code>vmware-server-distrib/lib/modules/source</code>.
  7. 2.3 Next we fix the vmnet archive.
  8. 2.3.1 At first unpack the archive like we did before with the vmmon archive and change into the newly created directory.
  9. 2.3.2 Now download this patch: <a href='' title='patch-vmnet-for-linux-'>patch-vmnet-for-linux-</a>
  10. 2.3.3 Execute this command
  11. [code]
  12. zcat yourdownloaddir/patch-vmnet-for-linux- | patch -p4

When asked to which file a certain patch section should be applied pick the one suggested in the output. For details please refer to
2.3.4 Because the patch does not fix everything I needed to replace all remaining mac.raw strings with mac_header strings. A simple search and replace is sufficient.
2.3.5 Repack the vmnet archive and move it back to vmware-server-distrib/lib/modules/source.

2.4 At last we repack the original vmware server package, but now it does include the fixed code.

This gives us a working copy, but no debian packages, yet. Time for part Two.

3.1 Install the vmware-package package (see for further details)

  1. apt-get install vmware-package

3.2 The vmware-package program reads the version information for the vmware package to create from the file name of the vmware server TAR binary, so you should give the patched version the same name the original vmware archive had.
3.3. The following commands cannot be copied, but depend on the version of your copy. At first create the debian packages.

  1. make-vmpkg -s VMware-server-VERSION.tar.gz

3.4 Then install and build the the kernel source.

  1. dpkg -i vmware-server-kernel-source_VERSION.0_all.deb
  2. m-a -f -t -u /home/bob/data/copy/down/vmware-server a-b vmware-server-kernel-source

3.5 Install the created kernel module

  1. dpkg -i vmware-server-kernel-modules-VERSIONINFO.deb

3.6 and finally the remaining packages.

  1. dpkg -i vmware-server_VERSION.deb
  2. dpkg -i vmware-server-blobs_VERSION_all.deb

Before you can run any VMs VMWare requires you to get a serial number from their website (see this link).

To install it execute

  1. /usr/lib/vmware-server/bin/vmware-vmx --new-sn <serial-number>

Now you got the VMWare server running.

If you run a desktop machine and would like to use a GUI to interact with VMWare it is best to install the Linux Client package as well.
4.1 Download the VMware Server Linux client package from here.
4.2 Unpack the archive.
4.3 We can use vmware-package to create a debian package.

  1. make-vmpkg -s VMware-server-console-VERSION.tar.gz

4.4 Install the console with

  1. dpkg -i vmware-server-console_VERSION.deb

4.5 Now you should have the console available at Applications -> System Tools -> VMWare Server Console

If you experience any problems during the execution you should have a look at the error log at

  1. /tmp/vmware-USERNAME