Android studio 在VMware虚拟机上运行的Android Studio:未安装KVM
我在Ubuntu VMWare虚拟机上运行Android Studio。问题是,当我尝试使用AVD emulator运行应用程序时,控制台中会出现以下错误:Android studio 在VMware虚拟机上运行的Android Studio:未安装KVM,android-studio,android-emulator,vmware,kvm,Android Studio,Android Emulator,Vmware,Kvm,我在Ubuntu VMWare虚拟机上运行Android Studio。问题是,当我尝试使用AVD emulator运行应用程序时,控制台中会出现以下错误: /home/verite/Android/Sdk/tools/emulator -avd Nexus_5_API_22_x86 -netspeed full -netdelay none emulator: ERROR: x86 emulation currently requires hardware acceleration! Plea
/home/verite/Android/Sdk/tools/emulator -avd Nexus_5_API_22_x86 -netspeed full -netdelay none
emulator: ERROR: x86 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).
我试图通过以下方式解决问题:
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm
并重新启动,但不起作用。当我发出命令时:
sudo kvm-ok
我明白了
有人能告诉我怎么解决这个问题吗
感谢安卓开发者官方网站上的坏消息:
不在虚拟机内-您不能在虚拟机内运行虚拟机加速仿真器
另一个虚拟机,如VirtualBox或VMWare托管的虚拟机
机器。您必须直接在系统硬件上运行模拟器
因此,我的最佳选择似乎是寻找一款与Android Studio兼容的真正设备来运行这些应用程序。我也遇到了同样的问题。我搜索了一下,找到了现在可以使用的解决方案: 在VMware中:
此链接帮助我找到了解决方案。您让vCenter和vSphere Web客户端使用此链接编辑VMs配置右键单击您的Windows来宾操作系统>编辑设置>CPU>复选框“向来宾操作系统公开硬件辅助虚拟化”
.在云虚拟机(AWS windows服务器)上安装Android 由于我的机器在Android Studio中运行缓慢,我在AWS上的windows server上创建了一个虚拟机,该虚拟机具有最佳的处理器和RAM配置,这给了我无缝的编程和执行体验。但要使用模拟器,我会面临下面列出的错误
Error:
Unable to install Intel HAXM
HAXM doesn't support nested virtual machines.
Unfortunately, the Android Emulator can't support virtual machine acceleration from within a virtual machine.
Here are some of your options:
1) Use a physical device for testing
2) Start the emulator on a non-virtualized operating system
3) Use an Android Virtual Device based on an ARM system image (This is 10x slower than hardware accelerated virtualization)
由于我们无法将设备连接到云计算机器,因此选择#3是最好的选择
一旦安卓studio安装完毕
Go to Tools -> Android -> AVD Manager
Click "Create Virtual Device"
Select which device you want to use from the list (i.e Nexus 5) and click "Next".
Here you're given a list of android release versions. Look at the ABI column.
Choose "Armeabi-v7a" for whichever API Level you want.
Hit "Next" and modify name/size, click "Finish" when done.
if 'Next' doesn't work, download the desired image and continue
我在VMWare guest中运行了android模拟器。它使用的是Windows而不是Linux,但原则适用。如前所述,最大的问题是确保检查虚拟化的VMWare处理器设置 以下是我的具体情况: 我正在为主机和来宾运行Win10。 我有Android studio和Android模拟器在一个VMWare客户机中运行,该客户机使用VMWare的player软件运行
Here are the versions:
Windows 10 64 bit both host and guest.
Windows 10 guest Ram 6 Gig
Android studio 3.3.2
AVD Emulator
VMWare Player 12, 12.5.1 build-4542065
VMware Number of Processors: 1
VMWare Setting for Processors: Virtualize Intel VT checked.
我在云虚拟机中运行AVD时遇到了完全相同的错误,添加许可证解决了这个问题 因此,VMWare任何云提供商都不会为您提供创建嵌套虚拟机的能力。它在默认情况下被阻止,因此Android studio可以工作,但您将无法运行AVD,这没有多大用处 要允许这样做,您需要在创建VM时添加以下许可证-
https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx
注意:这仅适用于GCP,您需要为VMWare添加不同的许可证
这只是你将要做的事情和涉及的主要步骤的一小部分,然而,我强烈建议你阅读我的博客,它提供了一个循序渐进的指南
我还敦促您检查我的回答,我在这里为GCP详细解释了这一点。您的回答非常有用。您能提供参考的确切链接吗?现在我在“使用模拟器”上找不到文档“该答案自2019年起不再适用。Android开发者网站不再提及任何虚拟机限制。@MeirCohen我在2019年12月仍然看到了这一限制:@Mickeel的确,你是对的。我甚至不确定它是否在你看到它之前就消失了,然后又回来了,或者我当时只是错过了它=\谢谢你的回答,但是你能解释一下,为什么只从列表中选择“Armeabi-v7a”??
https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx