Difference between revisions of "KVM"

From Funtoo Linux
Jump to: navigation, search
(User-space tools)
Line 3: Line 3:
  
  
 +
 +
KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later.
 +
 +
== Kernel Setup ==
 +
 +
To enable KVM, the following kernel config parameters should be enabled (this is based on a 3.x kernel):
 +
 +
Under <tt>Processor type and features</tt>, enable <tt>Paravirtualized Guest Support</tt>. Under the <tt>Paravirtualized Guest Support</tt> menu, enable any options related to KVM, such as <tt>KVM paravirtualized clock</tt> and in particular <tt>KVM Guest Support</tt>.
 +
 +
Under the <tt>Virtualization</tt> category from the main kernel config menu, enable <tt>Kernel-based Virtual Machine (KVM) support</tt>, and enable at least one type of KVM, either for Intel or AMD processors. It is also recommended to enable <tt>Host kernel acceleration for virtio net</tt>.
 +
 +
You can use modules or build these parts directly into the kernel. Build your new kernel and modules, and reboot.
  
 
== User-space tools ==
 
== User-space tools ==
Line 12: Line 24:
 
QEMU_USER_TARGETS="i386 x86_64"
 
QEMU_USER_TARGETS="i386 x86_64"
 
</pre>
 
</pre>
 +
 +
Once the <tt>make.conf</tt> variables above are set, emerge qemu-kvm:
  
 
<console>
 
<console>

Revision as of 02:57, 29 April 2012

Kernel Setup

KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later.

Kernel Setup

To enable KVM, the following kernel config parameters should be enabled (this is based on a 3.x kernel):

Under Processor type and features, enable Paravirtualized Guest Support. Under the Paravirtualized Guest Support menu, enable any options related to KVM, such as KVM paravirtualized clock and in particular KVM Guest Support.

Under the Virtualization category from the main kernel config menu, enable Kernel-based Virtual Machine (KVM) support, and enable at least one type of KVM, either for Intel or AMD processors. It is also recommended to enable Host kernel acceleration for virtio net.

You can use modules or build these parts directly into the kernel. Build your new kernel and modules, and reboot.

User-space tools

KVM is essentially a kernel-accelerated version of QEMU. To enable KVM support in the user-space tools, add the following lines to /etc/make.conf:

QEMU_SOFTMMU_TARGETS="i386 x86_64"
QEMU_USER_TARGETS="i386 x86_64"

Once the make.conf variables above are set, emerge qemu-kvm:

#  emerge qemu-kvm

KVM setup docs can be found here:

http://www.linux-kvm.org/page/KvmOnGentoo

#  qemu-img create -f qcow2 vdisk.qcow2 10
#  qemu-system-x86_64 vdisk.qcow2 -m 1024 -cdrom systemrescuecd.iso  -net nic -net user
Personal tools
Namespaces

Variants
Actions
Categories
Toolbox
Stuff