Installing VMware on Inux, prompting for exceptions at startup
Prompt to view log files
/tmp/vmware-root/vmware-19482.log
An error occurred while compiling the VMNET.O module, the error message is as follows
/TMP/MODCONFIG-4UP6CG/VMNET-ONLY/USERIF.C:117: +: error:passing argument5of ' get_user_pages ' fromIncompatible pointer type [-werror=incompatible-pointer-Types]retval= Get_user_pages (addr,1,1,0, &page, NULL);^In file included from/usr/src/linux-headers-4.9.0-deepin4-common/include/linux/highmem.h:7:0, from/TMP/MODCONFIG-4UP6CG/VMNET-ONLY/USERIF.C: -:
View USERIF.C File
Find the error location code as follows
#if linux_version_code >= kernel_version (4, 6, 0) retval = get_user_pages (addr, 1, 1, 0, &page, NULL); #elseretval = Get_user_pages (Current, current->mm, addr,1, 1, 0, &page, NULL);
In
/usr/src/linux-headers-4.9.0-deepin4-common/include/linux/mm.h
The definition of get_user_pages found in
Long Long Long intstruct page * *pages,struct vm_area_struct **vmas);
The number of arguments is inconsistent with the userif.c inside.
is the Linux kernel modified?
Based on the USERIF.C syntax, download the header file for 4.6 to view mm.h
Discover that it is defined as follows
Long Long Long Nr_pages, int int struct Page * *pages,struct vm_area_struct **vmas);
The function definition was changed.
On GitHub, I saw the change information and found that it was merging write with force into one parameter in 4.9.
Add a macro
#define FOLL_WRITE0X01
#define FOLL_FORCE0X10
To use and operate to get these two parameters
So modify the relevant statements in USERIF.C to
#ifLinux_version_code>= Kernel_version (4, 9, 0)retval= Get_user_pages (addr,1,1, &page, NULL);#elifLinux_version_code >= kernel_version (4, 6, 0)retval= Get_user_pages (addr,1,1,0, &page, NULL);#elseretval= Get_user_pages (Current, current->mm, addr,1,1,0, &page, NULL);#endif
Perform VMware after compiling again
Execute successfully!
Linux kernel 4.9 installation vmware12 error solution