Device eth0 does not seem to be present, delaying initialization.转载
昨天在vm里面克隆了个虚拟机,克隆之后,启动了网卡起不来,已启动就报
Device eth0 does not seem to be present, delaying initialization.[FAILED]
经过各种google,最终要是找到了答案
使用克隆后的虚拟机时发现原来在基本系统中的网卡eth0到了新系统却没有了,使用ifconfig -a会发现只有lo。
http://www.linuxyan.com/linux-service/181.html
因为基本系统的网络相关配置都是基于eth0的,如果基于此克隆虚拟机继续克隆或复制新的虚拟机,网卡的标识每一次都会自动加1变成eth1(第二次克隆会变成eth2),dmesg却显示内核只识别到网卡eth0。
原因分析: 很多Linux distribution使用udev动态管理设备文件,
并根据设备的信息对其进行持久化命名。例如在centos中,udev会在系统引导的过程中识别网卡,
将mac地址和网卡名称对应起来记录在udev的规则脚本中。而VMware会自动生成虚拟机的mac地址。这样,
由于基本系统的虚拟机已经记录了该虚拟机的网卡mac地址对应于网卡eth0,在克隆出的虚拟机中由于mac地址发生改变,
udev会自动将该mac对应于网卡eth1。以此类推,udev会记录所有已经识别的mac与网卡名的关系,所以每次克隆网卡名称会自动加1,
而其实kernel仅仅只识别到一张网卡,跟网卡名相关的网络配置也未发生任何变化。解决方案:
udev将mac与网卡名称的对应关系保存在/etc/udev/rules.d/70-persistent-net.rules中,
可以看到文件内容如下
# PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:7b:60:38", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0" # PCI device 0x8086:0x100f (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:29:b9:c5", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" |
在克隆出的虚拟机中只要删除跟NAME=”eth0″相关的行,并且把eth1的改为eth0,并重启系统即可。
另外外一种方法是:把里面的内容都删除,然后重新启动,系统也会重新发现网卡硬件,重新产生该文件
相关文章
- QT-找开工程后,最上方提示the code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
- asp.net core signalr Error: Failed to start the transport 'WebSockets': null
- service mysqld start 报错:service mysqld start 报错 090517 13:34:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 090Can't open the mysql.plugin table. Please run mysql
- yii2定时任务不执行,报错PHP date调用警告:It is not safe to rely on the system's timezone settings
- Reporting Service 服务启动时报错The service did not respond to the start or control request in a timely fashion
- Attempt to fetch logical page (...) in database 2 failed. It belongs to allocation unit xxxx not to xxx
- [CSS 3] Use Multiple Background Images to Create Single Element CSS Art
- [Recoil] Use selectorFamily to take arguments in your Recoil selectors
- 'MySQLConverter' object has no attribute '_navigablestring_to_mysql'
- [Unit testing + Jest] Use jest-in-case to Reduce Duplication and Improve Test Titles
- [Flutter] Flexible the Widget height to available space
- [Cypress] Create True end-to-end Tests with Cypress (Smoke test)
- error: pathspec 'master' did not match any file(s) known to git.
- when is view bound to its corresponding controller instance
- the code place where the binding is converted to final value displayed in ui
- vue路由报错Navigating to current location (“/login“) is not allowed踩坑总结
- api:1 Failed to load resource: net::ERR_CLEARTEXT_NOT_PERMITTED
- 成功解决tensorflow.python.framework.errors_impl.UnimplementedError: Cast string to int32 is not supporte
- 成功解决UserWarning: Update your `Conv2D` call to the Keras 2 API问题
- 【异常】Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded datasource
- PAT 1033. To Fill or Not to Fill (贪婪)
- WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable Exception in thread "main" java.io.IOException: No FileSystem for sc F
- Failed to execute goal org.mybatis.generator:mybatis-generator-maven-plugin:generate (default-cli) on project : <properties> resource does not exist
- WPF – MVVM: how to draw a movable Rectangle with mouse(根据不同的实例画不同的图形)
- ffmpeg推流报错Failed to update header with correct duration.
- 【Bringing Old Photos Back to Life】How to train?如何训练
- A brief introduction to Depthwise Separable Convolution