kvm

Check out https://help.ubuntu.com/community/KVM for more updated and complete information on installing KVM on Ubuntu.

kvm is qemu plus some great kernel level stuff for VT enabled CPUs.

Some rough notes:-

How to tell if you can use kvm

Intel CPU

 grep vmx /proc/cpuinfo

However, if you have an Intel CPU it's possible that your computer manufacturer may have turned off VT in the BIOS. See below for more info.

AMD CPU

 grep svm /proc/cpuinfo

On some Gigabyte motherboards it is turned off in the BIOS if you use "Load safe defaults" (GiBy M61SME-S2 nF405 RLVSM bios < F7)

If you see something you have it, if you don't you don't.

Install it

sudo apt-get install kvm qemu

Load the modules

sudo modprobe kvm

Load Intel module

If you have an Intel CPU

sudo modprobe kvm-intel

Note if you get this when you load the module then it may mean VT is switched off in the BIOS.

$ sudo modprobe kvm-intel
FATAL: Error inserting kvm_intel (/lib/modules/2.6.20-15-generic/kernel/drivers/kvm/kvm-intel.ko): Operation not supported

Typing dmesg you may find the following at the end:-

 kvm: disabled by bios
  • IconsPage/IconTip.png You might need to enable the virtualization setting in the BIOS. Each BIOS is different and it can be difficult to find (it may be in the "Advanced" section or under "CPU" or "Security"). You may also need to power shutdown for the changes to take effect (some bios will do this automatically).

Load AMD module

If you have an AMD CPU

sudo modprobe kvm-amd

Add yourself to the group

sudo addgroup `whoami` kvm

Create a KVM disk image

This example makes a virtual disk that grows on the fly:

qemu-img create -f qcow2 virtualdisk.img 10G

Start the emulator

For example:-

 kvm -hda virtualdisk.img -cdrom cdrom.iso -m 256 -net nic -net user -soundhw all

Load the modules more permanently

Once you know it all works, edit /etc/modules and add the following two lines

kvm
kvm-intel

or

kvm
kvm-amd

kvm (last edited 2009-08-14 16:16:02 by 58)