CentOS7 install KVM Virtual Machine

Source: Internet
Author: User
Tags svm

CentOS7 install KVM Virtual Machine

I. Preparations

1. confirm that the machine has VT
Terminal input command:

grep '(vmx|svm)' /proc/cpuinfo

If vmx or svm is in flags, VT is supported. If no output is available, your cpu is not supported and you cannot use the KVM virtual machine.

2. Make sure that VT: Intel (R) Virtualization alization Tech [Enabled] is Enabled in the BIOS by running the following command:

lsmod | grep kvm modprobe kvm-intel

Ii. Bridging Network

With the bridge network, the virtual machine can access each other with other machines. 1. Copy the ifcfg-em1 as a ifcfg-br0 and change the ifcfg-br0 to the following Configuration

TYPE=BridgeBOOTPROTO=staticDEFROUTE=yesPEERDNS=yesPEERROUTES=yesIPV4_FAILURE_FATAL=noNAME=br0DEVICE=br0ONBOOT=yesIPADDR=192.168.1.116NETMASK=255.255.255.0GATEWAY=192.168.1.1

2. The original Nic ifcfg-em1 only retains the following configuration, others are commented out:

NAME=em1DEVICE=em1ONBOOT=yesBRIDGE=br0

3. Restart the network

service network restart

3. Install kvm

1. Install kvm

 yum -y install libcanberra-gtk2 qemu-kvm.x86_64 qemu-kvm-tools.x86_64 libvirt.x86_64 libvirt-cim.x86_64 libvirt-client.x86_64 libvirt-java.noarch libvirt-python.x86_64 libiscsi-1.7.0-5.el6.x86_64 dbus-devel virt-clone tunctl virt-manager libvirt libvirt-python python-virtinst

2. Install x-windows and use the graphical interface to manage virtual machines

yum groupinstall "X Window System"

3. Install Chinese characters to solve the interface garbled characters

 yum install dejavu-lgc-sans-fonts yum groupinstall "Fonts" -y

Error: 1. couldn't connect to accessibility bus failed to connect to socket/tmp/failure solution:

export NO_AT_BRIDGE=1

Iv. 1. Using virt-manager to manage virtual machines can complete cloning, installation, enabling, and disabling. For most of the operations such as ssh command logon to the server, the XC parameter must be added. If you use putty to log on to the server in windows, you must enable x-windows as follows:

Download xmingat http://sourceforge.net/projects/xming/and install and run it. Putty.exe ==> Connection/SSH/X11 ==> X11 forwarding/Enable check box, X dispaly location can be empty

2. Create a pre-allocated File

qemu-img create -f qcow2 -o preallocation=metadata /data/test.qcow2 80G

3. Enable the VM to automatically start upon startup

Virsh list -- all view Virtual Machine name and status virsh autostart + Virtual Machine name

After setting, you can see the link to the configured KVM configuration file under/etc/libvirt/qemu/autostart.

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.