VMWare installation on kernel 3.x

Posted: February 4, 2012 in Technology
Tags: , ,

I was trying to install  VMWare workstation on my ubuntu 10.04 , downloaded the bundle file from VMWare site and installed using

#sh vmware.bundle

Till now everything was fine until I tried to run the workstation using vmware command from terminal.  I was getting the errors like

  CC [M]  /tmp/vmware-root/modules/vmmon-only/linux/driver.o
/tmp/vmware-root/modules/vmmon-only/linux/driver.c:788: error: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
make[2]: *** [/tmp/vmware-root/modules/vmmon-only/linux/driver.o] Error 1
make[1]: *** [_module_/tmp/vmware-root/modules/vmmon-only] Error 2
make[1]: Leaving directory `/home/kapil/Desktop/linux_src/linux-3.1.1′
make: *** [vmmon.ko] Error 2
make: Leaving directory `/tmp/vmware-root/modules/vmmon-only’

And I was just wondering what is going wrong. It looked like MACRO which has been used in the concerned file is removed from the latest kernel sources. I googled a bit and found a patch to successfully compile the vmmon module. You can get the patch from http://weltall.heliohost.org/wordpress/wp-content/uploads/2011/08/fullvmwarelinux310patch.tar.gz. Extract it using command

#tar -xvf  fullvmwarelinux310patch.tar.gz

now run the patch file as

#./patch-modules_2.6.39.sh

If you get an error like “Sorry, this script is only for VMWare WorkStation 7.1.4 or VMWare Player 3.1.4”, get your vmware and vmplayer version using

#vmwaree –version
and
#vmplayer –version

and update in patch file the values of vmreqver and plreqver accordingly. Now run the patch file as

#./patch-modules_2.6.39.sh

Now run the VMPlayer using

#vmplayer

If you get it done successfully and your vmplayer is coming up, you have got lucky otherwise if you get an error like

Starting VMware services:
VMware USB Arbitrator                                               done
Virtual machine monitor                                             done
Virtual machine communication interface                             done
VM communication interface socket family                            done
Blocking file system                                                done
Virtual ethernet                                                   failed

your vmnet module has just failed. To get your vmnet module running, do as follows:

#cd /usr/lib/vmware/modules/source/
#tar -xvf vmnet.tar
#cd vmnet-only
#vi compat_netdevice.h

Add following lines to this file

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 41, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 0, 0)) || LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0)
#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
functions are available. */
#define HAVE_FREE_NETDEV /* free_netdev() */
#define HAVE_NETDEV_PRIV /* netdev_priv() */
#define HAVE_NETIF_QUEUE
#define HAVE_NET_DEVICE_OPS
#endif

save the file.

#cd ..
#tar cvf vmnet.tar vmnet-only
#vmplayer

Accept the agreement from VMWare and you are good to go.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s