环境背景:

IP os
192.168.50.189 centos 7.9.2009

1.环境准备
关闭防火墙

  1. [root@localhost ~]# systemctl stop firewalld
  2. [root@localhost ~]# systemctl disable firewalld

关闭selinux

[root@localhost ~]# setenforce 0
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

2.查看是否支持cpu是否支持虚拟化

[root@localhost ~]# cat /proc/cpuinfo | egrep "vmx|svm"

VMware需要在cpu设置页面勾上这个
image.png
3.清理旧环境

[root@localhost ~]# yum remove `rpm -qa |egrep 'qemu|virt|KVM'`

4.安装kvm

[root@localhost ~]# yum install *qemu* *virt* librbdl-devel -y

5.启动服务

[root@localhost ~]# systemctl enable libvirtd
[root@localhost ~]# systemctl status libvirtd

6.查看服务

[root@localhost ~]# lsmod | grep kvm
kvm_intel             188740  0 
kvm                   637289  1 kvm_intel
irqbypass              13503  1 kvm

7.安装图形化管理

[root@localhost ~]# yum install -y cockpit 
[root@localhost ~]# systemctl start cockpit
#浏览器访问,可以看到kvm宿主机信息
https://192.168.50.189:9090/system

后续待更新~~~