0

As part of my clang/LLVM experiments and explorations with different clang-built kernel versions, I tried to install VMware Player 14.1.1(x86_64) on Ubuntu 17.10 x86_64 with clang-built VMware kernel modules (vmmon and vmnet) on clang-built host kernel 4.16 (latest stable as of now).

The problem

When I installed VMware Player 14.1.1 using VMware-Player-14.1.1-7528167.x86_64.bundle. The GUI installer showed "Installation was successful...". But, when I tried to run vmplayer from command-line, it led to a segfault/crash:

Segmentation fault (core dumped)
  "$BINDIR"/vmware-modconfig --appname="VMware Player" --icon="vmware-player"

It was not clear what actually went wrong - was it some installer's internal silent failure that went unnoticed or were kernel modules not successfully built/installed/loaded, or was it some compatibility issue of VMware Player with underlying host clang-built kernel and not gcc-built kernel.

So, I manually built vmmon and vmnet from /usr/lib/vmware/modules/source/(vmmon|vmnet).tar using clang/LLVM compiler itself as the host Linux kernel 4.16.0 was clang-built as well. After successfully building it, installing it and loading them and verifying them that thay are correctly loaded (lsmod, etc), I reran the vmplayer command - it again failed with the same segfault as shown above.

$ cat /proc/version 
Linux version 4.16.0 (exp@exp) (clang version 5.0.0-3 (tags/RELEASE_500/final)) #4 SMP Thu Apr 5 02:12:22 PDT 2018

$ lsmod | grep "vmnet\|vmmon"
vmnet                  53248  13 
vmmon                  90112  0 

$ vmplayer --version
.
.
VMware Player 14.1.1 build-7528167

$ vmplayer 
+ /usr/bin/vmware-modconfig '--appname=VMware Player' --icon=vmware-player
/usr/bin/vmplayer: line 109:  1467 Segmentation fault      (core dumped) "$BINDIR"/vmware-modconfig --appname="VMware Player" --icon="vmware-player"
+ exit 1

For my earlier report on successful bringup of clang-built kernel for Ubuntu 17.10 x86_64 along with clang-built Nvidia driver (v390.25, v390.42, etc), see: How do I build a 4.15.7 kernel with LLVM/clang and a Nvidia 390.25 x86_64 driver on Ubuntu 17.10 x86_64?

  • 1
    Thank you for sharing your knowledge to help future readers. But please always post in proper question and answer format. – pomsky Apr 7 '18 at 13:13
  • Well, it's in Q&A format for the ones who have question regarding installation and bringup of VMware Player on clang-built kernel and kernel modules for Ubuntu OS. And it's not off-topic like some totally unrelated post which I see plenty here and elsewhere and yet get retained for discussion. So, I don't think this needs to be closed, etc. – user194850 Apr 7 '18 at 14:21
  • Well, report covers many topics with respect to clang/LLVM and Linux kernel/modules/VMware Player/Ubuntu compatibility. I don't see people have tried these things at all so far. So, Dobey, I definitely think my report addresses many questions and answers that like-minded people will have. It's not a blog post either. – user194850 Apr 7 '18 at 14:37
  • 1
    I don't see the question here, it reads like a blog post, you even call it a report, where is the question? If you edit it I will remove the close vote but it must be a question and an answer. – Mark Kirby Apr 7 '18 at 15:47
  • 3
-1

Stage 1 : I tried to use gdb invidually with vmware-config/vmplayer binary to look at the failing point in their code. Running gdb on /usr/bin/vmware-config and /usr/bin/vmplayer is useless as they are just scripts and running directly on their binary counterparts: gdb --args /usr/lib/vmware/bin/vmware-modconfig --appname="VMware Player" --icon="vmware-player" and gdb /usr/lib/vmware/bin/vmplayer, didn't result in any segfault/crash either.

So, I had to invoke a gdb session as part of /usr/bin/vmware-config itself while it launches /usr/lib/vmware/bin/vmware-modconfig --appname="VMware Player" --icon="vmware-player" within itself. That worked and I saw ModConf_NewKernelInfo() within libvmware-modconfig.so was trying to get current kernel version information and while doing so or parsing the version information after getting it, it segfaulted.

$ vmplayer
GNU gdb (Ubuntu 8.0.1-0ubuntu1) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/vmware/bin/vmware-modconfig...(no debugging symbols found)...done.
(gdb) r
Starting program: /usr/lib/vmware/bin/vmware-modconfig --launcher=/usr/bin/vmware-modconfig --appname=VMware Player --icon=vmware-player
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
process 24600 is executing new program: /usr/lib/vmware/bin/appLoader
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fffe4b15700 (LWP 24633)]
[New Thread 0x7fffdffff700 (LWP 24634)]

Thread 1 "vmware-modconfi" received signal SIGSEGV, Segmentation fault.
0x00007ffff73312e8 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00007ffff73312e8 in  () at /lib/x86_64-linux-gnu/libc.so.6
#1  0x00007ffff674d72b in ModConf_NewKernelInfo () at /usr/lib/vmware/lib/libvmware-modconfig.so/libvmware-modconfig.so
#2  0x00007ffff6749540 in main () at /usr/lib/vmware/lib/libvmware-modconfig.so/libvmware-modconfig.so
#3  0x000055555556db6b in  ()
#4  0x0000555555569fd7 in main ()

Stage 2: I used strace on vmware-modconfig to get further in the direction of the kernel version retrieval/parsing which is resulting in crash. It turned out that, the above crash is likely related to parsing of the content of /proc/version.

$ strace /usr/bin/vmware-modconfig --appname="VMware Player" --icon="vmware-player" 2>&1 | tail
write(10, "2018-04-07T00:16:17.901-07:00| v"..., 89) = 89
openat(AT_FDCWD, "/proc/version", O_RDONLY) = 11
fstat(11, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
fcntl(11, F_GETFL)                      = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat(11, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(11, "Linux version 4.16.0 (exp@exp) (clan"..., 4096) = 111
read(11, "", 3072)                      = 0
close(11)                               = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
+++ killed by SIGSEGV (core dumped) +++

$ cat /tmp/vmware-g/vmware-17594.log 
2018-04-07T00:16:17.768-07:00| vthread-1| I125: Log for VMware Workstation pid=17594 version=14.1.1 build=build-7528167 option=Release
2018-04-07T00:16:17.768-07:00| vthread-1| I125: The process is 64-bit.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: Host codepage=UTF-8 encoding=UTF-8
2018-04-07T00:16:17.768-07:00| vthread-1| I125: Host is Linux 4.16.0 Ubuntu 17.10
2018-04-07T00:16:17.768-07:00| vthread-1| I125: DictionaryLoad: Cannot open file "/usr/lib/vmware/settings": No such file or directory.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: [msg.dictionary.load.openFailed] Cannot open file "/usr/lib/vmware/settings": No such file or directory.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: PREF Optional preferences file not found at /usr/lib/vmware/settings. Using default values.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: DictionaryLoad: Cannot open file "/home/g/.vmware/config": No such file or directory.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: [msg.dictionary.load.openFailed] Cannot open file "/home/g/.vmware/config": No such file or directory.
2018-04-07T00:16:17.768-07:00| vthread-1| I125: PREF Optional preferences file not found at /home/g/.vmware/config. Using default values.
2018-04-07T00:16:17.813-07:00| vthread-1| W115: Logging to /tmp/vmware-g/vmware-17594.log
2018-04-07T00:16:17.901-07:00| vthread-1| I125: Obtaining info using the running kernel.

Stage 3: After looking at the strace and gdb specific information from the above stages, I thought of running the usually suggested vmware-modconfig --console --install-all to fix any VMware kernel modules issue, since I didn't have the source code of /usr/lib/vmware/lib/libvmware-modconfig.so/libvmware-modconfig.so to debug further for finding what's with the kernel version information(/proc/version, etc) determining and parsing method within ModConf_NewKernelInfo() of libvmware-modconfig.so. It also segfaulted as I expected since it involves the same vmware-modconfig*.

$ sudo vmware-modconfig --console --install-all
[AppLoader] GLib does not have GSettings support.
Segmentation fault

Stage 4: Going one step further, I spent time on the output of cat /proc/version - one thing that I paid attention to was the compiler information of the compiler used to build kernel. That was the hitting-the-nail-on-its-head moment! I understood that VMware Player config/scripts probably assumes underlying host Linux kernel is built using some gcc-* version compiler and expects the output of cat /proc/version to have some gcc ... and if it doesn't find that (in this case, it's clang... as that's the compiler used for building host kernel), it doesn't seem to report any error/warning and simply segfaults - probably due to a NULL(from substring search on output of cat /proc/version for gcc...) dereference.

Below is what seems to be happening within vmware-modconfig and/or internal programs/scripts:

## My visualization of crash(SIGSEGV) case when compiler used to build kernel is clang-*/LLVM :
##
## == Likely a dereferencing of NULL similar to the below case ==

const char *gcc_ver = strstr("Linux version 4.16.0 (exp@exp) (clang version 5.0.0-3 (tags/RELEASE_500/final)) #4 SMP Thu Apr 5 02:12:22 PDT 2018", "gcc...");
if (strcmp(gcc_ver, "gcc...") == 0) { // Here, there's no check on gcc_ver to be
                                       // non-NULL - since it's likely that the compiler used to build the kernel
                       // is *assumed* to be always some gcc and so on. Probably, it's not designed to work
                       // work with clang/LLVM if the compiler used to build kernel is clang/LLVM.
         .
         .
         .
         .
}

##
##  My visualization of working case when compiler used to build kernel is gcc-* :
##

const char *gcc_ver = strstr("Linux version 4.16.0 (exp@exp) (gcc version 7.3.0 (Ubuntu 7.3.0-8ubuntu3)) #4 SMP Thu Apr 5 02:12:22 PDT 2018", "gcc...");
if (strcmp(gcc_ver, "gcc...") == 0) { // Works as always
         .
         .
         .
         .
}

Stage 6 : For the sake of VMware Player configuration script check, modified linux-4.16/fs/proc/version.c to report GCC 7.3.0 on a *need* basis, as the Linux compiler used to build the current kernel(4.16) instead of the actual clang/LLVM compiler used in building the current kernel(4.16). This took past the vmplayer invocation past the point where it would segfault, otherwise since the compiler information in /proc/version not being gcc-specific but clang-specific! This confirmed that my understanding and interpretation of VMware Player config/script being incapable of correctly translating the clang-compiler information in /proc/version into the actual clang/LLVM compiler used to build the underlying host kernel and hence the unexpected SIGSEGV/segfault.

$ eclang /lib/modules/4.16.0/build/vmlinux | head -1
++ strings -a /lib/modules/4.16.0/build/vmlinux
++ grep 'clang version'
Linux version 4.16.0 (exp@exp) (clang version 5.0.0-3 (tags/RELEASE_500/final)) #4 SMP Thu Apr 5 02:12:22 PDT 2018

$ egcc /lib/modules/4.16.0/build/vmlinux 
++ strings -a /lib/modules/4.16.0/build/vmlinux
++ grep 'GCC: ('


###
### [procfs] - version logic updated.
###

$ cat /proc/version 
Linux version 4.16.0 (exp@exp) (gcc version 7.3.0 (Ubuntu 7.3.0-8ubuntu3)) #4 SMP Thu Apr 5 02:12:22 PDT 2018

$ strace /usr/bin/vmware-modconfig --appname="VMware Player" --icon="vmware-player" 2>&1 | grep -A 40 -B 1 "/proc/version"
write(10, "2018-04-07T00:37:09.944-07:00| v"..., 89) = 89
openat(AT_FDCWD, "/proc/version", O_RDONLY) = 11
fstat(11, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
fcntl(11, F_GETFL)                      = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat(11, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(11, "Linux version 4.16.0 (exp@exp) (gcc "..., 4096) = 106
read(11, "", 3072)                      = 0
close(11)                               = 0
write(10, "2018-04-07T00:37:09.944-07:00| v"..., 71) = 71
access("/sbin/gcc-7.3", X_OK)           = -1 ENOENT (No such file or directory)
access("/home/g/CodeSourcery/Sourcery_G++_Lite/bin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/home/g/bin/gcc-7.3", X_OK)     = -1 ENOENT (No such file or directory)
access("/home/g/.local/bin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/sbin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/bin/gcc-7.3", X_OK)  = -1 ENOENT (No such file or directory)
access("/usr/sbin/gcc-7.3", X_OK)       = -1 ENOENT (No such file or directory)
access("/usr/bin/gcc-7.3", X_OK)        = -1 ENOENT (No such file or directory)
access("/sbin/gcc-7.3", X_OK)           = -1 ENOENT (No such file or directory)
access("/bin/gcc-7.3", X_OK)            = -1 ENOENT (No such file or directory)
access("/usr/games/gcc-7.3", X_OK)      = -1 ENOENT (No such file or directory)
access("/usr/local/games/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/snap/bin/gcc-7.3", X_OK)       = -1 ENOENT (No such file or directory)
access("/usr/lib/jvm/java-8-oracle/bin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/jvm/java-8-oracle/db/bin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/usr/lib/jvm/java-8-oracle/jre/bin/gcc-7.3", X_OK) = -1 ENOENT (No such file or directory)
access("/sbin/gcc-7", X_OK)             = -1 ENOENT (No such file or directory)
access("/home/g/CodeSourcery/Sourcery_G++_Lite/bin/gcc-7", X_OK) = -1 ENOENT (No such file or directory)
access("/home/g/bin/gcc-7", X_OK)       = -1 ENOENT (No such file or directory)
access("/home/g/.local/bin/gcc-7", X_OK) = -1 ENOENT (No such file or directory)
access("/usr/local/sbin/gcc-7", X_OK)   = -1 ENOENT (No such file or directory)
access("/usr/local/bin/gcc-7", X_OK)    = -1 ENOENT (No such file or directory)
access("/usr/sbin/gcc-7", X_OK)         = -1 ENOENT (No such file or directory)
access("/usr/bin/gcc-7", X_OK)          = 0
getuid()                                = 1000
stat("/usr/bin/gcc-7", {st_mode=S_IFREG|0755, st_size=287, ...}) = 0
access("/usr/bin/gcc-7", X_OK)          = 0
getuid()                                = 1000
write(10, "2018-04-07T00:37:09.944-07:00| v"..., 119) = 119

Stage 6: With the above update to /proc/version(fs/proc/version.c) to show gcc-* on a *need* basis, vmplayer would no longer segfault/crash - but, was using gcc(7.3.0) to build VMware kernel modules(vmnet and vmmon) which was of course "expected" as that was what was in /proc/version - I did not want this - I wanted clang/LLVM to be used for building VMware kernel modules like I have done the same for other kernel modules (Nvidia driver, VirtualBox, etc) that are working without any issues. Simply put, I want both underlying kernel and all the kernel modules to be built by clang/LLVM and not gcc.

I observed that the VMware configuration script performs a preprocessor check with the determined compiler (gcc-7.3.0 in this case) And that command looks like:

/usr/bin/gcc-7 -E -I/lib/modules/4.16.0/build/include - .... 

Once that's complete and succeeds, it moves onto check if it's needed to build VMware kernel modules - vmnet and vmmon.

Stage 7: Manually the VMware kernel modules(from source : vmmon.tar and vmnet.tar) can be built with clang/LLVM and I have built them(with any needed patches for hostif.c (vmmon-only) and bridge.c (vmnet-only), installed, and used it without any issues by invoking /usr/lib/vmware/bin/vmplayer directly. But, when invoking VMware player by just vmplayer or by clicking on VMware Player icon from app menu/list, vmware-modconfig performs the checks on the compiler and its version used to build the current kernel and then checks if VMware kernel modules are built and loaded, before launching finally vmplayer. And the compiler-check that vmware-modconfig does, doesn't seem to work if the compiler(as shown by /proc/version) is clang/LLVM instead of gcc as shown above.

$ ~/vmware_modules_compiler.sh
++ eclang /lib/modules/4.16.0/misc/vmmon.ko
++ head -1
+++ strings -a /lib/modules/4.16.0/misc/vmmon.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)
++ eclang /lib/modules/4.16.0/misc/vmnet.ko
++ head -1
+++ strings -a /lib/modules/4.16.0/misc/vmnet.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)

$ ~/vmware_modules_metadata.sh 
++ strings -a /lib/modules/4.16.0/misc/vmnet.ko
++ grep VMware
author=VMware, Inc.
description=VMware Virtual Networking Driver.
++ strings -a /lib/modules/4.16.0/misc/vmmon.ko
++ grep VMware
author=VMware, Inc.
description=VMware Virtual Machine Monitor.

$ lsmod | grep "vmnet\|vmmon"
vmnet                  53248  13 
vmmon                  90112  0 

Stage 8: With the above understanding how VMware config/script performs initial preprocessor check with the compiler determined to be gcc-7(.3.0) and how subsequent invocations happen for building the VMware kernel modules, I worked upon the compiler invocation logic for both the instances by vmware-modconfig script/program :

  1. First to perform "preprocessor check" with the actual gcc (7.3.0) compiler itself.
  2. Second and for all the subsequent invocation of compiler with clang/LLVM instead of gcc 7.3.0 - to have VMware kernel modules to be built with clang/LLVM itself like the underlying host kernel.

Stage 9: With that, I was able to completely automate the whole VMware Player installation, first invocation, configuration, and overall setup with clang-built (via installer itself) VMware kernel modules on underlying host clang-built Linux 4.16.0 kernel.

## Compact log of VMware kernel modules built using clang/LLVM instead of gcc, automatically by vmware-* config/scripts
##

## NOTE : Needed to run "vmplayer" as root(sudo) for (only) the first time for building kernel modules and install them.
## Normal user mode didn't go beyond the start of "VMware kernel modules build..." step.

$ sudo vmplayer 
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-sImz9k/vmmon-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.16.0/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/media/exp/ext/linux-4.16'
+ /usr/bin/clang -print-file-name=include
  CC [M]  /tmp/modconfig-sImz9k/vmmon-only/linux/driverLog.o
    .
    .
++ /usr/bin/clang -Wp,-MD,/tmp/modconfig-sImz9k/vmmon-only/linux/.hostif.o.d -nostdinc -isystem /usr/lib/llvm-5.0/lib/clang/5.0.0/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -DCONFIG_CC_STACKPROTECTOR -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mstack-alignment=8 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-const-variable -g -gdwarf-4 -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fno-stack-check -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Wall -Wstrict-prototypes -DVMW_USING_KBUILD -DVMMON -DVMCORE -I/tmp/modconfig-sImz9k/vmmon-only/./include -I/tmp/modconfig-sImz9k/vmmon-only/./common -I/tmp/modconfig-sImz9k/vmmon-only/./linux -I/tmp/modconfig-sImz9k/vmmon-only/./vmcore -DMODULE '-DKBUILD_BASENAME="hostif"' '-DKBUILD_MODNAME="vmmon"' -c -o /tmp/modconfig-sImz9k/vmmon-only/linux/.tmp_hostif.o /tmp/modconfig-sImz9k/vmmon-only/linux/hostif.c
    .
    .
    .
    .
    .
    .
 LD [M]  /tmp/modconfig-sImz9k/vmmon-only/vmmon.ko
make[1]: Leaving directory '/media/exp/ext/linux-4.16'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-sImz9k/vmmon-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-sImz9k/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory '/tmp/modconfig-sImz9k/vmmon-only'
make: Entering directory '/tmp/modconfig-sImz9k/vmnet-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.16.0/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/media/exp/ext/linux-4.16'
+ /usr/bin/clang -print-file-name=include
  CC [M]  /tmp/modconfig-sImz9k/vmnet-only/driver.o
    .
    .
    .
++ /usr/bin/clang -Wp,-MD,/tmp/modconfig-sImz9k/vmnet-only/.bridge.o.d -nostdinc -isystem /usr/lib/llvm-5.0/lib/clang/5.0.0/include -I./arch/x86/include -I./arch/x86/include/generated -I./include -I./arch/x86/include/uapi -I./arch/x86/include/generated/uapi -I./include/uapi -I./include/generated/uapi -include ./include/linux/kconfig.h -D__KERNEL__ -DCONFIG_CC_STACKPROTECTOR -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fshort-wchar -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -fno-PIE -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -mno-80387 -mstack-alignment=8 -mtune=generic -mno-red-zone -mcmodel=kernel -funit-at-a-time -DCONFIG_X86_X32_ABI -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -O2 -Wframe-larger-than=1024 -fstack-protector-strong -Wno-unused-const-variable -g -gdwarf-4 -pg -mfentry -DCC_USING_FENTRY -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-merge-all-constants -fno-stack-check -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -Wall -Wstrict-prototypes -DVMW_USING_KBUILD -I/tmp/modconfig-sImz9k/vmnet-only/. -DVMW_NETIF_TRANS_UPDATE -DMODULE '-DKBUILD_BASENAME="bridge"' '-DKBUILD_MODNAME="vmnet"' -c -o /tmp/modconfig-sImz9k/vmnet-only/.tmp_bridge.o /tmp/modconfig-sImz9k/vmnet-only/bridge.c
    .
    .
    .
    .
    .
    .
  LD [M]  /tmp/modconfig-sImz9k/vmnet-only/vmnet.ko
make[1]: Leaving directory '/media/exp/ext/linux-4.16'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-sImz9k/vmnet-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-sImz9k/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory '/tmp/modconfig-sImz9k/vmnet-only'
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
.
. 


$  ls -lrt /lib/modules/4.16.0/misc/vm*.ko
-rw-r--r-- 1 root root 2597952 Apr  7 01:55 /lib/modules/4.16.0/misc/vmmon.ko
-rw-r--r-- 1 root root 2614432 Apr  7 01:55 /lib/modules/4.16.0/misc/vmnet.ko

$ ~/vmware_modules_compiler.sh 
++ eclang /lib/modules/4.16.0/misc/vmmon.ko
++ head -1
+++ strings -a /lib/modules/4.16.0/misc/vmmon.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)
++ eclang /lib/modules/4.16.0/misc/vmnet.ko
++ head -1
+++ strings -a /lib/modules/4.16.0/misc/vmnet.ko
+++ grep 'clang version'
clang version 5.0.0-3 (tags/RELEASE_500/final)

$ ~/vmware_modules_metadata.sh 
++ strings -a /lib/modules/4.16.0/misc/vmnet.ko
++ grep VMware
author=VMware, Inc.
description=VMware Virtual Networking Driver.
++ strings -a /lib/modules/4.16.0/misc/vmmon.ko
++ grep VMware
author=VMware, Inc.
description=VMware Virtual Machine Monitor.

##
## Subsequent invocation of "vmplayer" as usual(without any root/sudo usage).
##

$ vmplayer 
+ /usr/bin/vmware-modconfig '--appname=VMware Player' --icon=vmware-player
+ vmware_module_exists vmmon
+ modalias=vmmon
+ /sbin/modprobe -n vmmon
+ set +x

$ vmplayer --version
.
.
VMware Player 14.1.1 build-7528167

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.10
Release:    17.10
Codename:   artful

Installed VMware Player version after all of the above steps:

VMWare Player info

VMware Player guest - Ubuntu 17.10 x86_64 - Successfully running in thus installed VMware Player:

terminal screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy