VMware Communities
Pavlinux
Enthusiast
Enthusiast

Vmware Workstation 10.0.1 build-1379776 patch for Linux kernel 3.13

27 Replies
gskjelstad
Contributor
Contributor

Wrote a blog post in english for this:

http://ping8888.com/2013/12/13/vmware-modules-kernel-3-13/

Pavlinux
Enthusiast
Enthusiast

Cool!!! :smileyplus:

Reply
0 Kudos
mfelker
Expert
Expert

Alas this did not work for me on Ubuntu 14.04 kernel 3.13.0-031300rc3-generic:

The output of the patch command was:

patching file filter.c
patch: **** '---' expected at line 4 of patch

Even though the patch failed so the installation would as well I got this for the compile of WS:

---------------------------------------------------------------------------------------------------

logging to /tmp/vmware-root/vmware-modconfig-12503.log
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family                            done
   Virtual machine communication interface                             done(for reference)
   Virtual machine monitor                                             done
   Blocking file system                                                done
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-ksL0CC/vmmon-only'
/usr/bin/make -C /lib/modules/3.13.0-031300rc3-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules(for reference)
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-031300rc3-generic'
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/linux/driver.o(for reference)
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/memtrack.o(for reference)
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/phystrack.o(for reference)
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/task.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-ksL0CC/vmmon-only/vmcore/moduleloop.o
/tmp/modconfig-ksL0CC/vmmon-only/linux/driver.c:1342:1: warning: always_inline function might not be inlinable [-Wattributes]
LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
^
  LD [M]  /tmp/modconfig-ksL0CC/vmmon-only/vmmon.o
  Building modules, stage 2.(for reference)
  MODPOST 1 modules
  CC      /tmp/modconfig-ksL0CC/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/modconfig-ksL0CC/vmmon-only/vmmon.ko
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-031300rc3-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= postbuild
make[1]: Entering directory `/tmp/modconfig-ksL0CC/vmmon-only'
make[1]: `postbuild' is up to date.(for reference)(for reference)
make[1]: Leaving directory `/tmp/modconfig-ksL0CC/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory `/tmp/modconfig-ksL0CC/vmmon-only'
Using 2.6.x kernel build system.
make: Entering directory `/tmp/modconfig-ksL0CC/vmnet-only'
/usr/bin/make -C /lib/modules/3.13.0-031300rc3-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
          MODULEBUILDDIR= modules
make[1]: Entering directory `/usr/src/linux-headers-3.13.0-031300rc3-generic'(for reference)
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/netif.o
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-ksL0CC/vmnet-only/filter.o(for reference)
/tmp/modconfig-ksL0CC/vmnet-only/hub.c: In function ‘VNetHubFindHubByID’:
/tmp/modconfig-ksL0CC/vmnet-only/hub.c:132:49: warning: argument to ‘sizeof’ in ‘memcmp’ call is the same expression as the first source; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
         memcmp(idNum, currHub->id.pvnID, sizeof idNum))) {
                                                 ^
/tmp/modconfig-ksL0CC/vmnet-only/hub.c: In function ‘VNetHubAlloc’:
/tmp/modconfig-ksL0CC/vmnet-only/hub.c:315:36: warning: argument to ‘sizeof’ in ‘memcpy’ call is the same pointer type ‘uint8 *’ as the destination; expected ‘uint8’ or an explicit length [-Wsizeof-pointer-memaccess]
   memcpy(hub->id.pvnID, id, sizeof id);
                                    ^
/tmp/modconfig-ksL0CC/vmnet-only/filter.c:206:1: error: conflicting types for ‘VNetFilterHookFn’
VNetFilterHookFn(unsigned int hooknum,                 // IN:
^
/tmp/modconfig-ksL0CC/vmnet-only/filter.c:64:18: note: previous declaration of ‘VNetFilterHookFn’ was here
static nf_hookfn VNetFilterHookFn;
                  ^
/tmp/modconfig-ksL0CC/vmnet-only/filter.c:64:18: warning: ‘VNetFilterHookFn’ used but never defined [enabled by default]
/tmp/modconfig-ksL0CC/vmnet-only/filter.c:206:1: warning: ‘VNetFilterHookFn’ defined but not used [-Wunused-function]
VNetFilterHookFn(unsigned int hooknum,                 // IN:(for reference)
^
make[2]: *** [/tmp/modconfig-ksL0CC/vmnet-only/filter.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [_module_/tmp/modconfig-ksL0CC/vmnet-only] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-031300rc3-generic'
make: *** [vmnet.ko] Error 2
make: Leaving directory `/tmp/modconfig-ksL0CC/vmnet-only'
Failed to build vmnet.  Failed to execute the build command.(for reference)
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                   failed
   VMware Authentication Daemon               

--------------------------------------------------------------------------------------

Perhaps this will  help the developer so I won't have to back off 3.13 to 3.12 which compiles without need of a patch.

BTW there is a new  program for a CLI compile so the syntax is now:

/usr/lib/vmware/bin/vmware-modconfig-console --install-all

Reply
0 Kudos
Pavlinux
Enthusiast
Enthusiast

Here true patch vmware kernel 3.13

mfelker
Expert
Expert

Thanks Pavlinux!  I will  try the  patch soon as I already installed WS 10 on Kernel 3.12.x.  Can I assume that cutting and pasting the patch data will not include the section "RAW datat"?  Thank you as always for these WS patches!!

Reply
0 Kudos
WoodyZ
Immortal
Immortal

mfelker wrote: Can I assume that cutting and pasting the patch data will not include the section "RAW datat"?

One can copy and paste from either section to create the patch file.   It should be be blatantly obvious it's one or the other and not both since the code in each section is identical and the only different is formatting colors and line numbers, none of which are relevant to the actual patch file itself! Smiley Wink

Reply
0 Kudos
mfelker
Expert
Expert

How could I have failed to see the obvious.:smileyblush:  What has you experience been with this patch to kernel 3.13.x? running Ubuntu 14.04 and using WS 10?It is blatantly obvious that it all must be working for you!Smiley Happy

In any event I'm not a developer like you must be to see the obvious but a section called RAW DATA, with little or no code just seems less likely to be a diff patch  than the section above which looks like code to me - therefore I'll use it.

But wait!  I should wait  for your report using RAW DATA as the patch!!

Reply
0 Kudos
WoodyZ
Immortal
Immortal

mfelker wrote:  but a section called RAW DATA, with little or no code just seems less likely to be a diff patch  than the section above which looks like code to me - therefore I'll use it.

But wait!  I should wait  for your report using RAW DATA as the patch!!

What on earth do you mean by "with little or no code just seems less likely to be a diff patch" the "RAW Paste Data" section has the absolute identical amount of code, each and every line, the section above it has!  And as I already said the only difference between the two is formatting colors and line numbers, none of which are relevant to the actual patch file itself.  Set aside the color and line numbers, which certainly do not show once copied and pasted, now how can you not see that the actual code is identical and you don't need to be a developer to see that each given string of alphanumeric characters is identical.  Since on your Bio you state that you were a "Programmer/Analyst Wage Slave 12 years" I'm just surprised this has to be explained to you.

Once you copy and paste either section to save as a file does it look any different or the code itself not be identical?

Reply
0 Kudos
mfelker
Expert
Expert

You are correct.  I failed to scroll down.  But my assumption that you have actually used the correct patch must be correct.  Interested whether you used an Nvdia or AMD card for Ubuntu 14.04 with kernel 3.13.x

Apparently I must have overlooked something else since your "bio" appears to be blank. Please correct my stupidity in this matter.  Maybe I just didn't scroll down.  Thanks as always to the insightful remarks.

Reply
0 Kudos
mfelker
Expert
Expert

Output from patch command.

/usr/lib/vmware/modules/source$ sudo patch filter.c < ~/vmnet313.patch
patching file filter.c
Hunk #1 FAILED at 27.
Hunk #2 FAILED at 203.
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 35: 

patch unexpectedly ends in middle of line
patch: **** malformed patch at line 35:

This is your patch from pastebin - did I copy and paste wrong?

--- 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 <linux/mutex.h>
     #include <linux/netdevice.h>
    +#include <linux/version.h>
     #if COMPAT_LINUX_VERSION_CHECK_LT(3, 2, 0)
     #   include <linux/module.h>
     #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_LOCA

/usr/lib/vmware/modules/source$ sudo patch filter.c < ~/vmnet313.patch
patching file filter.c
Hunk #1 FAILED at 27.
Hunk #2 FAILED at 203.
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 35: 

L_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;

Reply
0 Kudos
WoodyZ
Immortal
Immortal

Okay, If I ran into a situation like this I'd just simply manually read the patch and manual apply it to the filter.c file and be done with it! Smiley Wink

Then having taken the time to manually patch it I'd create a new patch file so if I need to do it again in this same use case scenario I have an actual diff patch based on the contents of the original file and the manually patched file and know because I did it myself it will apply the diff without generating an error! Smiley Wink

So from a VMware Workstation 10.0.1 install using the /usr/lib/vmware/modules/source/vmnet.tar/filter.c file the attached ws1001.vmnet.filter.c.313.patch.zip file contains a diff patch created using diff -Naru against the original and manually edited files.  I then tested it on an original copy of filter.c and the only output was what is expected... patching file filter.c and nothing else. Smiley Happy

iCornel
Contributor
Contributor

thank you, works.

Reply
0 Kudos
rakotomandimby
Enthusiast
Enthusiast

This tip worked for me, today, on a Fedora 19 that just updated to kernel 3.13.5

[mrakotomandimby@localhost ~]$ rpm -aq | grep 3.13.5
kernel-headers-3.13.5-101.fc19.x86_64
kernel-3.13.5-101.fc19.x86_64
kernel-modules-extra-3.13.5-101.fc19.x86_64
kernel-devel-3.13.5-101.fc19.x86_64

Thank you.

Reply
0 Kudos
Adhikarin
Contributor
Contributor

Thank you very much ! I't works for me too.

Reply
0 Kudos
mfelker
Expert
Expert

Do you know (or anybody on this thread) a patch that will work with Ubuntu 14.04 Kernel 3.13.x?

Reply
0 Kudos
gskjelstad
Contributor
Contributor

Check my blog post, second reply to this thread.

Sent from my (old) iPhone5

Reply
0 Kudos
mfelker
Expert
Expert

Than ks gskjelstad. Unfortunately your patch seems to apply to Fedora  Rawhide.  This is not my host.  It is Ubuntu 14.04 with either custom (Ubuntus') or generic versions of 3.13. WoddyZ made a diff file f from  your patch and somebody said it worked - but on  what host?  They didn't say.  A Google search leads back to this thread.  opensUSE with 3.13 works - somebody said.  However the standard problem with HUNKS is referenced.

Reply
0 Kudos
Adhikarin
Contributor
Contributor

Hello ! Yes It worked in ubuntu 14.04, kernel 3.13

Reply
0 Kudos
gskjelstad
Contributor
Contributor

The patch works on both. In fact there is a comment on my thread that has it working in Ubuntu...

Sent from my (old) iPhone5

Reply
0 Kudos