1, the Physical machine system installation (hard disk for 300g+300g):
centos6.5 64-bit, does not install the desktop environment, the default run level is 3 partition:/boot 128Mswap 8g/20g/data1 first hard disk remaining space/data2 the second hard disk full space with minimal installation + the following package: Basesystem-- basedevelopment--Development tools to configure DNS to determine the system time with the Beijing time synchronization server to allow command restart (auto-complete), if required self-test, manual press F1, please remove the Machine self-test) BIOS on VT function
2. Installation of the KVM environment:
Yum-y Install KVM python-virtinst libvirt tunctl bridge-utils virt-manager qemu-kvm-tools virt-viewer virt-v2v libguestfs -tools/sbin/service LIBVIRTD restartln-s/USR/LIBEXEC/QEMU-KVM/USR/BIN/QEMU-KVM
Create a network bridge: Cat/etc/sysconfig/network-scripts/ifcfg-br0
Device=br0type=bridgeonboot=yesbootproto=staticipaddr= Public network ipnetmask= public IP mask gateway= public IP Gateway
Modify the NIC information to connect the NIC to the bridge: cat/etc/sysconfig/network-scripts/ifcfg-em1
Device=em1bridge=br0onboot=yesbootproto=none
To restart the network card:
Service Network restart
To view the Network bridge:
[[email protected] data1]# Brctl Show bridge name Bridge ID STP enabled INTERFACESBR0 8 000.d4ae526e935a no em1virbr0 8000.525400efec1a Yes Virbr0-nic
Now that the KVM environment is installed, the next new virtual machine installs the operating system
3, upload ISO (slightly)
4. Create a virtual machine:
To create a disk:
Qemu-img create-f qcow2 centos01.img 120gvirt-install--name=centos01--ram 4096--vcpus=2--disk path=/data1/centos01.i Mg,format=qcow2,si
--name specifying the virtual machine name
--ram allocates memory size.
--vcpus allocates CPU cores, with the largest number of CPU cores in the physical machine
--DISK Specifies the virtual machine image, size specifies the allocation size in units of G.
--network network type, used here is the default, the general use should be bridge bridging.
--accelerate acceleration
--cdrom specifying the installation image ISO
--VNC Enable VNC remote Management, the general installation system will be enabled.
--VNCPORT Specifies the VNC monitoring port, the default port is 5900, and the port cannot be duplicated.
--vnclisten Specifies the VNC bound IP, the default binding 127.0.0.1, this is changed to 0.0.0.0
If no accident, the system will start the 5910-terminal
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7F/09/wKioL1cQsJXSRD3QAABja6zGAzM016.png "style=" float: right; "title=" 1.png "alt=" Wkiol1cqsjxsrd3qaabja6zgazm016.png "/> for VNC connection and then use the VNC client to connect the installation system, The same as in the computer room to connect the monitor, if the VNC client connection Flash back, you can set the Colourlevel to rgb222, such as:
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/7F/09/wKioL1cQsTmAbj1sAABeXIUeL2w427.png "style=" float: right; "title=" 2.png "alt=" Wkiol1cqstmabj1saabexiuel2w427.png "/>
5, install the operating system (slightly)
6, the Daily management of KVM:
View KVM list: Virsh list--all
Start Kvm:virsh start centos01
Close Kvm:virsh shutdown centos01
Force off Kvm:virsh Destroy CENTOS01
Pause Kvm:virsh Suspend centos01
Resuming Kvm:virsh resume Centos01
Clone Kvm:virt-clone-o centos01-n centos02-f/data1/centos02.img
Edit KVM Configuration: Virsh edit centos01
To delete a VNC port:
Virsh edit Centos01, after opening the XML, delete the following configuration:
<graphics type= ' vnc ' port= ' 5910 ' autoport= ' no ' listen= ' 0.0.0.0 ' > <listen type= ' address ' address= ' 0.0.0.0 '/&G T </graphics>
To set up KVM boot autostart:
Vrish autostart centos01
This article is from the "Wang Gaoli" blog, make sure to keep this source http://wanggaoli.blog.51cto.com/10422005/1764256
KVM Virtualization-Basic building