英语原文: https://help.ubuntu.com/community/KVM/Installation
1.先检查cpu是否支持ardware virtualization,返回0表示不支持
egrep -c '(vmx|svm)' /proc/cpuinfo
2.检查是否支持upports kvm,需要安装工具pu-checker
sudo apt-get install cpu-checker
3.执行检测命令
kvm-ok
返回
cpu支持"INFO: Your CPU supports KVM extensionsINFO: /dev/kvm existsKVM acceleration can be used"
cpu不支持需要到bios中设置VT开启状态"INFO: KVM is disabled by your BIOSHINT: Enter your BIOS setup and enable Virtualization Technology (VT),and then hard poweroff/poweron your systemKVM acceleration can NOT be used"
开始安装kvm
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
安装成功之后重启.
添加用户到kvm,libvirtd组
sudo adduser your_user_name kvmsudo adduser your_user_name libvirtd
安装验证:
sudo virsh -c qemu:///system list
安装成功出现如下命令
Id Name State----------------------------------
通过命令启动虚拟机
/tools/emulator-x86 -avd Your_AVD_Name -qemu -m 2047 -enable-kvm
通过avd manager启动
Run > Run Configurations>Target>Additional Emulator Command Line Options
添加启动参数
-qemu -m 2047 -enable-kvm
over!