现象

虚拟机启动时如下提示

分析

使用vmware自带的工具分析其网络设备状态:

$ vmware-networks --status
Failed to initialize
ubuntu@u2004:~$ sudo vmware-networks --status
Bridge networking on vmnet0 is running
DHCP service on vmnet1 is running
Hostonly virtual adapter on vmnet1 is enabled
DHCP service on vmnet8 is not running
NAT service on vmnet8 is not running
Hostonly virtual adapter on vmnet8 is disabled
Some/All of the configured services are not running

其中显示:Hostonly virtual adapter on vmnet8 is disabled
于是,尝试手动启动,失败。

$ sudo vmware-networks --start
Started Bridge networking on vmnet0
Enabled hostonly virtual adapter on vmnet1
Started DHCP service on vmnet1
Subnet on vmnet8 is no longer available for usage, please run the network editor to reconfigure different subnet
Failed to start some/all services

查看网络日志,部分日志如下:

Oct 24 15:05:42 VNLNetCfgEnumDHCPMACToIP - List of mappings is empty
Oct 24 15:05:42 VNL_UpdateDHCPFromConfig - Writing DHCP configuration file succeeded for vnet: vmnet8
Oct 24 15:05:42 VNLFileExists - Cannot check for file or directory: /etc/vmware/vmnet8/nat/nat.conf , error: No such file or directory
Oct 24 15:05:42 VNLCreateFile - Directory: /etc/vmware/vmnet8 already exists
Oct 24 15:05:42 VNLNetCfgEnumNATPortFwd - List of forwarded ports is empty
Oct 24 15:05:42 VNLNetCfgEnumNATPortFwd - List of forwarded ports is empty
Oct 24 15:05:42 VNL_UpdateNATFromConfig - Writing NAT configuration file succeeded for vnet: vmnet8
Oct 24 15:05:42 VNL_UpdateDHCPFromConfig - Removing DHCP configuration file succeeded for vnet: vmnet9
Oct 24 15:05:42 VNL_UpdateNATFromConfig - Removing NAT configuration file succeeded for vnet: vmnet9
Setting vmnet-dhcp IP address: 172.16.49.254
Opened: /dev/vmnet1
Recving on VNet/vmnet1/172.16.49.0
Sending on VNet/vmnet1/172.16.49.0
Forked child process, pid=1494
Oct 24 15:08:53 VNL_StartService - Started “DHCP” service for vnet: vmnet1
Failed to start some/all services
Oct 24 15:41:11 VNL_Load - LOG_OK logged
Oct 24 15:41:11 VNL_Load - Successfully initialized Vnetlib
Oct 24 15:41:11 VNLPingAndCheckSubnet - Return value of vmware-ping: 0
Oct 24 15:41:11 VNL_CheckSubnetAvailability - Subnet: 192.168.16.0 on vnet: vmnet8 is not available
Oct 24 15:41:12 VNL_Unload2 - Vnetlib unloaded.
Oct 24 16:03:10 VNL_Load - LOG_ERR logged
Oct 24 16:03:10 VNL_Load - LOG_WRN logged
Oct 24 16:03:10 VNL_Load - LOG_OK logged
Oct 24 16:03:10 VNL_Load - Successfully initialized Vnetlib
Oct 24 16:03:10 VNL_Unload2 - Vnetlib unloaded.
Oct 24 16:03:17 VNL_Load - LOG_ERR logged
Oct 24 16:03:17 VNL_Load - LOG_WRN logged
Oct 24 16:03:17 VNL_Load - LOG_OK logged
Oct 24 16:03:17 VNL_Load - Successfully initialized Vnetlib
Oct 24 16:03:17 VNLPingAndCheckSubnet - Return value of vmware-ping: 0
Oct 24 16:03:17 VNL_CheckSubnetAvailability - Subnet: 192.168.16.0 on vnet: vmnet8 is not available
Oct 24 16:03:18 VNL_Unload2 - Vnetlib unloaded.

经检查有这个文件: /etc/vmware/vmnet8/nat/nat.conf,从文件创建时间看,应该是日志显示时修改过的。

查看网络配置文件:

$ cat /etc/vmware/networking
VERSION=1,0
answer VNET_1_DHCP yes
answer VNET_1_DHCP_CFG_HASH 5205CD20C2ABBFC5BE4F3BF834B14E380183528A
answer VNET_1_HOSTONLY_NETMASK 255.255.255.0
answer VNET_1_HOSTONLY_SUBNET 172.16.49.0
answer VNET_1_VIRTUAL_ADAPTER yes
answer VNET_8_DHCP yes
answer VNET_8_DHCP_CFG_HASH DE31AE240D28906CBBE16CE55BD334FD0321EB60
answer VNET_8_HOSTONLY_NETMASK 255.255.255.0
answer VNET_8_HOSTONLY_SUBNET 192.168.16.0
answer VNET_8_NAT yes
answer VNET_8_VIRTUAL_ADAPTER yes

PS: 说句题外话,其实vmnet1与vmnet8几乎一样,只是vmnet8多了一个NAT到外网。

VNET_8_HOSTONLY_SUBNET改为192.268.15.0,重启Host机,没效果。

那再看看安装了哪些组件,VMWare的组件安装器是使用Python编写的,一堆的Python小文件:

$ sudo ./VMware-Player-Full-16.2.0-18760230.x86_64.bundle -t
Extracting VMware Installer...done.
Component Name               Component Long Name                               Component Version
============================ ================================================= ====================
vmware-installer             VMware Installer                                  3.0.0.18760230
vmware-player-setup          VMware Player Setup                               16.2.0.18760230
vmware-usbarbitrator         VMware USB Arbitrator                             20.5.0.18760230
vmware-network-editor        VMware Network Editor                             16.2.0.18760230
vmware-vmx                   VMware VMX                                        16.2.0.18760230
vmware-virtual-printer       VMware Virtual Printer                            1.0.18760230
vmware-tools-linuxPreGlibc25 VMware Tools for legacy Linux                     11.3.5.18760230
vmware-tools-linux           VMware Tools for Linux                            11.3.5.18760230
vmware-tools-netware         VMware Tools for NetWare                          11.3.5.18760230
vmware-tools-solaris         VMware Tools for Solaris                          11.3.5.18760230
vmware-tools-winPre2k        VMware Tools for Windows 95, 98, Me and NT        11.3.5.18760230
vmware-tools-winPreVista     VMware Tools for Windows 2000, XP and Server 2003 11.3.5.18760230
vmware-tools-windows         VMware Tools for Windows Vista or later           11.3.5.18760230
vmware-player-app            VMware Player Application                         16.2.0.18760230
vmware-ovftool               VMware OVF Tool component for Linux               4.4.3.18760230
vmware-player                VMware Player                                     16.2.0.18760230

再看看组件vmware-network-editor的安装器脚本们:

$ sudo ./VMware-Player-Full-16.2.0-18760230.x86_64.bundle  -L  vmware-network-editor
Extracting VMware Installer...done.
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/versions.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/__pycache__/versions.cpython-39.pyc
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/systemType.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/__pycache__/systemType.cpython-39.pyc
/etc/vmware-installer/components/vmware-network-editor/16.2.0/__init__.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/__pycache__/__init__.cpython-39.pyc
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/initscript.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/__pycache__/initscript.cpython-39.pyc
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/update.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/include/__pycache__/update.cpython-39.pyc
/etc/vmware-installer/components/vmware-network-editor/16.2.0/vmware-network-editor.py
/etc/vmware-installer/components/vmware-network-editor/16.2.0/__pycache__/vmware-network-editor.cpython-39.pyc
/usr/lib/vmware/lib/libvmware-netcfg.so/libvmware-netcfg.so
/usr/lib/vmware/bin/vmware-netcfg

即他们把下面的几个主要文件安装至系统:

/usr/lib/vmware/lib/libvmware-netcfg.so/libvmware-netcfg.so
/usr/lib/vmware/bin/vmware-netcfg

想运行网络编辑network editor这个组件/usr/lib/vmware/bin/vmware-netcfg,命令行没法单独运行。

$ file /usr/lib/vmware/bin/vmware-netcfg
/usr/lib/vmware/bin/vmware-netcfg: symbolic link to /usr/lib/vmware/bin/appLoader
ubuntu@u2004:~/Downloads$ file /usr/lib/vmware/bin/appLoader
/usr/lib/vmware/bin/appLoader: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.4, BuildID[sha1]=9322b0ef3bb456d9b7ff73709b901ad603a03289, stripped
$ /usr/lib/vmware/bin/appLoader
[AppLoader] "appLoader" cannot be run as a standalone program.

PS: /usr/lib/vmware/bin/vmplayer也是 symbolic link to /usr/lib/vmware/bin/appLoader,其它一堆命令也是,为何运行/usr/lib/vmware/bin/vmplayer却不会提示如上错误呢?

那VMware Workstation Player的network editor GUI程序入口在哪里?
其实刚才多此一举,直接运行vmware-netcfg即可打开network editor的GUI.

PS: ssh -x远程情况下无法打开Virtual Network Editor的GUI, 提示

$ vmware-netcfg
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ===
Authentication is needed to run `/usr/bin/vmware-netcfg' as the super user
Authenticating as: ubuntu,,, (ubuntu)
Password:
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ===
Error executing command as another user: Not authorized

PS:严格来说,Virtual Network Editor GUI只有Pro版本才有的功能,主程序界面没有入口,所以在Linux下,需要从命令行寻找启动入口。
那,Windows下VM Player如何修改vmnet8的subnet呢,目前有两个方法:

  • 从VMware Workstation Player安装包中解压找出 network.cab,现解压找出 vmnetcfg.exe,
  • 使用player.exe同目录下的vnetlib.exe,此程序本身设计不单独使用的,但研究人员整理了一份使用文档,VMware Workstation Player 4个服务 adapter, authd, bridge and vmkbd 都基于这个程序入口,足见重要性。

解决

按照出错的提示,修改vmnet8的子网,重启Host机,vmnet8就恢复正常了,ip a也能正常看到了。

$ sudo vmware-networks --status
Bridge networking on vmnet0 is running
DHCP service on vmnet1 is running
Hostonly virtual adapter on vmnet1 is enabled
DHCP service on vmnet8 is running
NAT service on vmnet8 is running
Hostonly virtual adapter on vmnet8 is enabled
All the services configured on all the networks are running

但,如果只是手动修改/etc/vmware/networking这个文件后重启系统,是没有效果的。因为其还有其它相关配置文件也需要修改,如/etc/vmware/vmnet8/nat/nat.conf等。

原因

原因应该是所在网络环境已经有了vmnet8期望使用的192.168.16.1/24地址,特别是192.168.16.1
比如,局域网中其它机子最近配置了192.168.16.1地址。
参考:VMware Workstation – Virtual Ethernet failed – sometimes for good!

VMware Workstation Player的vmnet8没启动,虚拟机没法NAT的问题分析与解决相关推荐

  1. VMware Workstation 16 Pro及Centos 7 x86-64 iso镜像 安装 激活 使用 及 解决vm安装报错eulas_agreed=1

    前言 由于低版本VMware Workstation 15 安装运行Centos 7 虚拟机会出现不兼容 及蓝屏现象 为解决这一问题 及同学们少走弯路 特此写下 VMware Workstation ...

  2. 在Win10中安装虚拟机:VMware Workstation Player+Ubuntu20.04

    引言 本篇首先在Win10中安装虚拟机工具软件VMware Workstation Player:然后按照鸿蒙设备开发环境的要求,用VMware Workstation Player创建一个虚拟机:最 ...

  3. 虚拟机的三大服务器启动不了,Win7系统下共享虚拟机提示VMware Workstation Server共享服务不能启动如何解决?...

    最近有Win7系统用户在安装使用虚拟机后,发现共享虚拟机时弹跳出来了错误的VMware Workstation Server共享服务不能启动的提示窗口,这使用户非常苦恼,那么Win7系统下共享虚拟机提 ...

  4. 服务器里vm启动不了共享虚拟机,VMware Workstation Server共享服务不能启动

    话说下载了VMware Workstation 12 安装在服务器里,然后共享虚拟时机出现错误 提示VMware Workstation Server-vmwaer共服务不能启动,在网上找了半天的教程 ...

  5. VMware Workstation Player虚拟机个人免费版

    vmware workstation player对于个人用户免费,vmware workstation pro适合商业用途,为收费软件,一般普通用户只需要用vmware workstation pl ...

  6. VMware Workstation Player与VMware Workstation Pro的区别

    linux开发与学习,免不了安装虚拟机. 想想自己最开始只有一台电脑,为了体验最有滋味的linux(划重点),直接装了个双系统.之后就是各种苦不堪言:在ubuntu学着做着,为了个工具不得不关机重启回 ...

  7. VMware Workstation Player 找不到共享文件夹的解决方法

    具体问题:使用VMware Workstation Player装完linux系统后,开启共享文件夹,在linux系统中没有显示(即:无法使用共享文件夹) 解决方法:重新安装VMware  Tool ...

  8. VMware Workstation Player 官方下载地址(非商用免费)

    [下载地址] https://my.vmware.com/en/web/vmware/downloads/info/slug/desktop_end_user_computing/vmware_wor ...

  9. 【Linux】【踩坑专栏】centOS 7 桌面版使用VMWare Workstation Player 16安装时踩坑

    CentOS 7 Everything在用VMWare Workstation Player 16安装时,第二个界面是下面这个: 我安装的时候误以为"全名"是个性化Linux的全名 ...

  10. 官网下载VMware Workstation Player 16、15、14

    下载地址:https://my.vmware.com/web/vmware/downloads/info/slug/desktop_end_user_computing/vmware_workstat ...

最新文章

  1. UI设计培训中的扁平化理念
  2. Event delegate
  3. 计算机论文图,【论文】计算机图像学
  4. WPF Multi-Touch 开发:惯性效果(Inertia)
  5. C语言中,#include 和#include 的区别和注意点
  6. form表单提交,后台实体类接收转义问题
  7. 树形结构 —— 树与二叉树 —— 树的数据生成器
  8. 最强NLP模型BERT喜迎PyTorch版!谷歌官方推荐,也会支持中文
  9. 如何用R来定制个性化PPT
  10. Mac卸载比较彻底的软件管理工具:App Cleaner Uninstaller
  11. Apache Flink Meetup 8.7 深圳站改为线上
  12. 算法分析与设计:贪心算法
  13. 怎么修改服务器玩家等级级上限,GOM引擎等级限制了极限怎么办?传奇服务端突破等级限制的方法...
  14. 围棋知名AI-KataGo 下载分享
  15. 日程提醒app android,手机里有提醒日程安排的软件吗?
  16. FPGA基础之VGA(三)移动方块
  17. 计算机的文件夹打不开了,文件夹打不开,详细教您文件夹打不开怎么办
  18. sql如何查看数据库表的关联关系?
  19. postgresql立式版本下载_PostgreSQL下载_PostgreSQL最新官方版下载_3DM单机
  20. excel单元格中查找空格

热门文章

  1. 解决IP被封的问题几种方法
  2. python画江苏_江苏高考数学再现算法流程图!学过编程的孩子都说So easy!
  3. 小学数学研究性学习设计方案
  4. 桌面图标有蓝底怎么去掉?
  5. 学习和温习sqlserver
  6. 软件工程阶段性总结(四)——测试和维护
  7. MyEclipse简介
  8. php配置 验证码无法显示,PHP验证码无法显示的原因及解决办法
  9. 松翰单片机之M2ASM创建新工程
  10. Apple’s Secret? It Tells Us What We Should Love