1
2
3
4
|
英语原文:
https:
//help
.ubuntu.com
/community/KVM/Installation
|
1.先检查cpu是否支持ardware virtualization,返回0表示不支持
1
|
egrep
-c
'(vmx|svm)'
/proc/cpuinfo
|
2.检查是否支持upports kvm,需要安装工具pu-checker
1
|
sudo
apt-get
install
cpu-checker
|
3.执行检测命令
1
|
kvm-ok
|
返回
1
2
3
4
|
cpu支持
"INFO: Your CPU supports KVM extensions
INFO:
/dev/kvm
exists
KVM acceleration can be used"
|
1
2
3
4
5
|
cpu不支持需要到bios中设置VT开启状态
"INFO: KVM is disabled by your BIOS
HINT: Enter your BIOS setup and
enable
Virtualization Technology (VT),
and
then
hard poweroff
/poweron
your system
KVM acceleration can NOT be used"
|
开始安装kvm
1
|
sudo
apt-get
install
qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
|
安装成功之后重启.
添加用户到kvm,libvirtd组
1
2
|
sudo
adduser your_user_name kvm
sudo
adduser your_user_name libvirtd
|
安装验证:
1
|
sudo
virsh -c qemu:
///system
list
|
安装成功出现如下命令
1
2
|
Id Name State
----------------------------------
|
通过命令启动虚拟机
1
|
<SDK directory>
/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!