Check that your CPU supports hardware virtualization
To run KVM, you need a processor that supports hardware virtualization. Intel and AMD both have developed extensions for their processors, deemed respectively Intel VT-x (code name Vanderpool) and AMD-V (code name Pacifica). To see if your processor supports one of these, you can review the output from this command:
egrep -c '(vmx|svm)' /proc/cpuinfo
If 0 it means that your CPU doesn't support hardware virtualization.
If 1 or more it does - but you still need to make sure that virtualization is enabled in the BIOS.
sudo apt-get install cpu-checker
which may provide an output like this:
INFO: /dev/kvm exists
KVM acceleration can be used
If you see :
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used
You can still run virtual machines, but it'll be much slower without the KVM extensions.
NOTE: You may see a message like "KVM acceleration can/can NOT be used". This is misleading and only means if KVM is *currently* available (i.e. "turned on"), *not* if it is supported.
4 Install Necessary Packages
For the following setup, we will assume that you are deploying KVM on a server, and therefore do not have any X server on the machine.
You need to install a few packages first:
Lucid (10.04) or later
$ sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
Karmic (9.10) or earlier
$ sudo aptitude install kvm libvirt-bin ubuntu-vm-builder bridge-utils
libvirt-bin provides libvirtd which you need to administer qemu and kvm instances using libvirt
qemu-kvm (kvm in Karmic and earlier) is the backend
ubuntu-vm-builder powerful command line tool for building virtual machines
bridge-utils provides a bridge from your network to the virtual machines
You might also want to install virt-viewer, for viewing instances.
sudo adduser your_user_name kvm sudo adduser your_user_name libvirtd
sudo virsh -c qemu:///system list
Id Name State
<SDK directory>/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm
7 通过avd manager启动
Run > Run Configurations>Target>Additional Emulator Command Line Options
-qemu -m 2047 -enable-kvm