RHEL6 虚拟机克隆网络问题解决方法
2011-11-03 11:30
519 查看
环境:Virtualbox+RHEL 6 x64
用VirtualBox的vboxmanager克隆的虚拟机,操作系统RHEL6,启动后发现网卡不能用了。重启网络服务,报以下错误:
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
在RHEL5里也发生类似事情,因为复制虚拟机MAC会重新生成,但是操作系统的MAC却写在ifcfg-ethx里,造成了不一致,所以不能启动网络接 口,在RHEL5里可以使用kudzu或者注释网卡配置文件的MAC字段来解决这个问题。但是在RHEL6里,kudzu已经被hal服务取代了。虽然 lspci能够正常认到网卡,但是却无法使用/etc/init.d/network restart来启动服务。尝试注释ifcfg-eth0的MAC字段,还是报错。查看了下udev的规则,发现了问题的所在。
[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:16:31:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[root@Oracle ~]#
原来UDEV这里把克隆前的MAC当成了当前虚拟机的eth0 MAC,而重新生成的08:00:27:32:66:63是eth1的MAC。
解决这个问题,只要删除旧的UDEV配置,修改为:
[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
重启network服务,一切OK
[root@Oracle ~]# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@Oracle ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:32:66:63
inet addr:172.16.100.3 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe32:6663/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:206 errors:0 dropped:0 overruns:0 frame:0
TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21157 (20.6 KiB) TX bytes:24515 (23.9 KiB)
Virtualbox有这个问题,VMWARE克隆虚拟机应该也是有这个问题的。
最简单的解决办法是直接删除 ,就当我上面废话
rm -fr /etc/udev/rules.d/70-persistent-net.rules 重启系统就ok了。会自动生成一个新的。
用VirtualBox的vboxmanager克隆的虚拟机,操作系统RHEL6,启动后发现网卡不能用了。重启网络服务,报以下错误:
Bringing up interface eth0: Device eth0 does not seem to be present, delaying initialization. [FAILED]
在RHEL5里也发生类似事情,因为复制虚拟机MAC会重新生成,但是操作系统的MAC却写在ifcfg-ethx里,造成了不一致,所以不能启动网络接 口,在RHEL5里可以使用kudzu或者注释网卡配置文件的MAC字段来解决这个问题。但是在RHEL6里,kudzu已经被hal服务取代了。虽然 lspci能够正常认到网卡,但是却无法使用/etc/init.d/network restart来启动服务。尝试注释ifcfg-eth0的MAC字段,还是报错。查看了下udev的规则,发现了问题的所在。
[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:16:31:11", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
[root@Oracle ~]#
原来UDEV这里把克隆前的MAC当成了当前虚拟机的eth0 MAC,而重新生成的08:00:27:32:66:63是eth1的MAC。
解决这个问题,只要删除旧的UDEV配置,修改为:
[root@Oracle ~]# cat /etc/udev/rules.d/70-persistent-net.rules
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:32:66:63", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
重启network服务,一切OK
[root@Oracle ~]# /etc/init.d/network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@Oracle ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 08:00:27:32:66:63
inet addr:172.16.100.3 Bcast:172.16.100.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe32:6663/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:206 errors:0 dropped:0 overruns:0 frame:0
TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21157 (20.6 KiB) TX bytes:24515 (23.9 KiB)
Virtualbox有这个问题,VMWARE克隆虚拟机应该也是有这个问题的。
最简单的解决办法是直接删除 ,就当我上面废话
rm -fr /etc/udev/rules.d/70-persistent-net.rules 重启系统就ok了。会自动生成一个新的。
相关文章推荐
- [转]RHEL6 虚拟机克隆网络问题解决方法
- RHEL6 虚拟机克隆网络问题,未解决
- 虚拟机安装centos7.2后遗留网络问题解决方法
- linux网络设置和虚拟机克隆转移之后Error:No suitable device found:no device found for connection 'System eth0'问题解决
- 解决虚拟机克隆网络配置问题
- VMware Workstation虚拟机克隆CentOS7 出现的网络问题解决
- vmware克隆Centos6.4虚拟机网卡无法启动问题的解决方法
- 解决克隆虚拟机后网卡设备无法识别启动问题的方法
- linux网络设置和虚拟机克隆转移之后Error:No suitable device found:no device found for connection 'System eth0'问题解决
- RHEL Linux 6虚拟机克隆导致的网卡问题解决方法:
- centos6虚拟机克隆导致的网卡问题解决方法
- CentOS虚拟机克隆后无法上网(网卡信息不一致)问题的解决方法
- 解决VM克隆虚拟机网络IP配置问题及时区改为中国时区
- HyperV虚拟机一网络性能问题解决方法
- 用VMWaer克隆centos后网络的问题解决方法
- 解决VMware 虚拟机中的网络连接出现”受限制或无连接“问题的方法
- MAC使用Parallels克隆虚拟机网络不可用的解决方法
- 虚拟机上新安装的ubuntu16.04LTS无法连接网络的问题解决方法
- 解决克隆RHEL7后网络无法启动问题
- Virtual Box 复制虚拟机后网络冲突或者无法启动 问题解决方法