Friday, September 20, 2019

Install and Configure KVM on CentOS 7

Check Virtualization Technology (VT) is enabled in the BIOS:

# lscpu | grep Virtualization
Virtualization:        VT-x
Install KVM and other software:

# yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install

Start and enable the service:

# systemctl enable libvirtd
# systemctl start libvirtd
Configure bridge network: consider using openvswitch (search in this blog) Create VM:

virt-install \
--virt-type=kvm \
--name centos7 \
--ram 4096 \
--vcpus=2 \
--os-variant=centos7.0 \
--cdrom=/var/lib/libvirt/boot/CentOS-7-x86_64-Minimal-1908.iso \
--network=bridge=ovs-br0,model=virtio \
--network=bridge=ovs-br1,model=virtio \
--graphics vnc \
--disk path=/var/lib/libvirt/images/centos7-min.qcow2,size=20,bus=virtio,format=qcow2
This will create a VM with two network interface.

No comments:

Post a Comment