Optional prefixes: [g]oogle, [m]ap  
[w]ikipedia, [snopes]  

home » about linux » windows for linux » windows virtualisation » kvm » step 1: installing kvm

Step 1: Installing KVM

Table of Contents

Step 1: Check CPU supports KVM

# egrep '^flags.*(vmx|svm)' /proc/cpuinfo 

If nothing is displayed, then you do not have a CPU that supports KVM. If lines are output that include the text "vmx" then you have an Intel CPU that supports KVM, if "svm" then an AMD CPU that supports KVM.


top

Step 2: Check Kernel

In order to run KVM you must be running 2.6.20 or higher. You can check this by running the following command:

# uname -r
2.6.26-1-686


top

Step 3: Install Prerequisites

# aptitude install gcc-3.4 libsdl1.2-dev zlib1g-dev libasound2-dev linux-kernel-headers pkg-config libgnutls-dev


top

Step 4: Install KVM

Make sure that you have Backports installed if you are running Etch.

# aptitude install kvm qemu

You need QEMU in order to create disk images.


top

Step 5: Add User to KVM

# adduser $USER kvm


top

Step 6: Load KVM Modules

Decide whether you have an Intel or AMD CPU (see Step 1).

# modprobe kvm
# modprobe kvm-intel or kvm-amd (depending on CPU type)

If this fails then try

# dmesg | grep kvm

If it states "kvm disabled in BIOS" then you will need to boot into the BIOS and switch on VT support (probably under advanced processor options).

You can check that the modules are enabled by running:

# lsmod | grep kvm


top

Step 7: Set KVM modules to autoload

Add the modules to /etc/modules to ensure that they load upon the next reboot.

# echo "kvm" >> /etc/modules
# echo "kvm-intel" >> /etc/modules


top

Next Steps


top

References

Share

top