Configure Kernel Based Virtual Machine (KVM) on RHEL 7 or CentOS 7 | Install & Configure KVM in RHEL



Configure Kernel Based Virtual Machine (KVM) on RHEL 7 or CentOS 7 | Install & Configure KVM in RHEL

Configure Kernel Based Virtual Machine (KVM) on RHEL 7 or CentOS 7 | Install & Configure KVM in RHEL

KVM:
——-
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). It consists of a loadable kernel module, kvm.ko, that provides the core virtualization infrastructure and a processor specific module, kvm-intel.ko or kvm-amd.ko.

Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.

KVM is open source software. The kernel component of KVM is included in mainline Linux, as of 2.6.20. The userspace component of KVM is included in mainline QEMU, as of 1.3.

How does KVM work:
—————————-
KVM converts Linux into a type-1 (bare-metal) hypervisor. All hypervisors need some operating system-level components—such as a memory manager, process scheduler, input/output (I/O) stack, device drivers, security manager, a network stack, and more—to run VMs. KVM has all these components because it’s part of the Linux kernel. Every VM is implemented as a regular Linux process, scheduled by the standard Linux scheduler, with dedicated virtual hardware like a network card, graphics adapter, CPU(s), memory, and disks.

Install KVM in CentOS 7:
——————————
# setenforce 0

# uname -a

# cat /etc/CentOS-release

# grep -E ‘svm|vmx’ /proc/cpuinfo

# yum repolist
watch this video to configure it in RHEL 7:
https://youtu.be/-N09WSCNcso

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

# systemctl start libvirtd

# systemctl status libvirtd

# ifconfig

# vim /etc/sysconfig/network-scripts/ifcfg-ens33
#IPADDR
#NETMASK
#GATEWAY
BRIDGE=virbr0

# cp -p /etc/sysconfig/network-scripts/ifcfg-ens033 /etc/sysconfig/network-scripts/ifcfg-virbr0

# vim /etc/sysconfig/network-scripts/ifcfg-virbr0
TYPE=BRIDGE
IPADDR
NETMASK
GATEWAY
DEVICE=virbr0

# ll /usr/lib/sysctl.d/60-libvirtd.conf

# rpm -qf /usr/lib/sysctl.d/60-libvirtd.conf

# vim /usr/lib/sysctl.d/60-libvirtd.conf
net.ipv4.ip_forward = 1

# /sbin/sysctl -w /usr/lib/sysctl.d/60-libvirtd.conf

# /sbin/sysctl -p /usr/lib/sysctl.d/60-libvirtd.conf

# ifconfig virbr0

# virsh net-edit default
192.168.1.140
dhcp range 192.168.1.200 192.168.1.254

# vim /etc/sysconfig/network-scripts/route-virbr0
192.168.1.0/24 via 192.168.1.140 dev virbr0

# init 6

# systemctl status libvirtd

# ifconfig -a

# osinfo-query os | more

# osinfo-query os | grep -i centos

# df -hT

# ll /tmp/CentOS-7-x86_64-DVD-1708.iso

# chmod 775 /tmp/CentOS-7-x86_64-DVD-1708.iso

# ll /kvm

# virt-install –name KVMac –description “CENTOS7 for KVMac” –os-type=Linux –os-variant=centos7.0 –ram=1024 –vcpus=1 –disk path=/kvm/KVMac.img,bus=virtio,size=10 –graphics none –console pty,target_type=serial –location /tmp/CentOS-7-x86_64-DVD-1708.iso –network bridge:virbr0 –extra-args console=ttyS0

# virsh list –all

# virsh dominfo KVMac

# virsh shutdown KVMac

# virsh console KVMac

# virsh console KVMac

# virsh list –all

# virsh start KVMac

# virsh console KVMac

# virsh list

# virsh list –all

# virt-clone –connect qemu:///system –original KVMac –name vm3 -f /kvm/KVMac2.img

# virsh list –all

# virsh start KVMac2

# virsh console KVMac2

# ifconfig

# nslookup 8.8.8.8

# netstat -nr

You are done.
================
Thanks for watching the video. Please like our videos, share with your friends and feel free to ask anything, post your queries in comments section. We will be glad to answer your queries. Don’t forget to subscribe the channel & turn on the bell notifications.
===============
Our Some Popular Videos:

NAVIC:
https://www.youtube.com/watch?v=QoyQbmU2kg4

Learn Linux Fundamentals:
https://www.youtube.com/watch?v=9pqvIqIF_KI

Concept of All RAID Levels:
https://www.youtube.com/watch?v=VRx0copTNr8

Configure RAID-0 in Linux:
https://www.youtube.com/watch?v=5tTHGbSqSKA

Configure RAID-1 in Linux:
https://www.youtube.com/watch?v=x12pMJpGGmw

Configure RAID-5 in Linux:
https://www.youtube.com/watch?v=Cj-je1RUJgo

Configure RAID-6 in Linux:
https://www.youtube.com/watch?v=qeKLlrZ5fLg

Configure RAID-10 in Linux:
https://www.youtube.com/watch?v=DLVGj_Mu1DA

LVM Snapshot:
https://www.youtube.com/watch?v=CJJwbnFuM5A
====================================================
Contact Us:

To Follow Vikas Nehra’s Twitter Handle:👇
http://bit.ly/VikasNehraTwitterHandle

For Registration:👇
http://bit.ly/NehraClassesRegForm

To Follow Our Twitter Handle:👇
http://bit.ly/NehraClassesTwiiterHandle

To Visit Our Facebook Page:👇
www.facebook.com/nehraclasses

Join Us on Telegram App: 👇
https://t.me/NehraClasses

WhatsApp Us: 👇
https://bit.ly/2Kpqp5z

Email Us:👇
Email: [email protected]
============
©COPYRIGHT. ALL RIGHTS RESERVED

#NehraClasses #LinuxTraining #KVM

Comments are closed.