0

Environment:-

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
$ uname -a
Linux bmrmt 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Currently i have installed below vmware workstation version.

$ vmware --version
VMware Workstation 15.5.7 build-17171714

When I launch vmware from command line, it is asking to choose the kernal path. Have provided latest installed kernal path, but didn't work it started showing below message.

C header files matching your running kernel were not found Error.

So found the below command to fix the vm dependency related will be installed automatically. However it fails with below error.

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

(process:31113): GLib-CRITICAL **: 14:51:49.338: g_file_test: assertion 'filename != NULL' failed
Failed to setup build environment.

Already below packages are installed.

sudo apt-get install build-essential
sudo apt-get install linux-headers-$(uname -r)
$ sudo /etc/init.d/vmware start
Starting VMware services:
   Virtual machine monitor                                            failed
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                   failed
   VMware Authentication Daemon                                        done

Tried this solution:

#!/bin/bash

VMWARE_VERSION="workstation-$(vmware -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1)" # this is detect the version you have VMware Workstation 16.2.1 build-18811642

TMP_FOLDER=/tmp/patch-vmware
rm -fdr $TMP_FOLDER
mkdir -p $TMP_FOLDER
cd $TMP_FOLDER
git clone https://github.com/mkubecek/vmware-host-modules.git
cd $TMP_FOLDER/vmware-host-modules
git checkout $VMWARE_VERSION
git fetch
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo /etc/init.d/vmware restart

It failed with below error.

make[2]: Leaving directory '/usr/src/linux-headers-5.4.0-91-generic'
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: Entering directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
make[2]: 'postbuild' is up to date.
make[2]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make[1]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
Version mismatch: module vmmon-only/vmmon.ko 5.4.151, kernel 5.4.0-91-generic
Version mismatch: module vmnet-only/vmnet.ko 5.4.151, kernel 5.4.0-91-generic
make: *** [Makefile:35: install] Error 1
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
Starting VMware services:
   Virtual machine monitor                                            failed
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                   failed
   VMware Authentication Daemon                                        done
$ sudo /etc/init.d/vmware status
Module vmmon not loaded
Module vmnet not loaded
$ cat /proc/cpuinfo  | grep 'name'| uniq
model name : Intel(R) Xeon(R) Gold 6138 CPU @ 2.00GHz

$ cat /proc/cpuinfo  | grep process| wc -l
80

$ sudo mokutil --sb-state
SecureBoot disabled
$ grep --color vmx /proc/cpuinfo
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear flush_l1d

Please let me know what's wrong with my ubuntu-20.04 LTS system?

1
  • that script is nearly perfect just the regex fails with the current build numbers changing the original line ``` VMWARE_VERSION=workstation-vmware -v|grep [0-9.]* -o|head -n 1 ``` to this ``` VMWARE_VERSION="workstation-$(vmware -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1)" ``` Worked perfect for me
    – Mike R
    Mar 4 at 15:56

2 Answers 2

1

A fixed version of the original commenters nifty script solved my issue on latest PopOS 21.10 Ubuntu

#!/usr/bin/env bash

VMWARE_VERSION="workstation-$(vmware -v||vmplayer -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1)" # this is detect the version you have VMware Workstation 16.2.1 build-18811642

TMP_FOLDER=/tmp/patch-vmware
rm -fdr $TMP_FOLDER
mkdir -p $TMP_FOLDER
cd $TMP_FOLDER || exit
git clone https://github.com/mkubecek/vmware-host-modules.git
cd $TMP_FOLDER/vmware-host-modules || exit
git checkout "$VMWARE_VERSION"
git fetch
make
sudo make install
sudo rm /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo ln -s /lib/x86_64-linux-gnu/libz.so.1 /usr/lib/vmware/lib/libz.so.1/libz.so.1
sudo /etc/init.d/vmware restart

Reason why it was not working. regex didn't work

❯ vmware -v|grep [0-9.]* -o|head -n 1
~ at 10:48:19 
❯ vmware -v
VMware Workstation 16.2.1 build-18811642
~ at 10:48:33 

Switching to this worked to properly extract it out.

❯ vmware -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1
16.2.1
~ at 10:49:53 

Example:

❯ chmod +x /home/mike/Documents/dev/bash_scripts/vmware_kernels.sh
~ at 10:50:51 

❯ bash /home/mike/Documents/dev/bash_scripts/vmware_kernels.sh
Cloning into 'vmware-host-modules'...
remote: Enumerating objects: 3388, done.
remote: Counting objects: 100% (851/851), done.
remote: Compressing objects: 100% (701/701), done.
remote: Total 3388 (delta 403), reused 538 (delta 149), pack-reused 2537
Receiving objects: 100% (3388/3388), 1.70 MiB | 631.00 KiB/s, done.
Resolving deltas: 100% (2422/2422), done.
Branch 'workstation-16.2.1' set up to track remote branch 'workstation-16.2.1' from 'origin'.
Switched to a new branch 'workstation-16.2.1'
make -C vmmon-only 
make[1]: Entering directory '/tmp/patch-vmware/vmware-host-modules/vmmon-only'
Using kernel build system.
make -C /lib/modules/5.16.11-76051611-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: Entering directory '/usr/src/linux-headers-5.16.11-76051611-generic'
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/linux/driver.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/linux/hostif.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/apic.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/comport.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/cpuid.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/crosspage.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/memtrack.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/moduleloop.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/phystrack.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/sharedAreaVmmon.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/statVarsVmmon.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/task.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/vmx86.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/bootstrap.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/monLoader.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/monLoaderVmmon.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/vmmblob.o
  LD [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.o
  MODPOST /tmp/patch-vmware/vmware-host-modules/vmmon-only/Module.symvers
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.ko
  BTF [M] /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.ko
Skipping BTF generation for /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-5.16.11-76051611-generic'
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: Entering directory '/tmp/patch-vmware/vmware-host-modules/vmmon-only'
make[2]: 'postbuild' is up to date.
make[2]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make[1]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmmon-only'
make -C vmnet-only 
make[1]: Entering directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
Using kernel build system.
make -C /lib/modules/5.16.11-76051611-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: Entering directory '/usr/src/linux-headers-5.16.11-76051611-generic'
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/driver.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/hub.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/userif.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/netif.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/bridge.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/procfs.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/smac_compat.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/smac.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/vnetEvent.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/vnetUserListener.o
  LD [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/vmnet.o
  MODPOST /tmp/patch-vmware/vmware-host-modules/vmnet-only/Module.symvers
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/patch-vmware/vmware-host-modules/vmnet-only/vmnet.ko
  BTF [M] /tmp/patch-vmware/vmware-host-modules/vmnet-only/vmnet.ko
Skipping BTF generation for /tmp/patch-vmware/vmware-host-modules/vmnet-only/vmnet.ko due to unavailability of vmlinux
make[2]: Leaving directory '/usr/src/linux-headers-5.16.11-76051611-generic'
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: Entering directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
make[2]: 'postbuild' is up to date.
make[2]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make[1]: Leaving directory '/tmp/patch-vmware/vmware-host-modules/vmnet-only'
install -D -t /lib/modules/5.16.11-76051611-generic/misc vmmon-only/vmmon.ko vmnet-only/vmnet.ko
strip --strip-debug /lib/modules/5.16.11-76051611-generic/misc/vmmon.ko /lib/modules/5.16.11-76051611-generic/misc/vmnet.ko
if test -z ""; then /sbin/depmod -a 5.16.11-76051611-generic; fi
Stopping VMware services:
   VMware Authentication Daemon                                        done
   Virtual machine monitor                                             done
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Virtual ethernet                                                    done
   VMware Authentication Daemon                                        done
   Shared Memory Available                                             done
~  took 15s  at 10:51:18 

❯ 

Before i was having numerous issues with stuff like below

In file included from /usr/lib/vmware/modules/source/vmmon-only/linux/driverLog.h:33,
                 from /usr/lib/vmware/modules/source/vmmon-only/linux/driver.c:46:
/usr/lib/vmware/modules/source/vmmon-only/./include/vm_assert.h:43:10: fatal error: stdarg.h: No such file or directory
   43 | #include <stdarg.h>
      |          ^~~~~~~~~~
compilation terminated.

2
  • This also works for VMWare Player, just replace the first line with this: VMWARE_VERSION="player-$(vmplayer -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1)"
    – RAD750
    Mar 20 at 16:48
  • 1
    Yeah I ended updowngrading from workstation to player and forgot to come back here and update the script but i have it like this ``` VMWARE_VERSION="workstation-$(vmware -v||vmplayer -v|grep -oE "[[:digit:]]+.[[:digit:]]+.[[:digit:]]+"| head -n1)" ``` Which should handle both cases
    – Mike R
    Apr 4 at 12:46
0

Processor Requirements for Host Systems

Check whether the processor supports hardware virtualization (VT-x for Intel processors, AMD-V for AMD processors).

From a terminal issue

grep --color vmx /proc/cpuinfo ## for an Intel processor
grep --color svm /proc/cpuinfo ## for an AMD processor

Include Virtualization, Virtualization Technology (VT-x), SVM, VMX in the BIOS, if not enabled.

7

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.