{"id":36254,"date":"2022-06-28T14:42:10","date_gmt":"2022-06-28T06:42:10","guid":{"rendered":"https:\/\/www.casbay.com\/blog\/?p=36254"},"modified":"2022-09-22T17:19:34","modified_gmt":"2022-09-22T09:19:34","slug":"dive-into-the-kvm-hypervisor","status":"publish","type":"post","link":"https:\/\/www.casbay.com\/blog\/vps-hosting\/dive-into-the-kvm-hypervisor","title":{"rendered":"Dive into the KVM hypervisor"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"36254\" class=\"elementor elementor-36254\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-d7a38d5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d7a38d5\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7f4813e\" data-id=\"7f4813e\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7e81347 elementor-widget elementor-widget-image\" data-id=\"7e81347\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"325\" src=\"https:\/\/www.casbay.com\/blog\/wp-content\/uploads\/2022\/06\/Dive-into-the-KVM-hypervisor-1024x325.png\" class=\"attachment-large size-large wp-image-36256\" alt=\"KVM\" srcset=\"https:\/\/www.casbay.com\/blog\/wp-content\/uploads\/2022\/06\/Dive-into-the-KVM-hypervisor-1024x325.png 1024w, https:\/\/www.casbay.com\/blog\/wp-content\/uploads\/2022\/06\/Dive-into-the-KVM-hypervisor-300x95.png 300w, https:\/\/www.casbay.com\/blog\/wp-content\/uploads\/2022\/06\/Dive-into-the-KVM-hypervisor-768x244.png 768w, https:\/\/www.casbay.com\/blog\/wp-content\/uploads\/2022\/06\/Dive-into-the-KVM-hypervisor.png 1266w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-168abd8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"168abd8\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-92ff282\" data-id=\"92ff282\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-e53edfc elementor-widget elementor-widget-text-editor\" data-id=\"e53edfc\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>The Kernel-based Virtual Machine (KVM)\u00a0could be a\u00a0full native virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT or AMD-V). Limited support for paravirtualization\u00a0is additionally\u00a0available for Linux and Windows guests\u00a0within the\u00a0kind of\u00a0a paravirtual network driver.<\/p><p>KVM is currently designed to interface with the kernel via a loadable kernel module. software system\u00a0versions supported include\u00a0a large\u00a0style of\u00a0guest operating systems like Linux, BSD, Solaris, Windows, Haiku, ReactOS, and AROS Research\u00a0package. A patched version of KVM (qemu)\u00a0is in a position\u00a0to run on Mac OS X.<\/p><p>In the KVM architecture, the virtual machine is implemented as regular Linux process, scheduled by\u00a0the quality\u00a0Linux scheduler. In fact, each virtual CPU appears as\u00a0an everyday\u00a0Linux process.\u00a0this permits\u00a0KVM\u00a0to learn\u00a0from all the features of the Linux kernel.<br \/><br \/>Device emulation is handle by a modified version of qemu\u00a0that has\u00a0an emulated BIOS, PCI bus, USB bus, and\u00a0a typical\u00a0set of devices\u00a0like\u00a0IDE and SCSI disk controllers, network cards, etc.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-9c9ed86 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9c9ed86\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-77fbe90\" data-id=\"77fbe90\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9b5a150 elementor-widget elementor-widget-text-editor\" data-id=\"9b5a150\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Security\u00a0<\/h2><p>Since a virtual machine is implemented as a Linux process, it leverages\u00a0the quality\u00a0Linux security model\u00a0to supply\u00a0isolation and resource controls. The Linux kernel uses SELinux (Security-Enhanced Linux)\u00a0to feature\u00a0mandatory access controls, multi-level and multi-category security, and to handle policy enforcement. SELinux provides strict resource isolation and confinement for processes running\u00a0within the\u00a0Linux kernel.<br \/><br \/>The SVirt project \u2014 a community effort attempting to integrate Mandatory Access Control (MAC) security and Linux-based virtualization (KVM) \u2014 builds on SELinux\u00a0to supply\u00a0an infrastructure\u00a0to permit\u00a0an administrator to define policies for virtual machine isolation. Out of the box, SVirt ensures that a virtual machines resources\u00a0can not be\u00a0accessed by\u00a0the other\u00a0process (or virtual machine);\u00a0this will\u00a0be extended by the sysadmin to define fine-grained permissions;\u00a0for instance, to group virtual machines together to share resources.<\/p><p>\u00a0<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-4158744 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4158744\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ec4ad85\" data-id=\"ec4ad85\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-040092d elementor-widget elementor-widget-text-editor\" data-id=\"040092d\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Memory\u00a0<\/h2><div id=\"move\" class=\"container\"><div class=\"row after_result\"><div class=\"col-md-6 p-md-0 px-sm-3 px-1\"><div id=\"rewrite_output\" class=\"text-here p-3 bgchange\"><div class=\"form-group mb-0 px-2 py-3 bg-white text_right_cont change2 noborder\"><div class=\"output px-2 change2\"><span id=\"preview\">KVM inherits powerful memory management features from Linux. The memory of a virtual machine is stored\u00a0the identical\u00a0as memory is for\u00a0the other\u00a0Linux process\u00a0and might\u00a0be swapped, backed by large pages for better performance, shared, or backed by a\u00a0computer file. NUMA support (Non-Uniform\u00a0access, memory design for multiprocessors) allows virtual machines to efficiently access large amounts of memory.<br \/><br \/>KVM supports\u00a0the most recent\u00a0memory virtualization features from CPU vendors with support for Intel&#8217;s Extended Page Table (EPT) and AMD&#8217;s Rapid Virtualization Indexing (RVI) to deliver reduced CPU utilization\u00a0and better\u00a0throughput.<br \/><br \/>Memory page sharing is supported through a kernel feature called Kernel Same-page Merging (KSM). KSM scans the memory\u00a0of every\u00a0virtual machine and where virtual machines have identical memory pages, KSM merges these into\u00a0one\u00a0page that it shares between the virtual machines, storing only\u00a0one\u00a0copy. If a guest attempts\u00a0to vary\u00a0this shared page,\u00a0it&#8217;ll\u00a0tend\u00a0its own private copy.<\/span><\/div><\/div><\/div><\/div><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-5c84e22 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5c84e22\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-30ce6a2\" data-id=\"30ce6a2\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-344508f elementor-widget elementor-widget-text-editor\" data-id=\"344508f\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Storage<\/h2><div id=\"move\" class=\"container\"><div class=\"row after_result\"><div class=\"col-md-6 p-md-0 px-sm-3 px-1\"><div id=\"rewrite_output\" class=\"text-here p-3 bgchange\"><div class=\"form-group mb-0 px-2 py-3 bg-white text_right_cont change2 noborder\"><div class=\"output px-2 change2\"><p><span id=\"preview\">KVM\u00a0is ready\u00a0to use any storage supported by Linux to store virtual machine images, including local disks with IDE, SCSI and SATA, Network Attached Storage (NAS) including NFS and SAMBA\/CIFS, or SAN with support for iSCSI and Fibre Channel. Multipath I\/O\u00a0is also\u00a0wont to\u00a0improve storage throughput and\u00a0to produce\u00a0redundancy.<\/span><\/p><p>Again, because KVM\u00a0is an element\u00a0of the Linux kernel, it can leverage a proven and reliable storage infrastructure with support from all leading storage vendors; its storage stack\u00a0contains a\u00a0proven record in production deployments.<\/p><p>KVM also supports virtual machine images on shared file systems like the world filing system (GFS2) to permit virtual machine images to be shared between multiple hosts or shared using logical volumes. Disk images support thin provisioning allowing improved storage utilization by only allocating storage when it&#8217;s required by the virtual machine instead of allocating the whole storage upfront. The native disk format for KVM is QCOW2 which has support for snapshots allowing multiple levels of snapshots, compression, and encryption.<\/p><\/div><\/div><\/div><\/div><\/div><\/div>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0361965 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0361965\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-884333d\" data-id=\"884333d\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cceb524 elementor-widget elementor-widget-text-editor\" data-id=\"cceb524\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<h2>Choosing KVM\u00a0<\/h2><ul><li>Although KVM is a relative newcomer to hypervisors, this lightweight module that comes with the mainline Linux kernel offers the simplicity of its implementation plus continued support of Linux heavyweights.<\/li><li>KVM is flexible; since the guest operating systems are communicating to a hypervisor that is integrated into the Linux kernel, they can address hardware directly in all cases without the need to modify the virtualized operating system. This makes KVM a faster solution for virtual machines.<\/li><li>Patches to the KVM are compatible with the Linux kernel. KVM is implemented in the Linux kernel itself; consequently, that makes it easier to control virtualization processes.<\/li><\/ul>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-2eb7ff2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"2eb7ff2\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e5e174a\" data-id=\"e5e174a\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-f2950d1 elementor-widget elementor-widget-text-editor\" data-id=\"f2950d1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Deploying KVM is rather complex, full of individual configuration considerations, so for more information, please see\u00a0<a href=\"https:\/\/www.casbay.com\/blog\/\">Related topics<\/a>.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>The Kernel-based Virtual Machine (KVM)\u00a0could be a\u00a0full native virtualization solution for Linux on x86 hardware containing virtualization extensions (Intel VT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"footnotes":"","_wpscppro_custom_social_share_image":0},"categories":[94],"tags":[102],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/posts\/36254"}],"collection":[{"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/comments?post=36254"}],"version-history":[{"count":4,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/posts\/36254\/revisions"}],"predecessor-version":[{"id":36311,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/posts\/36254\/revisions\/36311"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/media?parent=36254"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/categories?post=36254"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.casbay.com\/blog\/wp-json\/wp\/v2\/tags?post=36254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}