How to install KVM virtual machine in Linux system

Time:2021-5-4

KVM is a virtual machine, mainly used in Linux system, so how to install KVM in Linux system? The following Editor takes centos5.5 as an example to introduce the installation method of KVM.

 CentOS5.5安装KVM虚拟机的步骤

Steps:

1. Check whether the CPU supports virtualization and execute the command # cat / proc / cpuinfo | grep flags

The appearance of VMX or SVM indicates CPU support, where SVM is for AMD platform and VMX is for Intel platform.

2. The KVM installation package has been included in the installation package of the system disk. Mount the CD directly and set the yum source as the local CD

Yum — disableepo = \ * — enablerepo = C5 media groupinstall ‘KVM’ installation

Check whether the system has loaded the KVM module

Method 1 [email protected] ~]# lsmod |grep kvm

  kvm_intel 86920 0

kvm 226208 2 ksm,kvm_ If Intel does not display, restart the system will display!

Method 2 [email protected] ~]# virsh -c qemu:///system list

  Id Name State

———————————-No error message means that the installation is correct!

3. Restart the computer, enter the BIOS, and turn on the virtualization function of CPU (according to the different BIOS, find it yourself)!)

BIOS — “advanced –” processor configuration — “Intel (R) virtualization technology select enable,

4. Create a bridge (no bridge utils tools need to be installed, the system has been installed by default)

  cd /etc/sysconfig/network-scripts/

  cp ifcfg-eth0 ifcfg-br0

  vi ifcfg-eth0

  DEVICE=eth0

#Bootproto = none

Hwaddr = 38:60:77:30:5a:16

  ONBOOT=yes

#Type = Ethernet comment out

Bridge = BR0 add

#Netmask = 255.255.255.0 comment out

#IPADDR = 192.168.0.32

#Gateway = 192.168.0.1

  vi ifcfg-br0

  DEVICE=br0

  BOOTPROTO=none

Hwaddr = 38:60:77:30:5a:16 can not be written

  ONBOOT=yes

Type = bridge is very important

Netmask = 255.255.255.0, according to the actual situation

IPADDR = 192.168.0.32 I specify IP manually, or I can get it automatically by DHCP!!

Gateway = 192.168.0.1, according to the actual situation

Service network restart ifconfig view related information

5. Enter the graphical interface of the system, and click virtual machine manager under applications — system tools to open it

6. Install the operating system in KVM, the method is similar to that in VMware.

When selecting the network connection mode, select nat (bridge BR0)!!!

The virtual system image path is / var / lib / libvirt / images /, and the corresponding. Img file can be deleted for unnecessary virtual systems.

7. After setting, wait for the system to be installed. Because the network mode is bridge BR0, the system can be connected to the Internet after the system is installed and restarted.

The above is the method of installing KVM virtual machine in centos5.5. Before installing, you should check whether the system CPU supports virtualization to avoid installation errors.

Recommended Today

Large scale distributed storage system: Principle Analysis and architecture practice.pdf

Focus on “Java back end technology stack” Reply to “interview” for full interview information Distributed storage system, which stores data in multiple independent devices. Traditional network storage system uses centralized storage server to store all data. Storage server becomes the bottleneck of system performance and the focus of reliability and security, which can not meet […]