VMware Player Internet 在 Ubuntu Host 中无法运行

VMware Player Internet 在 Ubuntu Host 中无法运行

我正在使用 Ubuntu 17.04 和 VMware Workstation 12 Player。我在 VMware Player 中将 Windows 10 安装了为 Guest。但无法上网。出现以下错误,

Could not connect 'Ethernet0' to virtual network '/dev/vmnet8

VMware 网络设置

VMware 网络设置

尝试了桥接和仅主机选项,但仍然不起作用。

我的/etc/网络/接口内容,

auto lo
iface lo inet loopback

我的是否配置输出,

enp7s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 28:d2:44:34:93:89  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 815450  bytes 378740719 (378.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 815450  bytes 378740719 (378.7 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.110  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::3210:b3ff:fe94:91b8  prefixlen 64  scopeid 0x20<link>
        ether 30:10:b3:94:91:b8  txqueuelen 1000  (Ethernet)
        RX packets 36388873  bytes 3782447465 (3.7 GB)
        RX errors 0  dropped 0  overruns 0  frame 1093979
        TX packets 11323909  bytes 2248899815 (2.2 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  

有人能帮我解决这个问题吗?

编辑:

/etc/sysctl.conf 内容

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#

###################################################################
# Magic system request Key
# 0=disable, 1=enable all
# Debian kernels have this set to 0 (disable the key)
# See https://www.kernel.org/doc/Documentation/sysrq.txt
# for what other values do
#kernel.sysrq=1

###################################################################
# Protected links
#
# Protects against creating or following links under certain conditions
# Debian kernels have both set to 1 (restricted) 
# See https://www.kernel.org/doc/Documentation/sysctl/fs.txt
#fs.protected_hardlinks=0
#fs.protected_symlinks=0
vm.swappiness = 10

在跑步的时候sudo vmware-modconfig --console --install-all

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
make: Entering directory '/tmp/modconfig-CWgezO/vmmon-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.10.0-24-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-4.10.0-24-generic'
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/linux/driverLog.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/linux/driver.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/linux/hostif.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/memtrack.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/cpuid.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/vmx86.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/apic.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/task.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/hashFunc.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/comport.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/common/phystrack.o
  CC [M]  /tmp/modconfig-CWgezO/vmmon-only/vmcore/moduleloop.o
/tmp/modconfig-CWgezO/vmmon-only/linux/driver.c:1291:1: warning: always_inline function might not be inlinable [-Wattributes]
 LinuxDriverSyncReadTSCs(uint64 *delta) // OUT: TSC max - TSC min
 ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/modconfig-CWgezO/vmmon-only/linux/driver.c: In function ‘LinuxDriver_Ioctl’:
/tmp/modconfig-CWgezO/vmmon-only/linux/driver.c:1986:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 }
 ^
  LD [M]  /tmp/modconfig-CWgezO/vmmon-only/vmmon.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-CWgezO/vmmon-only/vmmon.mod.o
  LD [M]  /tmp/modconfig-CWgezO/vmmon-only/vmmon.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-24-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-CWgezO/vmmon-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-CWgezO/vmmon-only'
cp -f vmmon.ko ./../vmmon.o
make: Leaving directory '/tmp/modconfig-CWgezO/vmmon-only'
make: Entering directory '/tmp/modconfig-CWgezO/vmnet-only'
Using kernel build system.
/usr/bin/make -C /lib/modules/4.10.0-24-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= modules
make[1]: Entering directory '/usr/src/linux-headers-4.10.0-24-generic'
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/driver.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/hub.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/userif.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/netif.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/bridge.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/smac_compat.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/smac.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/procfs.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/vnetEvent.o
  CC [M]  /tmp/modconfig-CWgezO/vmnet-only/vnetUserListener.o
In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-CWgezO/vmnet-only/netif.c:43:
./include/linux/pci_ids.h:2255:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
 #define PCI_VENDOR_ID_VMWARE  0x15ad

In file included from /tmp/modconfig-CWgezO/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-CWgezO/vmnet-only/netif.c:42:
/tmp/modconfig-CWgezO/vmnet-only/vm_device_version.h:56:0: note: this is the location of the previous definition
 #define PCI_VENDOR_ID_VMWARE                    0x15AD

In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-CWgezO/vmnet-only/netif.c:43:
./include/linux/pci_ids.h:2256:0: warning: "PCI_DEVICE_ID_VMWARE_VMXNET3" redefined
 #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07b0

In file included from /tmp/modconfig-CWgezO/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-CWgezO/vmnet-only/netif.c:42:
/tmp/modconfig-CWgezO/vmnet-only/vm_device_version.h:73:0: note: this is the location of the previous definition
 #define PCI_DEVICE_ID_VMWARE_VMXNET3            0x07B0

In file included from /tmp/modconfig-CWgezO/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-CWgezO/vmnet-only/bridge.c:52:
/tmp/modconfig-CWgezO/vmnet-only/vm_device_version.h:56:0: warning: "PCI_VENDOR_ID_VMWARE" redefined
 #define PCI_VENDOR_ID_VMWARE                    0x15AD

In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-CWgezO/vmnet-only/bridge.c:51:
./include/linux/pci_ids.h:2255:0: note: this is the location of the previous definition
 #define PCI_VENDOR_ID_VMWARE  0x15ad

In file included from /tmp/modconfig-CWgezO/vmnet-only/net.h:38:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/vnetInt.h:26,
                 from /tmp/modconfig-CWgezO/vmnet-only/bridge.c:52:
/tmp/modconfig-CWgezO/vmnet-only/vm_device_version.h:73:0: warning: "PCI_DEVICE_ID_VMWARE_VMXNET3" redefined
 #define PCI_DEVICE_ID_VMWARE_VMXNET3            0x07B0

In file included from ./include/linux/pci.h:35:0,
                 from /tmp/modconfig-CWgezO/vmnet-only/compat_netdevice.h:27,
                 from /tmp/modconfig-CWgezO/vmnet-only/bridge.c:51:
./include/linux/pci_ids.h:2256:0: note: this is the location of the previous definition
 #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07b0

  LD [M]  /tmp/modconfig-CWgezO/vmnet-only/vmnet.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /tmp/modconfig-CWgezO/vmnet-only/vmnet.mod.o
  LD [M]  /tmp/modconfig-CWgezO/vmnet-only/vmnet.ko
make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-24-generic'
/usr/bin/make -C $PWD SRCROOT=$PWD/. \
  MODULEBUILDDIR= postbuild
make[1]: Entering directory '/tmp/modconfig-CWgezO/vmnet-only'
make[1]: 'postbuild' is up to date.
make[1]: Leaving directory '/tmp/modconfig-CWgezO/vmnet-only'
cp -f vmnet.ko ./../vmnet.o
make: Leaving directory '/tmp/modconfig-CWgezO/vmnet-only'
Starting VMware services:
   Virtual machine monitor                                             done
   Virtual machine communication interface                             done
   VM communication interface socket family                            done
   Blocking file system                                                done
   Virtual ethernet                                                   failed

答案1

有机会重新安装 Ubuntu。此后 VMware Player Internet 运行良好。看起来网络配置存在一些问题。

ifconfig 的结果是,

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0
        ether 02:42:1f:56:ce:6b  txqueuelen 0  (Ethernet)
        RX packets 24  bytes 1632 (1.6 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 172  bytes 18293 (18.2 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

enp7s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 28:d2:44:34:93:89  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 19  

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 432343  bytes 111420404 (111.4 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 432343  bytes 111420404 (111.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.51.1  netmask 255.255.255.0  broadcast 172.16.51.255
        inet6 fe80::250:56ff:fec0:1  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1990  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.39.1  netmask 255.255.255.0  broadcast 172.16.39.255
        inet6 fe80::250:56ff:fec0:8  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:08  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1991  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp8s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.2.110  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::3210:b3ff:fe94:91b8  prefixlen 64  scopeid 0x20<link>
        ether 30:10:b3:94:91:b8  txqueuelen 1000  (Ethernet)
        RX packets 3634899  bytes 199331024 (199.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 106167
        TX packets 1116099  bytes 429449640 (429.4 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 16  

之前失败的 vmnet 网络接口现已正确创建。

相关内容