April 3, 2017

Kernel-Based Virtual Machine - KVM running on Ubuntu 17.04

KVM - Kernel-based Virtual Machine is a hypervisor for full Virtualization software solution for Linux OS on Intel 64 or AMD 64 Hardware. KVM included Linux Kernel since Linux Kernel 2.6.20 version and its stable for handle most workloads traffict.

KVM Support :
- Virtual CPU Proccessor hot add : KVM can provides an ability to increase CPU Proccessor as needed for Virtual Machine running without downtime ( Zero Downtime)
- Disk I/O throttling : Disk of Virtual Machine have ability set a limit of I/O disk usage.
- NUMA Balancing : Performance of NUMA Hardware, improved for applications running.
- Thin Provisioning : Virtual Machine have a flexible storage allocation, size disk based on file used.
- Over-committing : Virtual machine have allocating more vCPUs and Memory than available resources on KVM Host.
There is more improvement for KVM features.

1. Install KVM Package :

KVM Package


apt-get install qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker

2. Verify Machine can be used for KVM

KVM check

$ kvm-ok
INFO: /dev/kvm exists
KVM acceleration can be used

3. Installing Virtual Manager

Virtual Manager


Installing Virtual Machine Manager using apt-get install virt-manager command. Virtual Machine Manager use to Manage KVM Virtual Machine.

4. Open VirtManager

Virtual Machine Manager

After Installting Virtual machine Manager, open search console and open Virtual Machine Manager.

5. Virtual Manager Console 


Virtual Machine Manager Console show a QEMU KVM Server.

6. Create New VM

New VM

Craeting Virtual Machine have 4 ways, via iso file, Network FTP, Network Boot (PXE) and using existing Virtual disk image.

7. New VM Disk

Virtual Machine Disk

For Virtual Disk Format, KVM have some type of virtual disk :

- raw : The raw format is a plain binary image of the disc image, and is very portable. On filesystems that support sparse files, images in this format only use the space actually used by the data recorded in them.
- cloop : Compressed Loop format, mainly used for reading Knoppix and similar live CD image formats.
- cow : Copy-on-write format, supported for historical reasons only and not available to QEMU on Windows.
- qcow : The old QEMU copy-on-write format, supported for historical reasons and superseded by qcow2.
- qcow2 : QEMU copy-on-write format with a range of special features, including the ability to take multiple snapshots, smaller images on filesystems that don't support sparse files, optional AES encryption, and optional zlib compression.
- vmdk : VMware 3 & 4, or 6 image format, for exchanging images with that product.
- vdi : VirtualBox 1.1 compatible image format, for exchanging images with VirtualBox.
- vhdx : Hyper-V compatible image format, for exchanging images with Hyper-V 2012 or later.
- vpc : Hyper-V legacy image format, for exchanging images with Virtual PC / Virtual Server / Hyper-V 2008.
source : Wikipedia

Dont miss it : MySQL Replication on Ubuntu 17.04

8. New VM Memory

Virtual Machine Memory

Adjust Virtual Machine Momory based on Host KVM Capacity.

9. VM Name
Virtual Machine Name
Fill in the Virtual Machine Name, setting Network Option for Virtual Machine :
- Private Virtual Bridge : You want to set up a private network between 2 or more virtual machines. This network won't be seen from the other virtual machines nor from the real network.
- User Networking : You don't need to access your guest from the network or from another guest.
- Public Bridge : You want to assign IP addresses to your virtual machines and make them accessible from your local network
- Nat : A NAT network will allow your guests to fully access the network, allow networking between your host and guests, but prevent the guests from being directly visible on the physical network.
source : kvm


10. Virtual Machine Ready

Virtual Machine Ready to Use

Your KVM Virtual Machine Ready to use.
Previous Post
Next Post

post written by:

0 comments: