先是进入这个目录/var/lib/libvirt/images
去cp一个相同的模板
cp 3.qcow2 33.qcow2
用命令行创建虚拟机
virt-install --connect qemu:///system --graphics vnc --noautoconsole --ram 1024 --vcpus=1 --virt-type\
kvm --os-type=linux --name 33 --network default --disk path=/var/lib/libvirt/images/33.qcow2,format=qcow2 --import
需要安装这个命令
yum -y install virt-install
各个命令的介绍
system --graphics vnc #系统图形
--noautoconsole --ram 1024 #内存
--vcpus=1 #cpu
--virt-type\kvm #类型 kvm
--os-type=linux #系统类型 liunx
--name 33 #虚拟机的名字
--network default #网卡默认为nat
--disk path=/var/lib/libvirt/images/33.qcow2 #硬盘路径
format=qcow2 #格式
用命令行添加网卡(例如 桥接、仅主机)
kvm基础命