Difference between pages "Talk:Benchmarking" and "KVM"

(Difference between pages)
m (point at my benchmarking stubby commits for web infra for causes)
 
(Added hint to change rights of /dev/kvm)
 
Line 1: Line 1:
Maybe some details should be added to powertop. I never figured out how to get it work. I read it takes some times to make an average of your power consumption. Some times I run it all day long, but never get any relevant information about power usage. -- [[User:Pytony|Pytony]] ([[User talk:Pytony|talk]])
 
  
== MOAR ==
+
== Introduction ==
i have some web benchmarking stuff at [[web-server-stack]] do as you will... i suggest chopping either all or the majority from the article relocating here, and linking to here to say benchmark ur site! [[User:Threesixes|Threesixes]] ([[User talk:Threesixes|talk]]) 21:16, October 18, 2014 (UTC)
+
 
 +
KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later. It allows you to create and start hardware-accelerated virtual machines under Linux using the QEMU tools.
 +
 
 +
== 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>Linux guest support</tt>, and enable the following options:
 +
 
 +
{{kernelop|title=Processor type and features,Linux guest support|desc=
 +
--- Linux guest support
 +
[*]  Enable paravirtualization code
 +
[ ]    paravirt-ops debugging (NEW)
 +
[*]     Paravirtualization layer for spinlocks
 +
[ ]     Xen guest support (NEW)
 +
[*]  KVM Guest support (including kvmclock) (NEW)
 +
[ ]    Enable debug information for KVM Guests in debugfs (NEW)
 +
[ ]  Paravirtual steal time accounting (NEW)
 +
}}
 +
 
 +
 
 +
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>.
 +
 
 +
{{kernelop|title=Virtualization|desc=
 +
--- Virtualization
 +
<M>  Kernel-based Virtual Machine (KVM) support
 +
<M>    KVM for Intel processors support
 +
<M>    KVM for AMD processors support
 +
[*]    KVM legacy PCI device assignment support
 +
<M>  Host kernel accelerator 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 ==
 +
 
 +
If you are using QEMU on your desktop, add the following USE flag to <tt>/etc/portage/make.conf</tt>:
 +
 
 +
<pre>
 +
USE="$USE usbredir"
 +
</pre>
 +
This will enable good mouse support for QEMU on your desktop.
 +
 
 +
Now, emerge qemu:
 +
 
 +
<console>
 +
# ##i## emerge qemu
 +
</console>
 +
 
 +
==Initial Setup==
 +
 
 +
Prior to using KVM, modprobe the appropriate accelerated driver for Intel or AMD:
 +
 
 +
<console>
 +
# ##i##modprobe kvm_intel
 +
</console>
 +
 
 +
== Next Steps ==
 +
 
 +
{{fancyimportant|Before using KVM, be sure that your user account is in the <tt>kvm</tt> group. You will need to use a command such as <tt>vigr</tt> as root to do this, and then log out and log back in for this to take effect.}}
 +
 
 +
{{important|Atm the group <tt>kvm</tt> has no access to /dev/kvm. Change this with
 +
  chown root:kvm /etc/kvm
 +
chmod g+rw /etc/kvm
 +
and kvm will start like expected [https://bugs.funtoo.org/browse/FL-1626 (see bug FL-1626)] }}
 +
 
 +
For information on how to use KVM with various operating systems, see:
 +
 
 +
* [[Windows 7 Virtualization with KVM]]
 +
* [[Linux on KVM]]
 +
 
 +
[[Category:Virtualization]]
 +
[[Category:KVM]]

Revision as of 22:18, October 18, 2014

Introduction

KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later. It allows you to create and start hardware-accelerated virtual machines under Linux using the QEMU tools.

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 Linux guest support, and enable the following options:

Under Processor type and features-->Linux guest support:

--- Linux guest support
[*]   Enable paravirtualization code
[ ]     paravirt-ops debugging (NEW)
[*]     Paravirtualization layer for spinlocks
[ ]     Xen guest support (NEW)
[*]   KVM Guest support (including kvmclock) (NEW)
[ ]     Enable debug information for KVM Guests in debugfs (NEW)
[ ]   Paravirtual steal time accounting (NEW)


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.

Under Virtualization:

--- Virtualization
<M>   Kernel-based Virtual Machine (KVM) support
<M>     KVM for Intel processors support
<M>     KVM for AMD processors support
[*]     KVM legacy PCI device assignment support
<M>   Host kernel accelerator 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

If you are using QEMU on your desktop, add the following USE flag to /etc/portage/make.conf:

USE="$USE usbredir"

This will enable good mouse support for QEMU on your desktop.

Now, emerge qemu:

#  emerge qemu

Initial Setup

Prior to using KVM, modprobe the appropriate accelerated driver for Intel or AMD:

# modprobe kvm_intel

Next Steps

Important

Before using KVM, be sure that your user account is in the kvm group. You will need to use a command such as vigr as root to do this, and then log out and log back in for this to take effect.

Important

Atm the group kvm has no access to /dev/kvm. Change this with

chown root:kvm /etc/kvm
chmod g+rw /etc/kvm

and kvm will start like expected (see bug FL-1626)

For information on how to use KVM with various operating systems, see: