SlideShare a Scribd company logo
Create Virtual Machines in Linux Using KVM
Virtualization packages are means for users to run various operating systems without
“bare metal” hardware are basically, you can run more than one operating system on a
single computer without dual-booting or similar approaches .Virtualization software
emulates a real machine and “fools” the guestoperating system into thinking it’s running
on a real computer.Besides the more obvious advantages,virtual machines help create a
greener and easier to administer computing environment.Looking at the trends in the IT
industry, virtualization has a seen quite a boom in the last few years, because it fits the
conceptof utility computing and/orsoftware as a service . Virtualization can be useful to
you if you are an enterprise architect, developer, a home userorbasically everything in
between.We will begin with the shortintroduction aboutthe virtualization in general,then
we will specifically treat KVM as they seem to be mostpopularopen source full virtualization
solutions. Here we start aboutthe KVM process in detail.
KVM Features
There are manyuseful features and advantages which you will gain when you use KVM to
deployyour virtual platform. KVM hypervisor supports following features:
1. Over-committing : Which means allocating more virtualized CPUs or memorythan
the available resources on the system.
2. Thin provisioning : Which allows the allocation of flexible storage and optimizes the
available space for every guestvirtual machine.
3. Disk I/O throttling : Provides the ability to set a limit on disk I/O requests sentfrom
virtual machines to the hostmachine.
4. Automatic NUMA balancing :Improves the performance ofapplications running on
NUMA hardware systems.
5. Virtual CPU hot add capability : Provides the ability to increase processing poweras
needed on running virtual machines,without downtime.
Make sure that your system has the hardware virtualization extensions:ForIntel-based
hosts, verify the CPU virtualization extension [vmx] are available using following command.
[root@localhost~]# grep -e ‘vmx’/proc/cpuinfo
ForAMD-based hosts,verify the CPU virtualization extension [svm] are available.
[root@localhost~]# grep -e ‘svm’/proc/cpuinfo
If there is no outputmake sure that virtualization extensions is enabled in BIOS. Verify that
KVM modules are loaded in the kernel“it should be loaded bydefault”.
[root@localhost~]# lsmod | grep kvm
[root@localhost ~]# lsmod | grep kvm
Kvm_intel 147785 0
Kvm 464964 1 kvm_intel
Before starting , you will need the rootaccountor non-rootuser with sudo privileges
configured on your system and also make sure that your system is up-to-date.
[root@localhost~]# yum update
Forthis, Selinux must be in Permissive mode.
[root@localhost~]# setenforce 0
Step 1: KVM Installation and Deployment
1 We will install qemu-kvm and qemu-img packages atfirst. These packages provide the
user-level KVM and disk image manager.
[root@localhost~]# yum installqemu-kvm qemu-img
2 Now, you have the minimum requirementto deployvirtual platform on your host, butwe
also still have useful tools to administrate ourplatform such as:
1. virt-manager provides a GUI tool to administrate your virtual machines.
2. libvirt-client provides a CL tool to administrate your virtual environmentthis tool
called virsh.
3. virt-install provides the command “virt-install” to create your virtual machines from
CLI.
4. libvirt provides the server and hostside libraries for interacting with hypervisors and
hostsystems.
Let’s install these above tools using the following command.
[root@localhost~]# yum installvirt-manager libvert libvert-phython libvert-client
3 For RHEL/CentOS7 users,also still having additional package groups such as:
Virtualization Client, Virtualization Platform and Virtualization Tools to install
[root@localhost~]# yum groupinstall virtualization-client virtualization-platform
virtualization-tools
4 The virtualization daemon which manage allof the platform is “libvirtd”. lets restart it.
[root@localhost~]# systemctl restartlibvirtd
5 After restarting the daemon,then check its status by running following command
[root@localhost~]# systemctl status libvirtd
Step 2: Create VMs using KVM
As we mentioned early, we have some useful tools to manage ourvirtual platform and
creating virtual machines.One ofthis tools called [virt-manager] which we use in the next
section.
6 Although virt-manager is a GUI based tool, we also could launch/startit from terminal as
well as from GUI.
[root@localhost~]# virt-manager
Using GNOME Classic
7 After starting the tool, this window will appear.
8 By default you will find manageris connected directly to localhost, fortunately you could
use the same tool to manage anotherhostremotely. From “File” tab, just select “Add
Connection”and this windowwill appear.
Check “Connect to remote host” option then provide Hostname/IP of the remote server. If
you need establishing connection to the remote hostat every time the managerstarting, just
check “Auto Connect” option.
9 Let’s return to our localhost, before creating newvirtual machine you should decide
where will the files be stored?!in other words,you should create the Volume Disk (Virtual
disk / Disk image ) for your virtual machine.
By Right clicking on localhostand selecting “Details” and then select “Storage” tab.
Krenel Based Virtual Machine In Centos7
10 Next, press “New Volume”button, then enter the name ofyour new virtual disk (Volume
Disk) and enter the size which you want/need in the “Max Capacity” section.
The allocation size is the actual size for your disk which will be allocated immediately from
your physical disk after finishing the steps.
Note: This is an important technology in storage administration field which called “thin
provision”. It used to allocate the used storage size only, NOT all of available size.
Forexample,you created virtual disk with size 60G,but you have used actually only 20G,
using this technologythe allocated size from your physicalhard disk will be 20G not60G.
In anotherwords the allocated physical size will by dynamically allocated depending on the
actual used size.
11 You will note that a label of the newVolume Disk has been appeared in the list.
You should also notice the path of the newdisk image (Volume Disk), by default it will be
under/var/lib/libvirt/images, you can verify it using the following command.
[root@localhost Downloads]# ls –l /var/lib/libvirt/images
12 Now, we’re readyto create our virtual machine.Let’s hit the button “VM” in the main
window, this wizard windowwill be appear.
Select the installation method which you will use to create the virtual machine.Fornowwe
will use Localinstall media,later we will discuss the remaining methods.
13 Now it’s time to specify which Localinstall media to be used,we have two options:
From physical[CDROM/DVD].
From ISO image.
Let’s use ISO image method,so you should provide the path of your ISO image.
14 The storage has return back,we will use the virtual disk which we have created early to
install virtual machine on it. It will be as shown.
15 The final step which ask you aboutthe name ofyour virtual machine and another
advanced options let’s talk aboutit later.
Then click finish and wait seconds,controlconsole will appearfor your GuestOS to
manage it
Conclusion
Now you have learned whatis is KVM, Howto manage yourvirtual platform using GUI
tools, How to deployvirtual machine using it and anotherawesome things.

More Related Content

PDF
Kvm virtualization in_rhel_7
PDF
Dave Gilbert - KVM and QEMU
PDF
KVM tools and enterprise usage
PDF
Virtualization - Kernel Virtual Machine (KVM)
PPTX
ODP
Kvm and libvirt
PPTX
Drive into kvm
PDF
Vm ware server-tips-tricks
Kvm virtualization in_rhel_7
Dave Gilbert - KVM and QEMU
KVM tools and enterprise usage
Virtualization - Kernel Virtual Machine (KVM)
Kvm and libvirt
Drive into kvm
Vm ware server-tips-tricks

What's hot (19)

PDF
The kvm virtualization way
PPTX
Optimizing VM images for OpenStack with KVM/QEMU
PDF
Rmll Virtualization As Is Tool 20090707 V1.0
PPT
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
PDF
S4 xen hypervisor_20080622
PDF
Virtualization with KVM (Kernel-based Virtual Machine)
ODP
PDF
Build a private cloud – prototype and test with open nebula
PDF
OpenNebula 4.14 Hands-on Tutorial
ODP
Building (localized) Vagrant boxes with Packer
PDF
QEMU Disk IO Which performs Better: Native or threads?
PPTX
RHEVM - Live Storage Migration
PDF
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
PDF
Kvm performance optimization for ubuntu
PDF
OpenNebulaConf 2016 - Hypervisors and Containers Hands-on Workshop by Jaime M...
PDF
Automated Amazon EC2 Cloud deployments with openQRM
ODP
open source virtualization
PDF
Installation vm
PDF
Domino9on centos6
The kvm virtualization way
Optimizing VM images for OpenStack with KVM/QEMU
Rmll Virtualization As Is Tool 20090707 V1.0
LOAD BALANCING OF APPLICATIONS USING XEN HYPERVISOR
S4 xen hypervisor_20080622
Virtualization with KVM (Kernel-based Virtual Machine)
Build a private cloud – prototype and test with open nebula
OpenNebula 4.14 Hands-on Tutorial
Building (localized) Vagrant boxes with Packer
QEMU Disk IO Which performs Better: Native or threads?
RHEVM - Live Storage Migration
OpenNebulaConf 2016 - Building a GNU/Linux Distribution by Daniel Dehennin, M...
Kvm performance optimization for ubuntu
OpenNebulaConf 2016 - Hypervisors and Containers Hands-on Workshop by Jaime M...
Automated Amazon EC2 Cloud deployments with openQRM
open source virtualization
Installation vm
Domino9on centos6
Ad

Viewers also liked (11)

PPTX
Building a fundable open source company
PDF
Thank you
DOCX
PPTX
What makes media social
PPT
Hectalys m
PPTX
Fabiana e Yasmin Cristine
PDF
Norton R928 lamellrondeller - Broschyr
PDF
Clipping Catering 01/12/11 @ IED Barcelona
DOCX
Trabajo compu
TXT
Slash 2010 album
PDF
DOC190416-19042016070345 (1)
Building a fundable open source company
Thank you
What makes media social
Hectalys m
Fabiana e Yasmin Cristine
Norton R928 lamellrondeller - Broschyr
Clipping Catering 01/12/11 @ IED Barcelona
Trabajo compu
Slash 2010 album
DOC190416-19042016070345 (1)
Ad

Similar to Krenel Based Virtual Machine In Centos7 (20)

PDF
Comando kvm terminal
PDF
Running virtual box from the linux command line
PPTX
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
ODP
Open Source Virtualization Hacks
PPT
Free tools for win server administration
PDF
How to Install KVM (Kernel-based Virtual Machine) on Debian 12
PDF
Building your own Desktop Cloud Environment
PDF
Startup guide for kvm on cent os 6
PPTX
Virtual technology
PPT
Lessons On Hyper V
PPTX
Virtualization
PPT
Virtualizing Testbeds For Fun And Profit
PPTX
Install MariaDB on IBM i - Tips, troubleshooting, and more
PDF
Gluster Storage Platform Installation Guide
PDF
Howto Pxeboot
PDF
Ws90 using
PPTX
Vagrant and chef
PPTX
Creating a gallery image for Azure marketplace
PDF
Ws80 using VMware
Comando kvm terminal
Running virtual box from the linux command line
Virtualization technology "comparison vmware 9 vs virtualbox 4.2"
Open Source Virtualization Hacks
Free tools for win server administration
How to Install KVM (Kernel-based Virtual Machine) on Debian 12
Building your own Desktop Cloud Environment
Startup guide for kvm on cent os 6
Virtual technology
Lessons On Hyper V
Virtualization
Virtualizing Testbeds For Fun And Profit
Install MariaDB on IBM i - Tips, troubleshooting, and more
Gluster Storage Platform Installation Guide
Howto Pxeboot
Ws90 using
Vagrant and chef
Creating a gallery image for Azure marketplace
Ws80 using VMware

Recently uploaded (20)

PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Approach and Philosophy of On baking technology
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Understanding_Digital_Forensics_Presentation.pptx
Approach and Philosophy of On baking technology
Spectral efficient network and resource selection model in 5G networks
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
NewMind AI Weekly Chronicles - August'25 Week I
Mobile App Security Testing_ A Comprehensive Guide.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
Programs and apps: productivity, graphics, security and other tools
Encapsulation_ Review paper, used for researhc scholars
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Reach Out and Touch Someone: Haptics and Empathic Computing
MIND Revenue Release Quarter 2 2025 Press Release
The Rise and Fall of 3GPP – Time for a Sabbatical?
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton

Krenel Based Virtual Machine In Centos7

  • 1. Create Virtual Machines in Linux Using KVM Virtualization packages are means for users to run various operating systems without “bare metal” hardware are basically, you can run more than one operating system on a single computer without dual-booting or similar approaches .Virtualization software emulates a real machine and “fools” the guestoperating system into thinking it’s running on a real computer.Besides the more obvious advantages,virtual machines help create a greener and easier to administer computing environment.Looking at the trends in the IT industry, virtualization has a seen quite a boom in the last few years, because it fits the conceptof utility computing and/orsoftware as a service . Virtualization can be useful to you if you are an enterprise architect, developer, a home userorbasically everything in between.We will begin with the shortintroduction aboutthe virtualization in general,then we will specifically treat KVM as they seem to be mostpopularopen source full virtualization solutions. Here we start aboutthe KVM process in detail.
  • 2. KVM Features There are manyuseful features and advantages which you will gain when you use KVM to deployyour virtual platform. KVM hypervisor supports following features: 1. Over-committing : Which means allocating more virtualized CPUs or memorythan the available resources on the system. 2. Thin provisioning : Which allows the allocation of flexible storage and optimizes the available space for every guestvirtual machine. 3. Disk I/O throttling : Provides the ability to set a limit on disk I/O requests sentfrom virtual machines to the hostmachine. 4. Automatic NUMA balancing :Improves the performance ofapplications running on NUMA hardware systems. 5. Virtual CPU hot add capability : Provides the ability to increase processing poweras needed on running virtual machines,without downtime. Make sure that your system has the hardware virtualization extensions:ForIntel-based hosts, verify the CPU virtualization extension [vmx] are available using following command. [root@localhost~]# grep -e ‘vmx’/proc/cpuinfo ForAMD-based hosts,verify the CPU virtualization extension [svm] are available. [root@localhost~]# grep -e ‘svm’/proc/cpuinfo
  • 3. If there is no outputmake sure that virtualization extensions is enabled in BIOS. Verify that KVM modules are loaded in the kernel“it should be loaded bydefault”. [root@localhost~]# lsmod | grep kvm [root@localhost ~]# lsmod | grep kvm Kvm_intel 147785 0 Kvm 464964 1 kvm_intel Before starting , you will need the rootaccountor non-rootuser with sudo privileges configured on your system and also make sure that your system is up-to-date. [root@localhost~]# yum update Forthis, Selinux must be in Permissive mode. [root@localhost~]# setenforce 0 Step 1: KVM Installation and Deployment 1 We will install qemu-kvm and qemu-img packages atfirst. These packages provide the user-level KVM and disk image manager. [root@localhost~]# yum installqemu-kvm qemu-img 2 Now, you have the minimum requirementto deployvirtual platform on your host, butwe also still have useful tools to administrate ourplatform such as: 1. virt-manager provides a GUI tool to administrate your virtual machines.
  • 4. 2. libvirt-client provides a CL tool to administrate your virtual environmentthis tool called virsh. 3. virt-install provides the command “virt-install” to create your virtual machines from CLI. 4. libvirt provides the server and hostside libraries for interacting with hypervisors and hostsystems. Let’s install these above tools using the following command. [root@localhost~]# yum installvirt-manager libvert libvert-phython libvert-client 3 For RHEL/CentOS7 users,also still having additional package groups such as: Virtualization Client, Virtualization Platform and Virtualization Tools to install [root@localhost~]# yum groupinstall virtualization-client virtualization-platform virtualization-tools 4 The virtualization daemon which manage allof the platform is “libvirtd”. lets restart it. [root@localhost~]# systemctl restartlibvirtd 5 After restarting the daemon,then check its status by running following command [root@localhost~]# systemctl status libvirtd
  • 5. Step 2: Create VMs using KVM As we mentioned early, we have some useful tools to manage ourvirtual platform and creating virtual machines.One ofthis tools called [virt-manager] which we use in the next section. 6 Although virt-manager is a GUI based tool, we also could launch/startit from terminal as well as from GUI. [root@localhost~]# virt-manager
  • 6. Using GNOME Classic 7 After starting the tool, this window will appear.
  • 7. 8 By default you will find manageris connected directly to localhost, fortunately you could use the same tool to manage anotherhostremotely. From “File” tab, just select “Add Connection”and this windowwill appear. Check “Connect to remote host” option then provide Hostname/IP of the remote server. If you need establishing connection to the remote hostat every time the managerstarting, just check “Auto Connect” option. 9 Let’s return to our localhost, before creating newvirtual machine you should decide where will the files be stored?!in other words,you should create the Volume Disk (Virtual disk / Disk image ) for your virtual machine. By Right clicking on localhostand selecting “Details” and then select “Storage” tab.
  • 9. 10 Next, press “New Volume”button, then enter the name ofyour new virtual disk (Volume Disk) and enter the size which you want/need in the “Max Capacity” section. The allocation size is the actual size for your disk which will be allocated immediately from your physical disk after finishing the steps. Note: This is an important technology in storage administration field which called “thin provision”. It used to allocate the used storage size only, NOT all of available size. Forexample,you created virtual disk with size 60G,but you have used actually only 20G, using this technologythe allocated size from your physicalhard disk will be 20G not60G. In anotherwords the allocated physical size will by dynamically allocated depending on the actual used size.
  • 10. 11 You will note that a label of the newVolume Disk has been appeared in the list. You should also notice the path of the newdisk image (Volume Disk), by default it will be under/var/lib/libvirt/images, you can verify it using the following command. [root@localhost Downloads]# ls –l /var/lib/libvirt/images 12 Now, we’re readyto create our virtual machine.Let’s hit the button “VM” in the main window, this wizard windowwill be appear.
  • 11. Select the installation method which you will use to create the virtual machine.Fornowwe will use Localinstall media,later we will discuss the remaining methods. 13 Now it’s time to specify which Localinstall media to be used,we have two options: From physical[CDROM/DVD]. From ISO image.
  • 12. Let’s use ISO image method,so you should provide the path of your ISO image. 14 The storage has return back,we will use the virtual disk which we have created early to install virtual machine on it. It will be as shown.
  • 13. 15 The final step which ask you aboutthe name ofyour virtual machine and another advanced options let’s talk aboutit later. Then click finish and wait seconds,controlconsole will appearfor your GuestOS to manage it
  • 14. Conclusion Now you have learned whatis is KVM, Howto manage yourvirtual platform using GUI tools, How to deployvirtual machine using it and anotherawesome things.