It's a good thing to create KVM on centos6.5, and there are some problems on the centos7.1, which are documented here, reference documents
Https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Virtualization_Deployment_and_ Administration_guide/chap-network_configuration.html#sect-network_configuration-network_address_translation_ Nat_with_libvirt
# yum Install virt-install Libvirt-python virt-manager python-virtinst libvirt-client
Yum Install iptables*-y (installed here iptables because there is a need here, the company applied for a public IP address, but need to meet the creation of four KVM virtual machine can access the Internet normally, and from the Internet can also access the virtual machine, That can only solve the problem with Snat and Dnat, and iptables is to solve the NAT problem)
Issue 1, in the reference Redhat official website installation instructions, default network is not visible
# Virsh net-list--allname State Autostart-----------------------------------------Default Active Yes
Workaround:
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
(Note: The default network when KVM is created is NAT mode, so the command must have the correct output.)
First verify that the server supports virtualization
[Email protected] sysconfig]# egrep ' svm|vmx '/proc/cpuinfo
With one of these two marks, you can
Start this service and add it to boot
Systemctl Enable LIBVIRTD && systemctl start LIBVIRTD
Create a hard disk
Qemu-img create-f Raw/kvm/kvm01.raw 100G
Create a virtual machine
Virt-install--name kvm01--ram=2048--vcpus=2--disk path=/kvm/kvm01.raw--cdrom/kvm/centos-7-oem_2.iso--network Network=default--graphics vnc,listen=0.0.0.0--noautoconsole--os-type=linux
The disc here is the automated installation CD we wrote earlier.
Then directly with VNC connection, the default port is 5901, next time we introduce centos7.1 below iptables Snat and Dnat configuration
This article from "Martin" blog, declined reprint!
centos7.1 KVM Virtual Machine