How To Install KVM On CentOS7
Kernel Based Virtualization (KVM) is virtualization application for Linux (like VMware, Virtual Box etc). KVM has the ability to run multiple gust operating systems like windows, Linux, UNIX, Solaris etc. with the help of hardware virtualization extensions.
KVM work only if CPU supports hardware virtualization. We can manage KVM through command line as well as GUI tool Virtual Manager. Below steps will help you for installing KVM.
Note – All commands tested on CentOS 7
Step 1 – Checking CPU compatibility for virtualization
# egrep ‘(vmx|svm)’ /proc/cpuinfo |
If above commands returns no output then your CPU not supporting KVM virtualization.
If you got output showing vmx then you can virtualize hardware using KVM.
Step 2 – Bridge network
For Network Bridging check this tutorial CentOS7 Network Bridging.
Step 3 – KVM installation
# yum install kvm libvirt python-virtinst qemu-kvm virt-manager qemu-system-x86_64 |
Step 4 - After installing packages start “libvirtd” service (starting KVM).
# systemctl start libvirtd.service |
Check KVM status using
# systemctl status libvirtd.service |
Step 5 – To check if KVM has successfully been installed
# virsh –c qemu:///system list |
Shows output like this
Id Name State
---------------------------------------------------------
|
So you successfully install KVM on your server. Now you can install gust operating system on KVM through command line or through GUI (virt-manager).
Install gust operating system through “virt-manager”
Step 1 - login to CentOS 7 gnome desktop and click on
Application --> systemtools --> Virtual Machine Manager
|
Step 2 – To create new virtual machine click on
File --> New Virtual Machine |
Or
Right click on localhost (QEMU) and click on “new”
|
Step 3 – New wizard open for creating virtual machine.
Step 3.1
Enter virtual machine name (You can enter any name)
Choose how to install operating system, here I choose
“Local install media(ISO image or CDROM) ”
|
You can install operating system through another source also like
- Network install (HTTP, FTP or NFS)
- Network Boot (PXE)
- Import existing disk image
Enter details and click on “Forward
Step 3.2 –
Enter ISO location
Choose operating system type and version
|
Enter details and click on “Forward”
Step 3.3 –
Configure CPU and Memory |
Step 3.4 – Next step is to assign storage for virtual machine
Enter the amount of disk space you want and don’t forget to uncheck
“Allocate entire disk now” otherwise it will use enter hard disk space for virtual machine.
|
Click “Forward”
Step 3.5 – Shows summery of your virtual machine configuration and one advance option.
Advance is for selecting network to communicate outside virtual machine.
Select bridged network interface (eg – br0) and click on Finish button. |
Step 3.6 – KVM will start creating virtual machine as per your inputs. Once it finishes creating vm, virtual manager will start OS installation console.
If you want to change VM configurations after creating virtual machine click on “bulb” icon.
Note – You can’t able to make any vm configuration changes if the gust OS is running. |
Any doubts or suggestion feel free to comments. "Subscribe | Comment | Share"
0 comments:
Post a Comment