Installation guide of KVM in linux machine

Hi Folks,

Today we are going to setup KVM in linux machine, first of all you must be want to know what the hell is KVM?

ok, let me fix it up.

KVM stands for Kernel Virtual Machine



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.
Source : Read more from source link

Now, get into Installation Part:

Checking If your system’s CPU supports hardware virtualization

First of all make sure that your Linux system’s CPU supports hardware virtualization. Launch your system terminal and run following command.
 egrep "svm|vmx" /proc/cpuinfo 
If your CPU has hardware support enabled, it should output as shown below (you  might be seeing a bit different output, just make sure you have “vmx” included ).

 flags : fpu ss ht tm pbe syscall nx rdtscp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 vmx est tm2 ssse3 vpid 
If vmx option is not available, you need to reboot your system and enable it from BIOS.

Installing KVM

Once your CPU has hardware virtualization support enabled, run following command to install KVM and its related/dependent packages.
 sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin bridge-utils 
Grab a cup of coffee and sit back relax, it should take few minutes to complete, depending on your network speed.

Enabling Bridg Networking

Frequently,  you will need to access your virtual machines from outside networks. In order to successful do this, you should have Bridging enabled in your network configuration. Launch your system terminal and backup network configuration file.
 sudo cp  /etc/network/interfaces /etc/network/interfaces-original 
Now edit your /etc/network/interfaces file in Gedit text editor by running the following command.
 sudo gedit /etc/network/interfaces 
Append following lines to this file (Make sure to replace correct IPs and gateway Information according to your own network configuration).
 # Enabing Bridge networking br0 interface

auto br0

iface br0 inet static

address 192.168.1.10

network 192.168.1.0

netmask 255.255.255.0

broadcast 192.168.1.255

gateway 192.168.1.1

dns-nameservers 8.8.8.8

bridge_ports eth0

bridge_stp off 
Reboot your system and once it is back online, run following command on your terminal to verify that Bridging has been enabled.
 ifconfig 
KVM Bridge

Launching KVM Virtualization Manager

Congratulations, our Ubuntu system is all set for creating virtual machines now. Run following command on the terminal to launch KVM virtualization manager.


 sudo virt-manager 
KVM
Click File >> “Create a new virtual machine” option to start the “New VM”  wizard.
KVM new VM

Conclusion

KVM based virtualization is a widely adopted technique due to its simplicity and ease of use. You don’t need to purchase any subscription for creating virtual machines. Create unlimited number of virtual machines using this technique and manage your infrastructure using a graphical interface.

End!

Drop your sugegstions or tricks to make it better. Comments are welcom

Comments

Popular This Time