当前位置:首页 > 服务搭建 > 解决Linux更新后Vmware无法打开提示“kernel module updater”

解决Linux更新后Vmware无法打开提示“kernel module updater”

本文章向大家介绍永久解决Linux更新后Vmware无法打开提示“kernel module updater”,主要包括永久解决Linux更新后Vmware无法打开提示“kernel module updater”使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

今天更新操作系统,更新完又出现了VMware-workstation无法启动的情况!启动后和上次一样提示kernel module updater,然后点击install提示在安装vmnetvmmon 然而一会就有个失败的日志提示,打开看和上次的差不多。内容和具体原因可参见上一篇博文:https://www.cnblogs.com/4geek/p/11511592.html

  这次不想再像上次那样一步一步的去重新编译再替换,所以在想有没有什么办法可以在每次更新系统后出现同样问题时一键就能顺利打开VMware workstation呢?于是乎又是一顿google操作最终找见了方法。在这里记录下来,依然是为了方便踩入坑的你!

  A【参考文献】

  翻了很多文献,最终还是以vmware官方的为准:https://communities.vmware.com/thread/609330

  B【创建脚本】

xxlm@legion:~$ touch vmware-update.sh
xxlm@legion:~$ vm vmware-update.sh 
#!/bin/bash
VMWARE_VERSION=workstation-15.5.0
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

其中“VMWARE_VERSION=workstation-15.5.1”,这里的版本号可以通过vmware-installer -l来查看

xlm@legion:~$ vmware-installer -l
Product Name         Product Version     
==================== ====================
vmware-workstation   15.5.0.14665864     
xxlm@legion:~$

  C【执行脚本】

root@legion:/home/xxlm# sudo bash vmware-update.sh 
正克隆到 'vmware-host-modules'...
remote: Enumerating objects: 274, done.
remote: Counting objects: 100% (274/274), done.
remote: Compressing objects: 100% (161/161), done.
remote: Total 1952 (delta 203), reused 153 (delta 113), pack-reused 1678
接收对象中: 100% (1952/1952), 1.10 MiB | 434.00 KiB/s, 完成.
处理 delta 中: 100% (1585/1585), 完成.
分支 'workstation-15.5.0' 设置为跟踪来自 'origin' 的远程分支 'workstation-15.5.0'。
切换到一个新分支 'workstation-15.5.0'
*-----------------------------------------------------------------------------
* Branch workstation-15.5.0 has been retired on 2020-02-10 and has not been
* receiving any updates since. Please switch to latest 15.5.x version
* available.
*
* Latest kernel version this branch is intended to work with is 5.5.
*-----------------------------------------------------------------------------
make -C vmmon-only 
make[1]: 进入目录“/tmp/patch-vmware/vmware-host-modules/vmmon-only”
Using kernel build system.
make -C /lib/modules/5.4.0-31-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: 进入目录“/usr/src/linux-headers-5.4.0-31-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/hostif.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/linux/driverLog.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/apic.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/vmx86.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/cpuid.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/comport.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/common/phystrack.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmcore/moduleloop.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/monLoader.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/vmmblob.o
  CC [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/bootstrap/bootstrap.o
  LD [M]  /tmp/patch-vmware/vmware-host-modules/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  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
make[2]: 离开目录“/usr/src/linux-headers-5.4.0-31-generic”
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: 进入目录“/tmp/patch-vmware/vmware-host-modules/vmmon-only”
make[2]: “postbuild”已是最新。
make[2]: 离开目录“/tmp/patch-vmware/vmware-host-modules/vmmon-only”
cp -f vmmon.ko ./../vmmon.o
make[1]: 离开目录“/tmp/patch-vmware/vmware-host-modules/vmmon-only”
make -C vmnet-only 
make[1]: 进入目录“/tmp/patch-vmware/vmware-host-modules/vmnet-only”
Using kernel build system.
make -C /lib/modules/5.4.0-31-generic/build/include/.. M=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[2]: 进入目录“/usr/src/linux-headers-5.4.0-31-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
  Building modules, stage 2.
  MODPOST 1 modules
  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
make[2]: 离开目录“/usr/src/linux-headers-5.4.0-31-generic”
make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[2]: 进入目录“/tmp/patch-vmware/vmware-host-modules/vmnet-only”
make[2]: “postbuild”已是最新。
make[2]: 离开目录“/tmp/patch-vmware/vmware-host-modules/vmnet-only”
cp -f vmnet.ko ./../vmnet.o
make[1]: 离开目录“/tmp/patch-vmware/vmware-host-modules/vmnet-only”
*-----------------------------------------------------------------------------
* Branch workstation-15.5.0 has been retired on 2020-02-10 and has not been
* receiving any updates since. Please switch to latest 15.5.x version
* available.
*
* Latest kernel version this branch is intended to work with is 5.5.
*-----------------------------------------------------------------------------
install -D -t /lib/modules/5.4.0-31-generic/misc vmmon-only/vmmon.ko vmnet-only/vmnet.ko
strip --strip-debug /lib/modules/5.4.0-31-generic/misc/vmmon.ko /lib/modules/5.4.0-31-generic/misc/vmnet.ko
if test -z ""; then /sbin/depmod -a 5.4.0-31-generic; fi
rm: 无法删除'/usr/lib/vmware/lib/libz.so.1/libz.so.1': 没有那个文件或目录
vmware-update.sh: 行 15: /usr/lib/vmware/lib/libz.so.1/libz.so.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                                             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
root@legion:/home/xxlm#

最后就是见证奇迹了!以后只要更新系统出现类似问题,只需要重新运行一下这个脚本就可以很方便的解决这个问题了!

转载自http://www.manongjc.com/detail/15-mhlhjdrpsiywfnf.html

除特别注明外,本站所有文章均为浮生若梦原创,转载请注明出处来自http://www.vbboy.com/?id=43

发表评论

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。