VMware – 12.5.2 Released – Still Broken With Kernel 4.9..
Just updated the test system to VMware Workstation Pro 12.5.2, and it still fails to compile with Kernel 4.9-rc5
I have – so far – been unable to find any other patches for this issue, but fortunately the nasty hack I documented in the article for 4.9-rc4 still works.. http://rglinuxtech.com/?p=1838
The release notes for 12.5.2 are here: http://pubs.vmware.com/Release_Notes/en/workstation/12pro/workstation-1252-release-notes.html
Robert Gadsdon. November 14, 2016.
What about 4.8.10? Works without patching?
4.8.X kernels are OK (running 12.5.2 on 4.8.11, now)
RG.
Steps:
tar -xf /usr/lib/vmware/modules/source/vmmon.tar
gedit vmmon-only/linux/hostif.c
In vmmon-only/linux/hostif.c, around line 1162, change
#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);
#endif
to
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
retval = get_user_pages((unsigned long)uvAddr, numPages, 0, ppages, NULL);
#else
#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);
#endif
#endif
sudo tar -cf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only/
tar -xf /usr/lib/vmware/modules/source/vmnet.tar
gedit vmnet-only/userif.c
In vmnet-only/userif.c, around line 113, change
#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);
#endif
to
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
retval = get_user_pages(addr, 1, 0, &page, NULL);
#else
#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);
#endif
#endif
sudo tar -cf /usr/lib/vmware/modules/source/vmnet.tar vmnet-only/
Use at your own risk!
Credit goes to http://rglinuxtech.com/?p=1838
works on Ubuntu 17.04 Daily, kernel 4.9.0-12-generic, gcc-6, build-essentials and linux headers
Awesome. Thanks a lot!
Fixed My Fedora 24 that I ran updates on this morning. I followed the steps above and everything is A-OK.
VMware Workstation 12 Pro – 12.5.0 build-4352439
Fedora 24 – 4.9.8-100.fc24.x86_64
Fantastic.
Gracias! me funciono a la perfeccion en Debian 9 stretch con el kernel 4.9.0-1-amd64
This worked on Ubuntu 16.04 with kernel 4.9.3
Worked for me too!
Thanks!
It’s fixed my VMWare on Fedora 25 with Kernel 4.9.x
Thank you so much
Thanks for this solution! It’s worked on my Fedora 25
Worked for me too on Manjaro with kernel 4.9.0-1-rt1, thanks a lot!
with this code how can i compile it? need some help
Simply folow the workaround explained above by Bharath M : http://rglinuxtech.com/?p=1847#comment-25733 . It worked for me!
Good afternoon
After applying the patch I got the following error:
2017-01-21T18: 37: 14.499-02: 00 | Vthread-4 | I125: Building module with command “/ usr / bin / make -j8 -C / tmp / modconfig-eP6X4N / vmnet-only auto-build HEADER_DIR = / lib / modules / 4.9.0-1-amd64 / build / include CC = / Usr / bin / gcc IS_GCC_3 = no ”
2017-01-21T18: 37: 14.501-02: 00 | Vthread-4 | W115: Failed to build vmnet. Failed to execute the build command.
Do I have to install any dependency?
My Kernel
Linux 4.9.0-1-amd64
My compiler
Gcc (Debian 6.3.0-3) 6.3.0 20170118
Copyright (C) 2016 Free Software Foundation, Inc.
My linuxs readers
Linux-headers-4.9.0-1-amd64 is already the new version (4.9.2-2).
Linux-headers-4.9.0-1-amd64 configured to install manually.
Anyone have any idea what that might be?
Thanks
You may have older(or newer) versions of gcc pointing to /usr/bin/gcc.
Worked for me on Fedora 25 with kernel 4.9.5-200 🙂
Worked for me on Debian GNU/Linux 9 with kernel 4.9.0-1-amd64.
Form me too (4.9.0-1-rt2-MANJARO #1 SMP PREEMPT RT Fri Jan 20 16:10:14 UTC 2017 x86_64 GNU/Linux)
Worked for me on Kali 2016.2 Kernel 4.9.0-kali-amd64
Not for me on 4.9.0-kali1-amd64
All went well, until I fired up a VM. VMPlayer kept freezing.
updated patch
http://www.hack4learn.com/2017/02/how-to-patch-kernel-module-in-vmware.html
Work on archlinux 4.9.6-1-ARCH
Not working !!!! 🙁
Help me to shoot out the error!
You might find this link userful: https://bugfixes.promisedev.com/ ; Direct download link: https://bugfixes.promisedev.com/download/patches/vmwkp4.9.tar
I made a small unofficial patch that applies the patch by Robert Gadsdon
Patch stopped working for me after 4.9.10 in Fedora 25.
still stoped?? how did you fixed mine is stopped too
Looks like the mm.h header file has changed… this is out of my league anyone care to venture if we can just change the prototype?
[root@tomservo vmmon-only]# /usr/bin/make -j8 -C /tmp/modconfig/vmmon-only auto-build HEADER_DIR=/lib/modules/4.9.12-200.fc25.x86_64/build/include CC=/usr/bin/gcc IS_GCC_3=no
make: Entering directory ‘/tmp/modconfig/vmmon-only’
Using kernel build system.
/usr/bin/make -C /lib/modules/4.9.12-200.fc25.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
MODULEBUILDDIR= modules
make[1]: Entering directory ‘/usr/src/kernels/4.9.12-200.fc25.x86_64’
CC [M] /tmp/modconfig/vmmon-only/linux/hostif.o
/tmp/modconfig/vmmon-only/linux/hostif.c: In function ‘HostIFGetUserPages’:
/tmp/modconfig/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/vmmon-only/./include/compat_page.h:23:0,
from /tmp/modconfig/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/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/vmmon-only/./include/compat_page.h:23:0,
from /tmp/modconfig/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
scripts/Makefile.build:293: recipe for target ‘/tmp/modconfig/vmmon-only/linux/hostif.o’ failed
make[2]: *** [/tmp/modconfig/vmmon-only/linux/hostif.o] Error 1
Makefile:1494: recipe for target ‘_module_/tmp/modconfig/vmmon-only’ failed
make[1]: *** [_module_/tmp/modconfig/vmmon-only] Error 2
make[1]: Leaving directory ‘/usr/src/kernels/4.9.12-200.fc25.x86_64’
Makefile:120: recipe for target ‘vmmon.ko’ failed
make: *** [vmmon.ko] Error 2
make: Leaving directory ‘/tmp/modconfig/vmmon-only’
[root@tomservo vmmon-only]#
Works on 17.04 @ Kernel 4.10.0-8-generic.
THANKS for linking @Bharath M
Hi Servicefuzzi,
i am facing the same issue on Ubuntu 17.4. Can you please help me to resolve this issue.
Also find the last 10 line of the log file:
2017-06-10T00:41:58.739+05:30| vthread-3| I120: Setting destination path for vmmon to “/lib/modules/4.10.0-22-generic/misc/vmmon.ko”.
2017-06-10T00:41:58.739+05:30| vthread-3| I120: Extracting the vmmon source from “/usr/lib/vmware/modules/source/vmmon.tar”.
2017-06-10T00:41:58.746+05:30| vthread-3| I120: Successfully extracted the vmmon source.
2017-06-10T00:41:58.747+05:30| vthread-3| I120: Building module with command “/usr/bin/make -j4 -C /tmp/modconfig-SHaYyl/vmmon-only auto-build HEADER_DIR=/lib/modules/4.10.0-22-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no”
2017-06-10T00:42:00.932+05:30| vthread-3| W110: Failed to build vmmon. Failed to execute the build command.
2017-06-10T00:42:00.934+05:30| vthread-3| I120: Setting destination path for vmnet to “/lib/modules/4.10.0-22-generic/misc/vmnet.ko”.
2017-06-10T00:42:00.934+05:30| vthread-3| I120: Extracting the vmnet source from “/usr/lib/vmware/modules/source/vmnet.tar”.
2017-06-10T00:42:00.943+05:30| vthread-3| I120: Successfully extracted the vmnet source.
2017-06-10T00:42:00.943+05:30| vthread-3| I120: Building module with command “/usr/bin/make -j4 -C /tmp/modconfig-SHaYyl/vmnet-only auto-build HEADER_DIR=/lib/modules/4.10.0-22-generic/build/include CC=/usr/bin/gcc IS_GCC_3=no”
2017-06-10T00:42:31.645+05:30| vthread-3| W110: Failed to build vmnet. Failed to execute the build command.
Great post! This solves it on 4.10 as well. But remember to change from 4, 9, 0 to 4, 10, 0.
Thank you!