Solution to KVM installation and VM Nic problems in centos6

Source: Internet
Author: User
Tags custom name
ThekernelcomponentofKVMisincludedinmainlineLinux, a 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
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.