Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contributed: One-Step Update Script #1

Open
wants to merge 1 commit into
base: player-12.5.7
Choose a base branch
from
Open

Contributed: One-Step Update Script #1

wants to merge 1 commit into from

Conversation

rubyjedi
Copy link

Thank you for providing a nearly unified repository that tracks all of these VMWare -vs- Linux Kernel patches.

In trying to get player-12.5.7 working against Kernel 4.13.5, and running down ideas from forum threads to get a working system, I found your module repository to be the most complete and painless source of working source code for my particular issue.

As this repository appears to be well maintained with sane branch/tag naming conventions, and appears to include everything needed to compile updated modules, I have written this script that others may find useful to update their systems with content from your repository going forward.

@mkubecek
Copy link
Owner

I prefer a bit different workflow, building as a regular user and installing resulting modules as root (but I was too lazy to actually write a top level makefile for that) but a script like this would be certainly helpful for many users (mostly those who are not familiar with git).

There are some improvements I would like to do:

  • (most important) script should handle a failure of wget (e.g. when there is a new VMware version but no corresponding branch yet)
  • script should IMHO do some sanity checks (e.g. existence of the directory with module sources, check if it is executed with necessary permissions)
  • script shouldn't remove existing tarballs until it succeeded to create new ones so that user doesn't end up with no vm{mon,net}.tar if something goes wrong
  • rather than hardcoding the branch name into the script, it could be determined from the information in /etc/vmware/config so that users wouldn't need to edit the script.

I'm going to pull your contribution into master branch and add these changes on top of it, then merge into all active branches. I'll be quite busy this weekend so it will most likely have to wait until next week.

@rubyjedi
Copy link
Author

'Not a problem whether this is a starting point or just a source of inspiration. I appreciate and respect all the work you do on this project.

If this script can evolve into something that saves others the lost time and frustration of having to hunt down and apply patches, I'm happy to have assisted in this regard.

@megvadulthangya
Copy link

Hey hellO!

How to do it? Is there a tutorial to this? I upgraded ubuntu16.06 the kernel upgraded and vmware stopped working... :( That readme is not saying to me a lot... maybe im tired
Any help please?

@gmurgac
Copy link

gmurgac commented Jul 9, 2020

Hey hellO!

How to do it? Is there a tutorial to this? I upgraded ubuntu16.06 the kernel upgraded and vmware stopped working... :( That readme is not saying to me a lot... maybe im tired
Any help please?

Hi, this is what i did to work. for vmware 15.5.6 and kernel 5.7
download the vmware-host-modules 15.5.6k5.7 then unzip and then in a terminal do 'make' and then 'make install' thats works for me. You have to be sure thats the Makefile in vmmon and vmnet its correct.
please tell me if you have any trouble

@meramsey
Copy link

meramsey commented Mar 4, 2022

This actually works really well for me and and i only modded the version detection from https://askubuntu.com/q/1377852 script example

#!/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

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 

❯ 

@david-kariuki
Copy link

david-kariuki commented Apr 6, 2022

This script does everything for you. It will download all the tarballs and set up the vmmon and vmnet automatically. It will also download some vmware dependent packages in case your system does not have them. Available in Debian and Arch Linux, Fedora, and more others coming soon. Check the link below:

https://github.com/david-kariuki/vmware-host-modules-builder-cli

@ulf-f
Copy link

ulf-f commented Oct 23, 2022

This script does everything for you. It will download all the tarballs and set up the vmmon and vmnet automatically. It will also download some vmware dependent packages in case your system does not have them. Available in Debian and Arch Linux, Fedora, and more others coming soon. Check the link below:

https://github.com/david-kariuki/vmware-host-modules-builder-cli

The above link is broken, here is the correct one:
https://github.com/linuxeuphony/vmware-host-modules-builder-cli

@Santuccic
Copy link

Worked flawlessy on my installation.
you do need to run as super user the last two command, make && make install.

running following
Linux fedora 6.4.12-200.fc38.x86_64
VMware Workstation 17.0.2 build-21581411

thanks for the contribution, much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants