常用KVM虚拟机安装方法和管理命令

1.命令安装kvm libvirt环境

yum -y install qemu-kvm qemu-img virt-viewer virt-manager libvirt python-virtinst

yum install kvm libvirt python-virtinst qemu-kvm virt-viewer tunctl bridge-utils avahi dmidecode qemu-kvm-tools virt-manager qemu-img virt-install net-tools libguestfs -tools -y

yum install epel-release net-tools vim unzip zip wget ftp -y

2.常用命令
生成kvm虚拟机:virt-install
查看在运行的虚拟机:virsh list
查看所有虚拟机:virsh list –all
查看kvm虚拟机配置文件:virsh dumpxml name
启动kvm虚拟机:virsh start name
停止:virsh destroy name
删除:virsh undefine name
根据配置文件定义虚拟机:virsh define file-name.xml
console虚拟机:virsh console name

 

Be the first to comment

Leave a Reply

Your email address will not be published.


*