修复无法在Ubuntu虚拟机中启动eth0的问题

时间:2020-01-09 10:44:51  来源:igfitidea点击:

如果我们已经移动了Ubuntu虚拟机或者对其进行了修改,然后突然使网络无法正常工作,则我们可能需要通读本页面,因为我已经找到了使其重新运行的解决方法。

完整的错误消息是这样的:

eth0: ERROR while getting interface flags: No such device 
There is already a pid file /var/run/dhclient.eth0.pid with pid 6847440 
Internet Systems Consortium DHCP Client V3.0.4 
Copyright 2004-2006 Internet Systems Consortium. 
All rights reserved. 
For info, please visit http://www.isc.org/sw/dhcp/ 

SIOCSIFADDR: No such device 
eth0: ERROR while getting interface flags: No such device 
eth0: ERROR while getting interface flags: No such device 
Bind socket to interface: No such device 
Failed to bring up eth0.

运行此命令以编辑interfaces文件,然后将eth0更改为eth1.

sudo vi /etc/network/interfaces

在我们运行以下命令以重新启动网络之后,一切都应该重新开始工作:

sudo /etc/init.d/networking restart

我们应该能够运行ping命令,或者使用ifconfig -a,一切都会正常进行。