KVM 一键安装脚本

安装KVM,Xfce 以及virt-manager,桌面方式管理KVM虚拟机:

 

#!/bin/bash

#

lsmod |grep kvm || exit 3 && echo 'KVM mode is not loaded!'

ping www.163.com -c 2

if [ $? -eq 0 ] ;then

    yum -y groupinstall Xfce --skip-broken

    yum -y groupinstall 'Virtualization Host' 'Virtualization'

    yum -y install qemu-kvm qemu-kvm-tools virt-manager virt-viewer && ln -sv /usr/libexec/qemu-kvm /usr/bin/qemu-kvm

    yum -y install libvirt libvirt-client python-virtinst && service libvirtd start 

else 

echo 'Cannot connect to Internet, Plz check you network!'

fi


进入xfce进行虚拟机管理:

$ startxfce4



你可能感兴趣的:(KVM虚拟机)