CentOS下安装配置KVM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS下安装配置KVM相关的知识,希望对你有一定的参考价值。

CentOS下安装配置KVM


OS version: CentOS Linux release 7.6.1810 (Core)

Install KVM kernel

yum install -y centos-release-qemu-ev.noarch
yum install -y qemu-kvm.x86_64 qemu-kvm-tools.x86_64

Install virt mgmt tool

yum install libvirt.x86_64 libvirt-cim.x86_64 libvirt-client.x86_64 libvirt-java.noarch libvirt-python.x86_64 virt-*

Load KVM kernel

modprobe kvm
modprobe kvm-intel

Verify service

lsmod | grep kvm

Via vnc client to connect KVM server

( about how to config VNC, check this: https://blog.51cto.com/snowlai/2301463 )
virt-manager
技术图片

Enable and Start libvirtd service

systemctl start libvirtd
systemctl enable libvirtd OR chkconfig libvirtd on
ps -ef | grep libvirtd

Create virtual switch for Guest OS - use bridge way

vim ifcfg-br0

###################################
DEVICE=br0
BOOTPROTO=static
ONBOOT=yes
IPADDR=xxxx.xxxx.xxxx.xxxx
NETMASK=255.255.255.0
TYPE=Bridge
###################################

vim ifcfg-eno1

###################################
TYPE=Ethernet
BOOTPROTO=none
NAME=eno1
DEVICE=eno1
ONBOOT=yes
BRIDGE=br0
###################################

Reboot NIC

/etc/init.d/network restart

Verify br0 is actived

ifconfig | grep br0
技术图片

So far you are able to create VMs from KVM

技术图片

以上是关于CentOS下安装配置KVM的主要内容,如果未能解决你的问题,请参考以下文章

Ubuntu 16.04下使用VMware安装CentOS 6.9然后在里面再安装KVM之后配置网桥无法上网的问题

CentOS7上安装并配置KVM,以及通过KVM安装CentOS系统

Centos6.7_KVM安装配置使用

KVM安装配置CentOS7开机网卡自动变为eth0

CentOS 6.5下安装KVM

CentOS 6.5下安装KVM