VMware Workstation

 View Only
  • 1.  Instructions to Compile and successfully run vmmon and vmnet on Pop OS (and Ubuntu) with kernel versions 6.9+

    Posted Aug 20, 2024 01:40 PM

    Hi everyone!

    Here is how I got vmmon and vmnet up and running on Workstation 17.5.2 build 23775571.  The high level steps were:

    1. Making a local copy of vmlinux for my version of the kernel
    2. Downloading a set of libraries from https://github.com/nan0desu/vmware-host-modules.
    3. Building vmmon and vmnet
    4. Installing the modules.

    Setting up VMLinux

    The patches need access to vmlinux to build correctly.  If it's missing, they won't compile properly, and you will see an error message of

      LD [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.ko
      BTF [M] /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.ko
    Skipping BTF generation for /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.ko due to unavailability of vmlinux
    make[2]: Leaving directory '/usr/src/linux-headers-6.9.3-76060903-generic'
    

    1. First, check to see if the file is missing:
      ls /usr/lib/modules/`uname -r`/build/vmlinux
      

      If the system lists the file, then you can skip this step.  If it's missing, you'll get an error message like 

      ls: cannot access '/usr/lib/modules/6.9.3-76060903-generic/build/vmlinux': No such file or directory
    2. If the file is missing, then make sure you have the package dwarves installed:
      $ sudo apt-get install dwarves
      Reading package lists... Done
      Building dependency tree... Done
      Reading state information... Done
      The following additional packages will be installed:
        pahole
      The following NEW packages will be installed:
        dwarves pahole
      0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
      Need to get 567 kB of archives.
      After this operation, 4,301 kB of additional disk space will be used.
      Do you want to continue? [Y/n] y
      Get:1 http://apt.pop-os.org/ubuntu jammy-updates/universe amd64 pahole amd64 1.25-0ubuntu1~22.04.2 [565 kB]
      Get:2 http://apt.pop-os.org/ubuntu jammy-updates/universe amd64 dwarves all 1.25-0ubuntu1~22.04.2 [2,192 B]
      Fetched 567 kB in 1s (1,115 kB/s)   
      Selecting previously unselected package pahole.
      (Reading database ... 499874 files and directories currently installed.)
      Preparing to unpack .../pahole_1.25-0ubuntu1~22.04.2_amd64.deb ...
      Unpacking pahole (1.25-0ubuntu1~22.04.2) ...
      Selecting previously unselected package dwarves.
      Preparing to unpack .../dwarves_1.25-0ubuntu1~22.04.2_all.deb ...
      Unpacking dwarves (1.25-0ubuntu1~22.04.2) ...
      Setting up pahole (1.25-0ubuntu1~22.04.2) ...
      Setting up dwarves (1.25-0ubuntu1~22.04.2) ...
      Processing triggers for man-db (2.10.2-1) ...
      



    3. Copy vmlinux into the build directory for your kernel:
      sudo cp /sys/kernel/btf/vmlinux /usr/lib/modules/`uname -r`/build/

    Note:  You will need to redo this step for every kernel update.

    Downloading a patch from nan0desu

    1. Create a directory to hold the patch:
      mkdir ~/VMWare/nan0desu/
    2. Download the patch:
      git clone https://github.com/nan0desu/vmware-host-modules
      cd vmware-host-modules
      git checkout workstation-17.5.2-k6.9+

      Note: Check for later branches in the repository.  As of this writing, the latest branch is workstation-17.5.2-k6.9+

    Building vmmon and vmnet

    1. Make sure your sources are up to date: 
      cd ~/VMWare/nan0desu/vmware-host-modules/
      git pull
    2. Make the patched vmmon and vmnet
      sudo make clean
      make
      sudo make install

      Note: Carefully inspect the output of this step for indications of errors.  Below is the output of a good compilation:

      yilmaz@ocardier:~/VMWare/nan0desu/vmware-host-modules$ make
      make -C vmmon-only 
      make[1]: Entering directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only'
      Using kernel build system.
      make -C /lib/modules/6.9.3-76060903-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
        MODULEBUILDDIR= modules
      make[2]: Entering directory '/usr/src/linux-headers-6.9.3-76060903-generic'
      warning: the compiler differs from the one used to build the kernel
        The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
        You are using:           gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/linux/driver.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/linux/driverLog.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/linux/hostif.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/apic.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/comport.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/cpuid.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/crosspage.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/memtrack.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/moduleloop.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/phystrack.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/sharedAreaVmmon.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/statVarsVmmon.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/task.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/common/vmx86.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/bootstrap/bootstrap.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/bootstrap/monLoader.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/bootstrap/monLoaderVmmon.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/bootstrap/vmmblob.o
        LD [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/vmmon.o
        MODPOST /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/Module.symvers
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/vmmon.mod.o
        LD [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/vmmon.ko
        BTF [M] /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only/vmmon.ko
      make[2]: Leaving directory '/usr/src/linux-headers-6.9.3-76060903-generic'
      make -C $PWD SRCROOT=$PWD/. \
        MODULEBUILDDIR= postbuild
      make[2]: Entering directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only'
      make[2]: 'postbuild' is up to date.
      make[2]: Leaving directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only'
      cp -f vmmon.ko ./../vmmon.o
      make[1]: Leaving directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmmon-only'
      make -C vmnet-only 
      make[1]: Entering directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only'
      Using kernel build system.
      make -C /lib/modules/6.9.3-76060903-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
        MODULEBUILDDIR= modules
      make[2]: Entering directory '/usr/src/linux-headers-6.9.3-76060903-generic'
      warning: the compiler differs from the one used to build the kernel
        The kernel was built by: x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
        You are using:           gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/driver.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/hub.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/userif.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/netif.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/bridge.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/procfs.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/smac_compat.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/smac.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vnetEvent.o
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vnetUserListener.o
        LD [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.o
        MODPOST /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/Module.symvers
        CC [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.mod.o
        LD [M]  /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.ko
        BTF [M] /home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only/vmnet.ko
      make[2]: Leaving directory '/usr/src/linux-headers-6.9.3-76060903-generic'
      make -C $PWD SRCROOT=$PWD/. \
        MODULEBUILDDIR= postbuild
      make[2]: Entering directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only'
      make[2]: 'postbuild' is up to date.
      make[2]: Leaving directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only'
      cp -f vmnet.ko ./../vmnet.o
      make[1]: Leaving directory '/home/yilmaz/VMWare/nan0desu/vmware-host-modules/vmnet-only'
      yilmaz@ocardier:~/VMWare/nan0desu/vmware-host-modules$ sudo make install
      install -D -t /lib/modules/6.9.3-76060903-generic/misc vmmon-only/vmmon.ko vmnet-only/vmnet.ko
      strip --strip-debug /lib/modules/6.9.3-76060903-generic/misc/vmmon.ko /lib/modules/6.9.3-76060903-generic/misc/vmnet.ko
      if test -z ""; then /sbin/depmod -a 6.9.3-76060903-generic; fi
      

    Installing the modules

    1. Load the newly created modules
      sudo modprobe -v vmmon
      sudo modprobe -v vmnet
    2. Restart vmware services
      sudo /etc/init.d/vmware restart

      The output of the restart should be something like below:

      sudo /etc/init.d/vmware restart
      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
      

    I hope this helps! 

    Yilmaz



  • 2.  RE: Instructions to Compile and successfully run vmmon and vmnet on Pop OS (and Ubuntu) with kernel versions 6.9+

    Posted Sep 24, 2024 12:24 PM

    hi i have tried you method but i get this error in make 
    make -C vmmon-only 
    make[1]: Entering directory '/home/ajay/vmware-host-modules/vmmon-only'
    Using kernel build system.
    make -C /lib/modules/6.10.9-amd64/build/include/.. M=$PWD SRCROOT=$PWD/. \
      MODULEBUILDDIR= modules
    make[2]: Entering directory '/usr/src/linux-headers-6.10.9-amd64'
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/linux/driver.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/linux/driverLog.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/linux/hostif.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/apic.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/comport.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/cpuid.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/crosspage.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/memtrack.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/moduleloop.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/phystrack.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/sharedAreaVmmon.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/statVarsVmmon.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/task.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/common/vmx86.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/bootstrap/bootstrap.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/bootstrap/monLoader.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/bootstrap/monLoaderVmmon.o
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/bootstrap/vmmblob.o
      LD [M]  /home/ajay/vmware-host-modules/vmmon-only/vmmon.o
      MODPOST /home/ajay/vmware-host-modules/vmmon-only/Module.symvers
      CC [M]  /home/ajay/vmware-host-modules/vmmon-only/vmmon.mod.o
      LD [M]  /home/ajay/vmware-host-modules/vmmon-only/vmmon.ko
      BTF [M] /home/ajay/vmware-host-modules/vmmon-only/vmmon.ko
    /bin/sh: 1: ./tools/bpf/resolve_btfids/resolve_btfids: not found
    make[4]: *** [/usr/src/linux-headers-6.10.9-common/scripts/Makefile.modfinal:61: /home/ajay/vmware-host-modules/vmmon-only/vmmon.ko] Error 127
    make[4]: *** Deleting file '/home/ajay/vmware-host-modules/vmmon-only/vmmon.ko'
    make[3]: *** [/usr/src/linux-headers-6.10.9-common/Makefile:1892: modules] Error 2
    make[2]: *** [/usr/src/linux-headers-6.10.9-common/Makefile:252: __sub-make] Error 2
    make[2]: Leaving directory '/usr/src/linux-headers-6.10.9-amd64'
    make[1]: *** [Makefile:117: vmmon.ko] Error 2
    make[1]: Leaving directory '/home/ajay/vmware-host-modules/vmmon-only'
    make: *** [Makefile:21: vmmon-only] Error 2

    thank you in advance




  • 3.  RE: Instructions to Compile and successfully run vmmon and vmnet on Pop OS (and Ubuntu) with kernel versions 6.9+

    Posted Sep 27, 2024 01:27 PM

    What distribution of Linux are you using?  What's your kernel version?




  • 4.  RE: Instructions to Compile and successfully run vmmon and vmnet on Pop OS (and Ubuntu) with kernel versions 6.9+

    Posted Sep 30, 2024 12:46 PM

    One addendum:  

    This morning, when I rebooted after some updates, vmmon and vmnet failed to load.   The solution was to recopy the vmlinux into the build directory of my kernel.

    The problem indication:

    When I started vmware and tried to start my virtual machine, I received an error to the effect that vmmon wasn't running.

    Attempting to start vmware services resulted in a failure of vmmon and vmnet to start.

    I reran the process in the parent thread and everything seemed to work until I tried installing the modules:

    yilmaz@ocardier:~$ sudo modprobe -v vmmon
    insmod /lib/modules/6.9.3-76060903-generic/misc/vmmon.ko 
    

    Running dmesg showed the following:

    yilmaz@ocardier:~$ sudo dmesg | tail
    [   54.812573] BPF: 
    [   54.812576] failed to validate module [vmmon] BTF: -22
    [   95.807866] audit: type=1400 audit(1727707563.358:42): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_esm_cache" name="/etc/pop-os/os-release" pid=3982 comm="python3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
    [   96.397407] audit: type=1400 audit(1727707563.947:43): apparmor="DENIED" operation="open" class="file" profile="ubuntu_pro_apt_news" name="/etc/pop-os/os-release" pid=3981 comm="python3" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
    [  200.222955] BPF: [140340] TYPEDEF  
    [  200.222960] BPF: type_id=1277
    [  200.222962] BPF:  
    [  200.222963] BPF: Invalid name
    [  200.222964] BPF: 
    [  200.222968] failed to validate module [vmmon] BTF: -22
    

    The Solution:

    The messages about BPF failures indicates a mismatch between the kernel headers and the kernel version that is currently running, so I recopied the vmlinux into the build directory for my kernel, and rebuilt everything. Everything ran properly.

    sudo cp /sys/kernel/btf/vmlinux /usr/lib/modules/`uname -r`/build/
    cd VMWare/nan0desu/vmware-host-modules/
    git pull
    sudo make clean
    make
    sudo make install
    sudo modprobe -v vmmon
    sudo modprobe -v vmnet
    sudo /etc/init.d/vmware restart


    ------------------------------

    ------------------------------