Sunday, 21 September 2014

Install VMPlayer in Ubuntu 14.04 64-bit

1. Download VMware-Player-5.0.4-1945795.x86_64.bundle.
2. Run the bundle.
chmod +x VMware-Player-5.0.4-1945795.x86_64.bundle
sudo ./VMware-Player-5.0.4-1945795.x86_64.bundle
3. Run VMware Player from dashboard which will ask for modules to be compiled and added to kernel. Proceed with Install option. But vmnet will fail to build which will be shown in the error log (/tmp/vmware-root/vmware-modconfig-xxxxx.log).
4. The fix is to patch vmnet-only/filter.c file with the content below. Copy the patch code to say p.patch under /usr/lib/vmware/modules/source
--- vmnet-only/filter.c 2013-10-18 23:11:55.000000000 +0400
+++ vmnet-only/filter.c 2013-12-03 04:16:31.751352170 +0400
@@ -27,6 +27,7 @@
 #include "compat_module.h"
 #include 
 #include 
+#include 
 #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
 #   include 
 #else
@@ -203,7 +204,11 @@
 #endif

 static unsigned int
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
 VNetFilterHookFn(unsigned int hooknum,                 // IN:
+#else
+VNetFilterHookFn(const struct nf_hook_ops *ops,        // IN:
+#endif
 #ifdef VMW_NFHOOK_USES_SKB
                  struct sk_buff *skb,                  // IN:
 #else
@@ -252,7 +257,14 @@

    /* When the host transmits, hooknum is VMW_NF_INET_POST_ROUTING. */
    /* When the host receives, hooknum is VMW_NF_INET_LOCAL_IN. */
-   transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
+    transmit = (hooknum == VMW_NF_INET_POST_ROUTING);
+#else
+    transmit = (ops->hooknum == VMW_NF_INET_POST_ROUTING);
+#endif
+    packetHeader = compat_skb_network_header(skb);
+    ip = (struct iphdr*)packetHeader;
sudo su -
cd /usr/lib/vmware/modules/source
tar -xvf vmnet.tar
#run the patch
patch vmnet-only/filter.c < patch.patch
tar -uvf vmnet.tar vmnet-only
rm -r vmnet-only
vmplayer
You should install the simulator as a normal user for vmplayer to boot else try running the player as root, which is not recommended.