启动网络接口失败

3
我正在设置一个Ubuntu虚拟机(16.04.1 LTS),当我尝试从Windows上的WinSCP连接到虚拟机时,出现错误。错误信息是:developmentHost不存在。
网络接口文件如下:

enter image description here

如果我执行ifconfig命令,我会得到如下信息:

enter image description here

另一方面,Virtualbox的两个网络适配器的配置如下:

Adapter 1

在上面的图片中,我包括了端口重定向,因为我想连接虚拟机而不必编辑Windows主机文件。

Adapter 2

此外,当我重新启动时,会出现关于接口的错误。

enter image description here

5个回答

7

我不知道如何修复故障,但是我可以向您展示一种临时解决此问题的快捷方式...

1-使用此命令查找系统中可用的接口。
# ip link
例如: lo, enp0s8

2-在 /etc/network/interfaces 中添加以下行:

auto enp0s8
iface enp0s8 inet dhcp

3-重新启动您的虚拟机。
这样就完成了。


与其重新启动虚拟机,对我来说只需使用sudo /etc/init.d/networking restart命令即可。 - Sam Dan

1
你提到了虚拟机,如果硬件地址改变,那么你可能会遇到与更换物理硬件相同的问题。
获取网络卡的当前标识符:
root@mybox:/home/root# ip -a
1: ...
2: enp0df: ....(您的标识符将不同)
在/etc/network/interfaces中更新此信息:
#主要网络接口
自动enp0df
iface enp0df inet dhcp 重新启动网络服务:
/ etc / init.d / networking restart

1
在Ubuntu 16.04中,可能不再有ethX接口。这个版本现在使用所谓的“可预测的网络接口名称”,其中接口的名称可以通过以下方式确定:which tries to find fixed slot topology information in certain firmware interfaces and uses them to assign fixed names to interfaces which incorporate their physical location on the mainboard.(参见:freedesktop.org)。因此,在配置/etc/network/interfaces之前,您必须使用命令ip a找到正确的接口名称,该命令会打印类似于以下内容:

1: lo: ... 2: ensXX: ... n: ...

另请参阅:askubuntu.com


0

我认为你应该更改网络高级选项。 如果将modo promisco选项设置为Permitir todo(允许所有),它将正常工作。


那不是混杂模式的用途。 - Trenin

0

我曾经有同样的问题,最后发现是我关闭了Windows服务

VMware NAT ServiceVMnetDHCP

只需要运行它们即可。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接