首页 > 运维类 > LINUX运维 > KVM虚拟机安装方法和管理命令

9181

浏览

0

评论

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

作者:stephen | 分类:LINUX运维 | 标签:

1.安装kvm libvirt环境
yum -y install qemu* yum -y install libvirt* yum install -y kvm kmod-kvm kvm-qemu-img libvirt python-virtinst virt-manager virt-viewer bridge-utils yum -y install avahi
/etc/init.d/messagebus restart
/etc/init.d/avahi-daemon restart /etc/init.d/libvirtd restart /sbin/chkconfig messagebus on /sbin/chkconfig avahi-daemon on
service libvirtd start
chkconfig libvirtd on

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

3.其他
kvm虚拟机常常搭配lvm使用,查看虚拟机经常使用vnc
需要确保cpu打开vt支持,cat /proc/cpuinfo可以看到
虚拟机内核总数不超过物理机内核的2倍
虚拟机内粗总和不超过物理机实际内存

本文链接:https://www.stephenwxf.com/post/28.html
原创文章如转载请注明:转载自王显璠的个人博客谢谢!

Copyright Your stephenwxf.com Rights Reserved.