Install KVM in Centos 6

Source: Internet
Author: User

Centos 6 install KVM configuration 1. Install System Configuration 1. When installing the system, select minimal for minimal installation, select the custom configuration (Customize now) package to install, and then next. 2. Select "constraint zation" and select all the sub-options. 3. Select Development and all sub-options except Eclipse. Yum install kvm virt-viewer virt-manager libvirt-python-plugin inst OR yum groupinstall KVM 2. Configure bridging Nic 1. Verify that the kvm module lsmod is loaded in the system | grep kvm 2 after entering the system, edit the NIC Configuration: vi/etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE = "eth0" HWADDR = "00: F1: F3: 11: E3: EC "NM_CONTROLLED =" yes "ONBOOT =" yes "IPADDR = 192.168.2.50 BOOTPROTO = none NETMASK = 255.255.255.0 TYPE = Ethernet GATEWAY = 192.168.2.1 255.6init = no USERCTL = no BRIDGE = Br0: configure the corresponding information according to your network card. No information is added. 3. Copy the NIC configuration file and rename it to ifcfg-br0 cp/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network-scripts/ifcfg-br0 DEVICE = "br0" // here change for br0 HWADDR = "00: f1: F3: 11: E3: EC "NM_CONTROLLED =" yes "ONBOOT =" yes "IPADDR = 192.168.2.50 BOOTPROTO = none NETMASK = 255.255.255.0 TYPE = Bridge // here change to Bridge GATEWAY = 192.168.2.1 255.6init = no USERCTL = no # BRIDGE = br0 // watch or delete the row. 4. Restart the network service. If everything goes well, you will see that the br0 interface will replace the IP address of the original eth0 interface. 3. Run the following command to install the Virtual Machine virt-install \ -- name vm3 \ -- OS-variant = rhel6 \ -- vcpus = 1 \ -- ram 2048 \ -- network bridge = br0 \ -- disk path =/vm /images/vm3.img, size = 50 \ -- cdrom/vm/iso/CentOS-6.2-x86_64-bin-DVD1.iso \ -- vnc \ -- vnclisten = 192.168.2.90 \ -- vncport = 7903 virt-install \ -- name CentOS_C \ -- OS-variant = rhel6 \ -- vcpus = 1 \ -- ram 512 \ -- network bridge = br0 \ -- disk path =/home/fedora /. local/share/gnome-boxes/ima Ges/CentOS_C.img, size = 20 \ -- cdrom/data/ios/CentOS-6.2-x86_64-bin-DVD1.iso \ -- vnc \ -- vnclisten = 192.168.2.4 \ -- vncport = 7901 note: # Virtual Machine name # virtual machine operating system version # Number of vcpus allowed for virtual machines # allocated memory size, in MB # configure the NIC as the bridging mode, bridge to br0 Nic # specify the disk image file and size used by the VM (unit: GB) # specify the location of the vm cd image # enable vnc service # address of the vnc service listener # Port Number of the vnc service listener 4. Connect the Virtual Machine installation system to the vnclisten specified listener through the vnc client IP address and port, it is the same as output to the display through the VGA interface. V. Related command virsh list: display the running Virtual Machine virsh list -- all: display all virtual machines virsh start vm6: start the Virtual Machine virsh shutdown vm6 with the name of vm6: disable the Virtual Machine virsh destroy vm6 named vm6: Force disable the Virtual Machine virsh undefine vm6 named vm6: remove the Virtual Machine virsh autostart vm6 named vm6: set vm6 VM startup 6. Rename VM 1. Export the configuration file virsh dumpxml vm5>/etc/libvirt/qemu/reg. xml 2. Edit the configuration file and change the name vi/etc/libvirt/qemu/reg. xml ==> <name> reg </name> 3. Remove the original Virtual Machine virsh undefine vm5 4. Load the new Virtual Machine virsh define reg. xml 7. Create a snapshot for the VM 1. convert the disk image file format to qcow2 virsh shutdown vm5 qemu-img convert-f raw-O qcow2 vm5.img vm5qcow2. img 2. create a snapshot virsh snapshot-create-as vm5 OK 3. view the snapshot virsh snapshot-list vm5 4. Restore the snapshot virsh snapshot-revert vm5 OK 5. delete the snapshot virsh snapshot-delete. vm5 OK 6. Questions about getting help virsh help snapshot System graphic interface text box: yum-y install fontforge

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.