Choose the right kvm & kernel version: Difference between revisions

From KVM
m (typo in category name)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Three Components ==
== Three Components ==


To make it work, you need to get the right version for three components:
A functional KVM system consists of three main components:


* Linux Module
* Linux Module
* User Space Application
* User Space Application
* Guest Virtio Driver  
* Guest Virtio Driver


== Linux Module ==
== Linux Module ==


KVM requires a linux kernel module to support full virtualization. The linux module consists of three files: kvm.ko, kvm_intel.ko (for Intel processors), kvm_amd.ko (for AMD processors). You can install these modules just like you install drivers for your video card. The good news is, you may not need to install anything - the 2.6.20 kernel version (and higher) includes these kernel modules as part of the mainline kernel.  It will depend on your distribution configuration whether these modules are actually in the distribution kernel as a built-in or provided as modules (or possibly absent). Here is a table listing the relation of KVM module versions to mainline kernel releases:                                                                  
KVM requires a few kernel modules in order to support full virtualization. Most distributions contain these modules by default, but they may need to be loaded manually. You can check if the KVM module is currently loaded with:


* 2.6.20 kvm-12
lsmod | grep kvm
* 2.6.21 kvm-17
* 2.6.22 kvm-22


If you are not sure your linux distribution contain it or not, use this command:
If the module is not loaded, simply issue:
 
modprobe -l | grep kvm
 
The linux module can be built from source code. This is also the recommended way to get the right version of linux module. Compiling from the source code, and than make install should make the linux module inserted into your /lib/modules/linux-`uname -r`. Simply make it in use by:
 
modprobe kvm
modprobe kvm_intel
 
or


  modprobe kvm
  modprobe kvm
modprobe kvm_amd


=== User space application ===
You may also need to load the appropriate module for your processor:


Compile from source code, you can get it. Otherwise, refer to the previous section.
modprobe kvm_intel  # Intel processors
modprobe kvm_amd    # AMD processors


=== Guest virtio driver ===
=== Guest virtio driver ===


There was no special requirement for guest operating system if you are not using para-visualized disk ornetwork adapter. If you are using them, make sure you get virtio_pci.ko, virtio_rng.ko, virtio_blk.ko, virtio_net.ko. They are in 2.6.25 or later kernel. There is also a option to backport them.
Generally, there are no special requirements for the guest operating system. If you are using para-virtualized disks or network adapters however, make sure you have loaded the virtio_pci.ko, virtio_rng.ko, virtio_blk.ko, and virtio_net.ko modules (available since kernel version 2.6.25).


Refer to [[Virtio]] for more information
Refer to [[Virtio]] for more information


[[Category:Architecture]][[Category:Docs]][[Category:Historical]][[Category:HowTo]]
[[Category:Architecture]][[Category:Docs]][[Category:Historical]][[Category:HowTo]]

Latest revision as of 23:19, 19 January 2017

Three Components

A functional KVM system consists of three main components:

  • Linux Module
  • User Space Application
  • Guest Virtio Driver

Linux Module

KVM requires a few kernel modules in order to support full virtualization. Most distributions contain these modules by default, but they may need to be loaded manually. You can check if the KVM module is currently loaded with:

lsmod | grep kvm

If the module is not loaded, simply issue:

modprobe kvm

You may also need to load the appropriate module for your processor:

modprobe kvm_intel  # Intel processors
modprobe kvm_amd    # AMD processors

Guest virtio driver

Generally, there are no special requirements for the guest operating system. If you are using para-virtualized disks or network adapters however, make sure you have loaded the virtio_pci.ko, virtio_rng.ko, virtio_blk.ko, and virtio_net.ko modules (available since kernel version 2.6.25).

Refer to Virtio for more information