centos6下KVM安装及虚机网卡问题解决

The kernel component of KVM is included in mainline Linux, as of 2.6.20.


1、查看系统是否硬件虚拟化
# egrep 'vmx|svm' /proc/cpuinfo


2. 安装KVM及其组件
yum -y install qemu-kvm libvirt python-virtinst bridge-utils virt-manager
yum groupinstall Virtualization 
yum groupinstall "Virtualization Platform" 


# lsmod | grep kvm


# /etc/init.d/libvirtd restart




创建桥接
cp ifcfg-eth0 ifcfg-br0


# cat ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:1d:09:66:e1:f8
IPV6INIT=no
MTU=1500
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
UUID="dacbb334-5792-4969-889a-907245adbd80"
IPADDR=192.168.100.210
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
DNS1=8.8.8.8
USERCTL=no
BRIDGE=br0  ###添加关键一行




# cat ifcfg-br0 
DEVICE=br0  ###修改关键行
BOOTPROTO=none
HWADDR=00:1d:09:66:e1:f8
IPV6INIT=no
MTU=1500
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Bridge  ###修改关键行
UUID="dacbb334-5792-4969-889a-907245adbd80"
IPADDR=192.168.100.210
NETMASK=255.255.255.0
GATEWAY=192.168.100.1
DNS1=8.8.8.8
USERCTL=no






问题:
使用kvm克隆的虚机把源机的mac地址也一并复制了,在启动克隆机时,网卡无法激活,提示如下:
device eth0 does not seem to be present,delaying initialization


原因:因mac地址重复,克隆机把eth0重命名成eth1了
解决:
1、列出识别的当前网卡列表
# ls /sys/class/net
eth1 lo


2、删除第一条SUBSYSTEM,把原第二条SUBSYSTEM的NAME="eth1"修改为NAME="eth0"
#vim /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.


# PCI device 0x15ad:0x07b0 (vmxnet3) (custom name provided by external tool)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:45", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"


# PCI device 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:56:bc:00:46", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"






3、修改网卡eth0的配置文件的mac地址HWADDR为修改后70-persistent-net.rules中的mac地址 
#vim /etc/sysconfig/network-scripts/ifcfg-eth0




4、reboot.


参考:http://www.ryanchapin.com/fv-b-4-655/Cloned-VMware-CentOS6-Server-and--quot-device-eth0-does-not-seem-to-be-present--delaying-initialization-


quot--Error-.html
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值