我遇到了一个奇怪的问题,在 VirtualBox 中将 Windows 7 VM 上的网络模式更改为桥接模式会导致我在 Ubuntu 主机中丢失有线以太网连接。问题是,即使我在 VM 上重新更改网络模式、重新启动网络管理器或重新启动我的机器,我也看不到任何以太网网络。就好像 VirtualBox 正在弄乱一些网络配置文件,但我不知道是什么。
我的/etc/NetworkManager/NetworkManager.conf
文件,一切似乎都很好(我没有将其设置为托管,但这从来都不是问题)。因此,网络管理器不应该关心 中的内容/etc/network/interfaces
,其中我只有我的环回接口。我还重新启动并重新启动了网络管理器,但即使只是运行dhcpcd
,它也找不到任何接口,尽管它列在 的输出中ifconfig -a
这可能只是 VirtualBox 的一个错误,但它确实很烦人。任何帮助都将不胜感激。
更多输出:
ifconfig
:
enp2s0 Link encap:Ethernet HWaddr 58:20:b1:68:ff:f4
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:43 Base address:0xe000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:581 errors:0 dropped:0 overruns:0 frame:0
TX packets:581 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1
RX bytes:61230 (61.2 KB) TX bytes:61230 (61.2 KB)
wlp5s0 Link encap:Ethernet HWaddr 5c:e0:c5:32:7f:85
inet addr:10.219.184.99 Bcast:10.219.255.255 Mask:255.255.0.0
inet6 addr: fe80::4d41:3774:5f38:aa9e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:4544 errors:0 dropped:0 overruns:0 frame:0
TX packets:3794 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4339663 (4.3 MB) TX bytes:569662 (569.6 KB)
cat /etc/NetworkManager/NetworkManager.conf
[main]
plugins=ifupdown,keyfile,ofono
dns=dnsmasq
[ifupdown]
managed=false
cat /etc/network/interfaces
auto lo
iface lo inet loopback
sudo lshw -C network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:02:00.0
logical name: enp2s0
version: 15
serial: 58:20:b1:68:ff:f4
size: 10Mbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8168 driverversion=8.041.00-NAPI duplex=half latency=0 link=no multicast=yes port=twisted pair speed=10Mbit/s
resources: irq:43 ioport:4000(size=256) memory:c4204000-c4204fff memory:c4200000-c4203fff
*-network
description: Wireless interface
product: Wireless 7265
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:05:00.0
logical name: wlp5s0
version: 61
serial: 5c:e0:c5:32:7f:85
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
configuration: broadcast=yes driver=iwlwifi driverversion=4.4.0-53-generic firmware=17.352738.0 ip=10.219.184.99 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
resources: irq:50 memory:c4000000-c4001fff