GICT knowledge base
Simple steps to install KVM in Linux
Published
In this tutorial we can learn how to install KVM in Linux
KVM stands for kernel based virtual machine. KVM is an open source hardware virtualization software, so we can install KVM free of charge. We can create and run multiple Linux and Windows based operating systems on KVM. The KVM module loaded into the current kernel will change our Linux machine to the hypervisor. We can manage KVM by using command line or available graphical tools. Generally virtual machine manager is the most widely used graphical tool for managing KVM virtual machines.
Features of KVM
1) KVM supports all OS.
2) Low cost.
3)Open source.
4) Swap space is supported.
5) KVM virtualization provides a true VMisolation.
Installation
Before starting installation, we need to check our systems CPU supports Hardware virtualization.
Execute the following command on the console:
# grep -E ‘(vmx|svm)’ /proc/cpuinfo
We should get the result whether vmx or svm, in case the result is different, your Systems CPU doesn’t support the Hardware virtualization.
1) Run the following command to install KVM and its dependency packages.
# yum install qemu-kvm qemu-img virt-manager libvirt libvirt-python libvirt-client virt-install virt-viewer bridge-utils
2) Start and enable libvirtd service.
# systemctl start libvirtd
# systemctl enable libvirtd
3) We can check whether KVM module is loaded or not, by executing the following command.
# lsmod | grep kvm
kvm_intel 162153 0
kvm 5254409 1 kvm_intel
Creating Virtual Machines
Once you have installed KVM, you can create multiple virtual machines on it. We can create virtual machines in both command line and graphical mode (virtual machine manager). Here we are using virt-install command to create virtual machines using command line. At the time of creating virtual machine we need to specify CPU, Memory, disk, network…etc.
# virt-install –name=itzgeekguest –ram=1024 –vcpus=1 –cdrom=/tmp/CentOS-6.5-x86_64-minimal.iso –os-type=linux –os-variant=rhel6 –network bridge=br0 –graphics=spice –disk path=/var/lib/libvirt/images/itzgeekguest.dsk,size=4
Where,
name – Name of virtual machine
ram – Memory
vcpus – Virtual cpu’s in numbers
cdrom – Location of the ISO image
os-type – OS type like Linux, Windows and Unix
network – Networking
graphics – Guest display settings
disk path – Location of the disk with size of 4 GB
Here we are using bridged networking “br0” for allowing virtual machines to communicate with outside network.
If you need any further assistance please contact our support department.
Related guides
Nested Virtualization for InterServer KVM Systems
We regularly review our infrastructure to ensure the highest levels of performance, stability, and security for your applications.
KVMHow to view a KVM full backup file – backup (.zst)
Understanding Your Backup File If you are restoring a full backup from my.interserver.net, you might notice the file format requires a specific setup to open.
KVMRolling back a snapshot – what is kept and what is lost
Rolling Back the Clock: How ZFS Snapshots Work on Your InterServer VPS So, you’ve just signed up for an InterServer VPS, or maybe you’re considering it.
KVMIs RDP Supported on a KVM VPS? Not preinstalled by default.
Is RDP Supported on a KVM VPS? If you are looking into signing up for an InterServer KVM VPS, you might be wondering how you’ll actually interact with your new server.
