0

VMware Workstation 8 on Linux Kernel 3.11 (Ubuntu, Fedora)

Straight off, this is extremely frustrating and took many hours of efforts, switching between OSes before coming up with a solution.

This solution has ONLY been tested to work on Linux systems running kernel version 3.11 variants and VMware Workstation 8.  Other combinations may actually work as well but it's more likely that you will need to Frankenstein bits and pieces together to get something functional.  That's what I had to do to get this working on my end and why I'm posting the solution.  I used Fedora 20 and Ubuntu 13.10 to work through this.

So, you're going to need kernel and build packages installed and then you're going to need to link or copy (I recommend symlink) your version.h file in the appropriate location.

Fedora 20:

yum install kernel-devel kernel-headers gcc
ln /usr/src/kernels/`uname -r`/include/generated/uapi/linux/version.h /lib/modules/`uname -r`/build/include/linux/

Ubuntu 13.10:

apt-get install build-essential linux-headers-`uname -r`
ln -s /usr/src/linux-headers-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-headers-$(uname -r)/include/linux/version.h

Now you will be able to install the base VMware Workstation 8 package without errors.  You can do that by locating your download and executing it with a sudo command.  It should be noted that in Fedora, you will need to have your user set up as an administrator or in the supplemental wheel group to enable sudo.

sudo ./VMware-Workstation-Full-8.0.6-1035888.x86_64.bundle

Feel free to choose the appropriate installer options as it prompts you.

Now comes the tricky and challenging part…  You're going to need to obtain several patches for the modules VMware will need in order to function.  These include for the vmnet, vmblock and vmci modules.  You can find the patch files in this post as well as the final tar files that have been put back together prior to execution of the module builds.

For ease of your use, I've zipped the patch files as well as the reconstructed tar files.  The patch files are simply to enable you to obtain them for the following steps without going to the source sites for them.  The tar files are the completed and successfully building versions of what I used after working through this process manually, you will need to rename the versions I have included from *.new.tar to *.tar:

Patch Files
Tar Files

There are plenty of instructions that tell you to simply apply the patches, I am including them for reference, and you can try to use them out of box if you like but there is a chance you'll run into the same error that I did and need to manually edit one of the files.

Original Patch File Source: https://communities.vmware.com/message/2282385

You'll need to obtain the procfs.patch, vmblock.3.10.patch and vmblock.3.11.patch.  Keep in mind, after applying the procfs.patch (as you'll see) it will error out in 2 sections and you'll need to manually resolve that (sorry, I'm too busy to fix the patch file itself at this time).  In addition, you'll probably need to patch the vmci module as well, those instructions will come after the current set.  Below are the instructions for the first part of these patches.

Make a backup of your original source files!  If something goes wrong you may need them and if you don't, you're going to be looking at reinstalling the VMware bundle.  Also, do not run the last command because there will be errors, running this command will not help, it will just generate an error telling you that vmnet.ko didn't work Error 2, etc.  You'll need to fix files first.  Also, if you need to uninstall VMware at any time the command is:

vmware-installer --uninstall-product vmware-workstation

Now the execution steps (NOTE: It is important to note that the commands below assume you have downloaded the patch files to the Downloads directory in your user account home directory, if you have not, then you need to modify the pathing to suit):

cd /usr/lib/vmware/modules/source
cp vmnet.tar /tmp/vmnet.orig.tar
cp vmblock.tar /tmp/vmblock.orig.tar
tar -xf vmnet.tar
tar -xf vmblock.tar
cd vmnet-only
sudo patch -p1 < ~/Downloads/procfs.patch
cd ../vmblock-only
sudo patch -p1 < ~/Downloads/vmblock.3.10.patch
sudo patch -p1 < ~/Downloads/vmblock.3.11.patch
cd ..
tar -cf vmblock.tar vmblock-only
tar -cf vmnet.tar vmnet-only
sudo vmware-modconfig --console --install-all

Below you'll find the message that returns when you attempt to apply the procfs.patch file.  Not happy news as it shows Hunk #3 and #4 failing.  These will cause the build to fail.  You will need to manually edit the netif.c file to correct these problems, but first, the error:

[email protected]_desktop:/usr/lib/vmware/modules/source/vmnet-only# sudo patch -p1 < ../procfs.patch
patching file bridge.c
patching file driver.c
Hunk #1 succeeded at 1775 (offset -10 lines).
Hunk #2 succeeded at 1805 (offset -10 lines).
patching file hub.c
patching file netif.c
Hunk #1 succeeded at 63 (offset 1 line).
Hunk #2 succeeded at 115 (offset 1 line).
Hunk #3 FAILED at 225.
Hunk #4 FAILED at 598.
2 out of 4 hunks FAILED -- saving rejects to file netif.c.rej
patching file procfs.c
patching file userif.c
Hunk #1 succeeded at 387 (offset -2 lines).
Hunk #2 succeeded at 401 (offset -2 lines).
Hunk #3 succeeded at 425 (offset -2 lines).
Hunk #4 succeeded at 1037 (offset -2 lines).
Hunk #5 succeeded at 1046 (offset -2 lines).
patching file vnetInt.h

Okay so you can clearly see that it says it saved the rejected patch contents to the netif.c.ref file.  That file will show you this:

--- netif.c
+++ netif.c
@@ -225,16 +270,13 @@
     * Make proc entry for this jack.
     */

-   retval = VNetProc_MakeEntry(netIf->port.jack.name, S_IFREG,
-                               &netIf->port.jack.procEntry);
+   retval = VNetProc_MakeEntryOps(netIf->port.jack.name, S_IFREG,
+                               &netIf->port.jack.procEntry, &proc_netif_fops, netIf);
    if (retval) {
       netIf->port.jack.procEntry = NULL;
       if (retval != -ENXIO) {
          goto outFreeDev;
       }
-   } else {
-      netIf->port.jack.procEntry->read_proc = VNetNetIfProcRead;
-      netIf->port.jack.procEntry->data = netIf;
    }

    /*
@@ -598,45 +640,3 @@
    return &netIf->stats;
 }

-
-/*
- *----------------------------------------------------------------------
- *
- * VNetNetIfProcRead --
- *
- *      Callback for read operation on this netif entry in vnets proc fs.
- *
- * Results:
- *      Length of read operation.
- *It is important to note that the commands below assume you have downloaded the patch files to the Downloads directory in your user account home directory, if you have not, then you need to modify the pathing to suit
- * Side effects:
- *      None.
- *
- *----------------------------------------------------------------------
- */
-
-int
-VNetNetIfProcRead(char   *page,  // IN/OUT: buffer to write into
-                  char  **start, // OUT: 0 if file < 4k, else offset into page
-                  off_t   off,   // IN: (unused) offset of read into the file
-                  int     count, // IN: (unused) maximum number of bytes to read
-                  int    *eof,   // OUT: TRUE if there is nothing more to read
-                  void   *data)  // IN: client data
-{
-   VNetNetIF *netIf = data;
-   int len = 0;
-   
-   if (!netIf) {

-      return len;
-   }
-   
-   len += VNetPrintPort(&netIf->port, page+len);
-
-   len += sprintf(page+len, "dev %s ", netIf->dev->name);
-   
-   len += sprintf(page+len, "\n");
-
-   *start = 0;
-   *eof   = 1;
-   return len;
-}

This shows that two sections did not apply correctly.  These sections still exist in the netif.c file and that means you need to manually edit them.  Open the netif.c file in your favorite text editor.  Each – line is an instruction to remove/comment out the contents and each + line is an instruction to add the contents of that line.  Below is a general example, feel free to do it how you see fit.  It should be noted that the contents you need to edit are right around the line numbers the error indicated, 225 and 598.

The first section:

//   retval = VNetProc_MakeEntry(netIf->port.jack.name, S_IFREG,
//                               &netIf->port.jack.procEntry);
        retval = VNetProc_MakeEntryOps(netIf->port.jack.name, S_IFREG,
                                        &netIf->port.jack.procEntry, &proc_netif_fops, netIf);

The second section:

/* int
VNetNetIfProcRead(char   *page,  // IN/OUT: buffer to write into
                  char  **start, // OUT: 0 if file < 4k, else offset into page
                  off_t   off,   // IN: (unused) offset of read into the file
                  int     count, // IN: (unused) maximum number of bytes to read
                  int    *eof,   // OUT: TRUE if there is nothing more to read
                  void   *data)  // IN: client data
{
   VNetNetIF *netIf = (VNetNetIF*)data;
   int len = 0;
   
   if (!netIf) {
      return len;
   }
   
   len += VNetPrintPort(&netIf->port, page+len);

   len += sprintf(page+len, "dev %s ", netIf->devName);
   
   len += sprintf(page+len, "\n");

   *start = 0;
   *eof   = 1;
   return len;
}*/

Now that should enable the vmnet module to compile properly.  You might want to try and see if it all works without a hitch.  If it does fail out at this point it will probably be related to an error about vmci.ko which will mean yet again another patch to get things functional.  This patch was not part of the original instructions I found elsewhere and had to be tracked down separately.

I retrieved the original patch file from this location: https://communities.vmware.com/servlet/JiveServlet/download/2344-444533-2234875-108182/vmci.linux-3-8.patch

Now, on to the patching process.  Much like the last, it is a matter of downloading the patch, extracting the tar contents, patching, and re-tarring the file.

cd /usr/lib/vmware/modules/source
cp vmci.tar /tmp/vmci.orig.tar
tar -xf vmci.tar
sudo patch -p0 < ~/Downloads/vmci.linux-3-8.patch
tar -cf vmci.tar vmci-only

Now that you've completed the vmci patch, you should be able to run the module script to build and install them successfully using the command below.

sudo vmware-modconfig --console --install-all
With any luck you should see the modules build out and everything run without problem.  If everything has gone well, just before you drop back to command prompt you should see the following output:

Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                    done
   VMware Authentication Daemon                                        done
   Shared Memory Available                                             done

That's it!  Hopefully this will take care of anyone running into this nasty little problem.

Uncategorized

Torry Crass

Leave a Comment