Linux KVM Installation Configuration

Source: Internet
Author: User

--------------------------
First, preface
Second, the environment
Three, installation and configuration
Iv. Creating a KVM virtual machine

First, preface

KVM, known as kernel-based virtual machine, is an open source system virtualization module that has been integrated into all major distributions of Linux since Linux 2.6.20. It is managed using Linux's own scheduler, so its core source code is few compared to Xen. KVM has become one of the mainstream VMM in academia today. KVM Virtualization requires hardware support (such as Intel VT Technology or AMD V technology). is hardware-based full virtualization. In the early stages of Xen, the Para-virtualization is based on software simulations,

The new version is full virtualization based on hardware support. But Xen itself has its own process scheduler, storage Management module, etc., so the code is rather large. The widely circulated business system virtualization software VMware ESX series is also based on software simulation para-virtualization.

Second, the environment

System: rhel6.5 64-bit

Package Group:

Virtualization provides the environment for virtual machines, mainly including QEMU-KVM

Virtualization-client manages and installs the virtual machine instance client, mainly has the Python-virtinst,virt-manager,virt-viewer

Virtualization-platform provides access to and control over the virtual client interface, mainly libvirt,libvirt-client

Virtualization-tools Tools for managing offline virtual machine mirroring, mainly libguestfs

Select packages according to your needs, typically install the top three, or you can install only individual major packages.

To reduce unnecessary hassles, turn off the firewall and SELinux

# Cat/proc/cpuinfo |GREP flags requires full virtualization support for VMX (Inter) or SVM (AMD)

If you determine that the physical machine supports CPU virtualization technology and you cannot find the appropriate directive using the above command, refer to the following workaround:

Http://www.linuxidc.com/Linux/2014-10/107895.htm

Three, installation and configuration

# yum Groupinstall "Virtualization" "Virtualization Client" "Virtualization Platform"

# yum Install QEMU-KVM Virt-manager libvirt//can also install only individual major packages

# lsmod |grep KVM//KVM module must be loaded

Kvm_intel 53484 0

KVM 316506 1 Kvm_intel

# service LIBVIRTD start//start Libvirt Services

Starting LIBVIRTD daemon: [OK]

--------------------------------------Split Line--------------------------------------

# Brctl Show

Bridge name Bridge ID STP enabled interfaces


# CP/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ETHO0/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-BR0

# Cat Ifcfg-br0

Device= "BR0"//device name, must and Bridge= "" in the same, but also with the name of the bridge configuration file ifcg-"" This and the same
Type= "Bridge"//specified type is bridge
Delete things like Mac uid, IP address like eth0

# Ifup Br0

Then modify the corresponding network card configuration file, my is eth1:

# Realtek Semiconductor Co., Ltd. RTL-8169 Gigabit Ethernet
Device=eth1
#BOOTPROTO =none
#BROADCAST =10.1.255.255
Hwaddr=d8:5d:4c:74:ee:e8
#IPADDR =10.1.29.3
#NETMASK =255.255.0.0
#NETWORK =10.1.0.0
Onboot=yes
#TYPE =ethernet
#USERCTL =no
#IPV6INIT =no
#PEERDNS =yes
Bridge=br0

The original configuration of the NIC only retains the device name, hardware address, onboot option, and the newly added bridge=br0
Note that the IP, netmask, and gateway inside the BR0 should be identical to the eth0,
This is because immediately br0 will replace Eth0 as an external network interface,
And eth0 will only be used as bridging, losing the role of external network interface.

[Email protected] network-scripts]# route
Kernel IP Routing Table
Destination Gateway genmask Flags Metric Ref use Iface
Default gateway 0.0.0.0 UG 425 0 0 Br0
10.10.0.0 0.0.0.0 255.255.252.0 U 425 0 0 Br0
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0

[Email protected] network-scripts]# Brctl Show
Bridge name Bridge ID STP enabled interfaces
Br0 8000.FC4DD4F1DD45 No Eno1
Virbr0 8000.525400312AE0 Yes Virbr0-nic

# Service Network Restart
# systemctl Restart Network-scripts
# service LIBVIRTD Start
# Systemctl Start LIBVIRTD
# Systemctl Enable LIBVIRTD

--------------------------------------Split Line--------------------------------------

Iv. Creating a KVM Virtual machine (graphical interface)

1. Create a virtual machine storage location on a KVM host

# mkdir-p/opt/kvmdata

2. You can use VNC to remotely connect to a KVM host for management. Application→system Tools→box

Linux KVM Installation Configuration

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.