Create a virtual machine
Virt-install \
--name centos \ #虚拟机名字
--ram \ #内存大小
--vcpus=2 \ #CPU的数量
--disk path=/kvm/vm1.img,size=8 \ #硬盘文件
--network bridge=br0 \ #网卡接口
--OS-VARIANT=RHEL6 \ #操作系统类型
--cdrom/iso/centos-6.6-x86_64-minimal.iso \ #安装光盘镜像文件
--vnclisten=10.24.24.25 \ #vnc监听ip
--vncport=6900 \ #vnc监听端口
--vnc
My configuration file is as follows:
Virt-install--name centos01--ram 1024x768--vcpus=1--disk path=/kvm/centos01.img,size=60--network bridge=br0 \
--os-variant=rhel6--cdrom/iso/centos-6.6-x86_64-bin-dvd1.iso--vnclisten=192.168.0.185--vncport=6900--vnc
Virsh List List of running virtual machines
Virsh start CentOS launch CentOS virtual machine
Virsh shutdown CentOS off CentOS virtual machine
Virsh destroy CentOS forced shutdown of CentOS virtual machine
Virsh autostart CentOS Setup CentOS Auto Start
Virsh undefine CentOS Delete CentOS virtual machine
Virsh suspend CentOS suspended CentOS virtual machine
Virsh Resume CentOS Recovery CentOS virtual machine
This article is from the "Linux operations self-cultivation" blog, please be sure to keep this source http://ywliyq.blog.51cto.com/11433965/1765546
KVM virtual Machine common commands