You are not logged in.

#1 2017-01-29 22:36:46

digger
Member
Registered: 2012-07-06
Posts: 10

[SOLVED] VMware Workstation 12.5.2 and kernel 4.9

With the new kernel update, VMware Workstation 12.5.2 will not install, you will get an error similar too:

# vmware-modconfig --console --install-all
Stopping VMware services:
   VMware Authentication Daemon                                        done
   VM communication interface socket family                            done
   Virtual machine communication interface                             done
   Virtual machine monitor                                             done
   Blocking file system                                                done
make: Entering directory '/tmp/modconfig-SkOiQ1/vmmon-only'
Using kernel build system.
/sbin/make -C /lib/modules/4.9.6-1-ARCH/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/lib/modules/4.9.6-1-ARCH/build'
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/task.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/phystrack.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmmon-only/vmcore/moduleloop.o
/tmp/modconfig-SkOiQ1/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Free() falls through to next function PhysTrack_Add()
/tmp/modconfig-SkOiQ1/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Add() falls through to next function PhysTrack_Remove()
/tmp/modconfig-SkOiQ1/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Remove() falls through to next function PhysTrack_Test()
/tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.c: In function ‘HostIFGetUserPages’:
/tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.c:1166:67: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types]
    retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
                                                                   ^~~~~~
In file included from /tmp/modconfig-SkOiQ1/vmmon-only/./include/compat_page.h:23:0,
                 from /tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.c:32:
./include/linux/mm.h:1280:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^~~~~~~~~~~~~~
/tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.c:1166:13: error: too many arguments to function ‘get_user_pages’
    retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
             ^~~~~~~~~~~~~~
In file included from /tmp/modconfig-SkOiQ1/vmmon-only/./include/compat_page.h:23:0,
                 from /tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.c:32:
./include/linux/mm.h:1280:6: note: declared here
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:293: /tmp/modconfig-SkOiQ1/vmmon-only/linux/hostif.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/tmp/modconfig-SkOiQ1/vmmon-only/linux/driver.c:1283:1: warning: always_inline function might not be inlinable [-Wattributes]
 LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
 ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/modconfig-SkOiQ1/vmmon-only/common/task.o: warning: objtool: .text: unexpected end of section
make[1]: *** [Makefile:1490: _module_/tmp/modconfig-SkOiQ1/vmmon-only] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.9.6-1-ARCH/build'
make: *** [Makefile:120: vmmon.ko] Error 2
make: Leaving directory '/tmp/modconfig-SkOiQ1/vmmon-only'
make: Entering directory '/tmp/modconfig-SkOiQ1/vmnet-only'
Using kernel build system.
/sbin/make -C /lib/modules/4.9.6-1-ARCH/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/lib/modules/4.9.6-1-ARCH/build'
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/netif.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/procfs.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/smac_compat.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/smac.o
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/vnetEvent.o
In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/netif.c:43:
./include/linux/pci_ids.h:2253:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
 #define PCI_VENDOR_ID_VMWARE  0x15ad
 
In file included from /tmp/modconfig-SkOiQ1/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/netif.c:42:
/tmp/modconfig-SkOiQ1/vmnet-only/vm_device_version.h:56:0: note: this is the location of the previous definition
 #define PCI_VENDOR_ID_VMWARE                    0x15AD
 
  CC [M]  /tmp/modconfig-SkOiQ1/vmnet-only/vnetUserListener.o
/tmp/modconfig-SkOiQ1/vmnet-only/userif.c: In function ‘UserifLockPage’:
/tmp/modconfig-SkOiQ1/vmnet-only/userif.c:117:43: error: passing argument 5 of ‘get_user_pages’ from incompatible pointer type [-Werror=incompatible-pointer-types]
    retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
                                           ^
In file included from ./include/linux/highmem.h:7:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/userif.c:26:
./include/linux/mm.h:1280:6: note: expected ‘struct vm_area_struct **’ but argument is of type ‘struct page **’
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^~~~~~~~~~~~~~
/tmp/modconfig-SkOiQ1/vmnet-only/userif.c:117:13: error: too many arguments to function ‘get_user_pages’
    retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
             ^~~~~~~~~~~~~~
In file included from ./include/linux/highmem.h:7:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/userif.c:26:
./include/linux/mm.h:1280:6: note: declared here
 long get_user_pages(unsigned long start, unsigned long nr_pages,
      ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:294: /tmp/modconfig-SkOiQ1/vmnet-only/userif.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /tmp/modconfig-SkOiQ1/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/bridge.c:52:
/tmp/modconfig-SkOiQ1/vmnet-only/vm_device_version.h:56:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
 #define PCI_VENDOR_ID_VMWARE                    0x15AD
 
In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-SkOiQ1/vmnet-only/bridge.c:51:
./include/linux/pci_ids.h:2253:0: note: this is the location of the previous definition
 #define PCI_VENDOR_ID_VMWARE  0x15ad
 
make[1]: *** [Makefile:1490: _module_/tmp/modconfig-SkOiQ1/vmnet-only] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.9.6-1-ARCH/build'
make: *** [Makefile:120: vmnet.ko] Error 2
make: Leaving directory '/tmp/modconfig-SkOiQ1/vmnet-only'
Unable to install all modules.  See log for details.

Det has many other things to do and they would like people to learn how to user their system.  https://aur.archlinux.org/packages/vmware-patch/

A quick Google and I found this fix.  http://rglinuxtech.com/?p=1838

I cleaned it up a bit though, you do not need the lines for kernel 4.6 that are in the above fix.

# cd /usr/lib/vmware/modules/source
# cp vmnet.tar vmnet.tar.bak
# cp vmmon.tar vmmon.tar.bak
# tar -xf vmnet.tar
# tar -xf vmmon.tar

Use your favorite editor, I use vim
at ~line 113 remove these lines:

# vim vmnet-only/userif.c

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
retval = get_user_pages(addr, 1, 1, 0, &page, NULL);
#else
retval = get_user_pages(current, current->mm, addr,
1, 1, 0, &page, NULL);

insert these new lines inplace of the ones removed.

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
retval = get_user_pages(addr, 1, 0, &page, NULL);
#else
retval = get_user_pages(current, current->mm, addr,
1, 1, 0, &page, NULL);

remove these lines at ~line 1162

# vim /vmmon-only/linux/hostif.c

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, 0, ppages, NULL);
#else
retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
numPages, 0, 0, ppages, NULL);

insert these new lines inplace of the ones removed.

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
#else
retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
numPages, 0, 0, ppages, NULL);

cleanup and install

# tar -cf vmnet.tar vmnet-only
# tar -cf vmmon.tar vmmon-only
# vmware-modconfig --console --install-all

run vmware from the GUI.

Offline

#2 2017-01-31 01:56:21

vaporize93
Member
Registered: 2017-01-31
Posts: 2

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

Thx!!

Offline

#3 2017-01-31 17:24:19

mand
Member
Registered: 2017-01-31
Posts: 1

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

#!/bin/sh
cd /usr/lib/vmware/modules/source
tar xf vmmon.tar
mv vmmon.tar vmmon.old.tar
sed -r -i -e 's/KERNEL_VERSION\(4, 6, 0\)/KERNEL_VERSION\(4, 9, 0\)/g' vmmon-only/linux/hostif.c
sed -r -i -e 's/retval = get_user_pages\(\(unsigned long\)uvAddr, numPages, 0, 0, ppages, NULL\);/retval = get_user_pages\(\(unsigned long\)uvAddr, numPages, 0, ppages, NULL\);/g' vmmon-only/linux/hostif.c
tar cf vmmon.tar vmmon-only
rm -r vmmon-only
tar xf vmnet.tar
mv vmnet.tar vmnet.old.tar
sed -r -i -e 's/KERNEL_VERSION\(4, 6, 0\)/KERNEL_VERSION\(4, 9, 0\)/g' vmnet-only/userif.c
sed -r -i -e 's/retval = get_user_pages\(addr, 1, 1, 0, \&page, NULL\);/retval = get_user_pages\(addr, 1, 0, \&page, NULL\);/g' vmnet-only/userif.c
tar cf vmnet.tar vmnet-only
rm -r vmnet-only

Offline

#4 2017-02-01 22:16:08

Yseinborm
Member
Registered: 2016-04-18
Posts: 8

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

Thx² !! (mand method)

Offline

#5 2017-02-04 07:01:35

long
Member
Registered: 2017-02-04
Posts: 1

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

thank a lot !!!it works like a charm

Offline

#6 2017-02-06 22:02:19

1ptb3b
Member
Registered: 2017-01-17
Posts: 6

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

Hi. I tried running the instructions here, but I can't get the modules to build. hmm

I had installed Workstation back before the 4.9 kernel landed in Arch and I'm trying to upgrade my current installation.

$ uname -a
Linux arch 4.9.7-1-ARCH #1 SMP PREEMPT Wed Feb 1 19:33:40 CET 2017 x86_64 GNU/Linux
$ gcc --version
gcc (GCC) 6.3.1 20170109
$ vmware --version
VMware Workstation 12.5.2 build-4638234

This is what the function in vmnet-only/userif.c looks like.

static INLINE struct page *
UserifLockPage(VA addr) // IN
{
   struct page *page = NULL;
   int retval;

   down_read(&current->mm->mmap_sem);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
   retval = get_user_pages(addr, 1, 0, &page, NULL);
#else
   retval = get_user_pages(current, current->mm, addr,
                           1, 1, 0, &page, NULL);
#endif
   up_read(&current->mm->mmap_sem);

   if (retval != 1) {
      return NULL;
   }

   return page;
}

The full file is here: https://gist.github.com/variadico/84659 … rif-c-L109

Additionally, this is what the function in vmmon-only/linux/hostif.c looks like.

static int
HostIFGetUserPages(void *uvAddr,          // IN
                   struct page **ppages,  // OUT
                   unsigned int numPages) // IN
{
   int retval;

   down_read(&current->mm->mmap_sem);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
   retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
#else
   retval = get_user_pages(current, current->mm, (unsigned long)uvAddr,
                           numPages, 0, 0, ppages, NULL);
#endif
   up_read(&current->mm->mmap_sem);

   return retval != numPages;
}

The full file is here: https://gist.github.com/variadico/84659 … if-c-L1157

After re-tarring the directories, I tried running vmware-modconfig, but the command fails.

# vmware-modconfig --console --install-all
Stopping VMware services:
... more stuff...
make[1]: Leaving directory '/usr/lib/modules/4.9.7-1-ARCH/build'
/sbin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-6ogPnQ/vmnet-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-6ogPnQ/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory '/tmp/modconfig-6ogPnQ/vmnet-only'
Unable to install all modules.  See log for details.

Then, I decided to check the log at /tmp/vmware-root/vmware-11423.log.

# tail -n 7 vmware-11423.log 
2017-02-06T13:55:32.015-08:00| modconfig| I125: Successfully built vmnet.  Module is currently at "/tmp/modconfig-6ogPnQ/vmnet.o".
2017-02-06T13:55:32.015-08:00| modconfig| I125: Found the vmnet symvers file at "/tmp/modconfig-6ogPnQ/vmnet-only/Module.symvers".
2017-02-06T13:55:32.015-08:00| modconfig| I125: Installing vmnet from /tmp/modconfig-6ogPnQ/vmnet.o to /lib/modules/4.9.7-1-ARCH/misc/vmnet.ko.
2017-02-06T13:55:32.015-08:00| modconfig| I125: Registering file "/lib/modules/4.9.7-1-ARCH/misc/vmnet.ko".
2017-02-06T13:55:32.437-08:00| modconfig| I125: "/usr/lib/vmware-installer/2.1.0/vmware-installer" exited with status 256.
2017-02-06T13:55:32.437-08:00| modconfig| W115: Failed to install vmnet to /lib/modules/4.9.7-1-ARCH/misc/vmnet.ko.
2017-02-06T13:55:32.441-08:00| modconfig| I125: We are now shutdown.  Ready to die!

Does anyone have any hints of what else I could try? I also tried mand's script and got the same result: "Unable to install all modules.  See log for details.".

Last edited by 1ptb3b (2017-02-06 22:14:49)

Offline

#7 2017-02-06 22:32:39

1ptb3b
Member
Registered: 2017-01-17
Posts: 6

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

Okay. Sorry. Never mind. I uninstalled workstation and reinstalled it. Now everything works...

Offline

#8 2017-02-15 09:47:53

ajaiveersandhu
Member
From: Chandigarh, India
Registered: 2017-01-28
Posts: 4

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

thanks, great work !!!

Offline

#9 2017-08-23 08:38:46

notroot
Member
Registered: 2017-08-23
Posts: 1

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9

Thx^n !! (mand method)

Offline

#10 2017-08-23 08:43:35

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 8,145
Website

Re: [SOLVED] VMware Workstation 12.5.2 and kernel 4.9


Sakura:-
Mobo: MSI X299 TOMAHAWK ARCTIC // Processor: Intel Core i7-7820X 3.6GHz // GFX: nVidia GeForce GTX 970 // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 5x 1TB HDD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB