android - 使用 Azure Windows 10 运行 Android 模拟器

标签 android azure virtual-machine emulation

我尝试在运行 Windows、Windows 10 Pro 版本 1809 的 Azure VM 上运行 Android 模拟器 - 但在运行 Android 模拟器时收到以下错误消息:

C:\Program Files (x86)\Android\android-sdk\emulator>emulator -AVD androidemulatorapi28 emulator: ERROR: x86 emulation currently requires hardware acceleration! Please ensure the Windows Hypervisor Platform (WHPX) is properly installed and usable. CPU acceleration status: HAXM is not installed on this machine

hyper-v 已启用:

enter image description here

还有 Windows Hypervisor 平台:

enter image description here

VM 的大小为 D2_v3,Dv3 系列应该支持嵌套虚拟化。 Here , herehere是关于它是这样的以及 android 模拟器功能的声明。据我所知:

enter image description here

...是 Dv3 系列的一部分。

可能是什么问题?

<小时/>

我能够在 Azure Windows VM 的 Hyper-V 中运行 Ubuntu VM。

禁用 Hyper-VWindows Hypervisor Platform、安装 HAXM 并运行我收到此错误:

enter image description here

据本文作者medium article和这个 StackOverflow discussion - OpenGL 的特殊自定义实现是必要的 - 因为特定的 azure VM 大小不附带 GPU。然而,按照本文的步骤,我遇到了另一种类型的崩溃 - 当使用作者 Github 存储库中的 Mesa3D+LLvmpip 版本的 opengl32.dll 时,替换 system32 中的 OpenGL 文件并运行 android 模拟器:

enter image description here

<小时/>

我发现有一个gihub repo - 分发 Mesa3D 和 LLvmpip - 下载 mesa3d-19.1.3-release-mingw.exe并运行cmd文件:

enter image description here

cmd中出现如下信息:

This deployment utility targets systems without working GPUs and any use case where hardware-accelerated OpenGL is not available. This mainly covers virtual machines in cloud environments and RDP connections. It can be used to replace Microsoft Windows inbox OpenGL 1.1 software render driver with Mesa3D soft pipe, llvmpipe or SWR driver.

...这似乎适合驱动程序渲染问题。

<小时/>

我能够通过-avd myandroidemulatorapi28以及任何带有以下两个标志-gpu angle_indirect-gpu的命令摆脱所有cmd警告和错误swiftshader_indirect。并在运行之前设置 QEMU_AUDIO_DRV=none 。有关驾驶​​问题的 GUI 消息仍然出现,并且出现黑屏

根据 mesa-dist-win GitHub 存储库的所有者的说法 - 当使用他的机器模拟虚拟机的状态时,他可以重现 GUI 消息潜水员的投诉,并且仍然成功运行模拟器。

最佳答案

注意:这不是一个解决方案,这是为了分享我在尝试了大约 10-20 种方法后学到的细节:

  • 要在 Azure VDI 中启用虚拟化,您需要启用 Hyper-V 功能。
  • 之后,您可以在任务管理器 -> 性能中看到虚拟化设置为 true
  • 如果没有,请尝试从命令提示符启用它。 bcdedit/set hypervisorlaunchtype auto

  • 启用虚拟化后。

  • 现在,您将无法安装英特尔 HAXM,因为 Hyper-V 和英特尔 HAXM 之间存在虚拟化竞争条件。
  • 因此,如果没有英特尔 HAXM,AVD 将无法运行。

  • 如果不启用 Hyper-V 虚拟化,AVD 中只会出现黑屏,并且无法启动。

所以,我相信这个问题到目前为止还没有解决方案,我已经在google、stackoverflow上搜索了所有内容。如果有人找到解决方案,请将其发布到此处。

关于android - 使用 Azure Windows 10 运行 Android 模拟器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57240664/

相关文章:

java - 根据 maven android 构建配置文件更新应用程序名称和 Logo

azure - 哪些 CosmosDb 操作会导致 Azure 函数触发?

Azure Powershell - 跨 EA 中的多个订阅

python - 使用 Python 的 Azure Blob 存储,创建容器但不列出它们?

azure - 对 Azure VM 的 Keyvault 访问进行故障排除

wifi - 在哪里安装设备驱动才能让docker识别设备?

android - 我如何使用 ViewPager 之类的 Android VIew 动画进行翻转屏幕

android - 让 Linux 在运行 WinCE 的汽车音响设备上运行

javascript - Phonegap/Cordova 暂停事件在 android 的恢复上触发;结果无法关闭音频

docker - 为什么构建Docker容器镜像的第一步将基本镜像作为源,在我看来它本身就是像ALPINE这样的操作系统?