RHEL / CentOS 6.x KVM Virtualization Installation and Configuration Guide

h‮tt‬ps://www.lautturi.com
RHEL / CentOS 6.x KVM Virtualization Installation and Configuration Guide

To install and configure KVM virtualization on Red Hat Enterprise Linux (RHEL) or CentOS 6.x, you can follow these steps:

  1. Install the required packages by running the following command:
sudo yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer
  1. Enable the libvirtd service and set it to start automatically at boot time by running the following commands:
sudo systemctl enable libvirtd
sudo systemctl start libvirtd
  1. Add your user account to the libvirt group by running the following command:
sudo usermod -a -G libvirt <username>

Replace <username> with your username.

  1. Log out and log back in for the group membership changes to take effect.

  2. Verify that KVM is working by running the following command:

virsh -c qemu:///system list

You should see an empty list of virtual machines.

  1. To create a new virtual machine, you can use the virt-install command. For example, to create a new virtual machine with 2 CPU cores, 4GB of RAM, and a 20GB disk, you can use the following command:
virt-install --name=centos7 --memory=4096 --vcpus=2 --disk path=/var/lib/libvirt/images/centos7.img,size=20 --cdrom=/path/to/centos7.iso --network bridge=br0 --graphics vnc --os-type=linux --os-variant=centos7.0 --noautoconsole

Replace centos7 with the desired name for the virtual machine, and /path/to/centos7.iso with the path to the ISO image on the host machine.

  1. Follow the prompts to complete the installation of the guest operating system.

To manage virtual machines using the graphical virt-manager tool, you can launch it from the command line or by searching for it in the application launcher.

Created Time:2017-10-30 14:27:13  Author:lautturi