VM中,无法使用X86_64模拟器

在ubuntu虚拟机中,使用X86_64架构的Android模拟器,有时候会出现如下错误:

emulator: ERROR: x86_64 emulation currently requires hardware acceleration!
Please ensure KVM is properly installed and usable.

CPU acceleration status: KVM is not installed on this machine (/dev/kvm is missing).

The err shows that the VM doesn’t have the KVM

For the problem,The solution:

1,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.

So, firstly close your VM, go to the VM Setting panel

Open Virtual machine setting.
Go to the processor.
Check the virtualize Intel VT-x/EPT or AMD-RVI option.
Click ok and run the Virtual machine, it should work fine with you.

then reboot your VM

2,Install KVM for VM

sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm

Check success or not
sudo kvm-ok

版权声明:本文为fengxingzhe001原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。