The kernel component of KVM is supported in mainline Linux, as of 2.6.20.
1. Check whether the system is virtualized.
# Egrep 'vmx | svm '/proc/cpuinfo
2. Install KVM and its components
Yum-y install qemu-kvm libvirt python-stronginst bridge-utils virt-manager
Yum groupinstall Virtualization
Yum groupinstall "Virtualization Platform"
# Lsmod | grep kvm
#/Etc/init. d/libmongod restart
Create a bridge
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 ### Add a key line
# Cat ifcfg-br0
DEVICE = br0 ### modify key lines
BOOTPROTO = none
HWADDR = 00: 1d: 09: 66: e1: f8
IPV6INIT = no
Mtu= 1500
NM_CONTROLLED = no
ONBOOT = yes
TYPE = Bridge ### modify key lines
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
Problem:
The mac address of the source machine is also copied from the VM cloned by kvm. When the clone machine is started, the NIC cannot be activated. The following message is displayed:
Device eth0 does not seem to be present, delaying initialization
Cause: Because the mac address is repeated, the clone machine renamed eth0 to eth1.
Solution:
1. List recognized current NICs
# Ls/sys/class/net
Eth1 lo
2. Delete the first SUBSYSTEM and change the NAME = "eth1" of the original second SUBSYSTEM to 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. Modify the mac address of the eth0 configuration file HWADDR to the mac address in the modified 70-persistent-net.rules.
# Vim/etc/sysconfig/network-scripts/ifcfg-eth0
4. reboot.
Reference: 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