Run Android studio virtual device in AZURE VM - android

I'm trying to deploy a virtual device in android studio with AZURE D3 VM series.
I have already disabled Hyper-V in System features and I tried different methods too.
Any chance to remove these errors related to Android Studio Virtual Device Launching??
VM SYSTEM INFO
Errors
nested virtualization details
https://www.thewindowsclub.com/enable-or-disable-nested-virtualization-for-vms-in-hyper-v

Related

Run Android Emulators from windows in a Hyper-V virtual machine

The Set Up
I have a personal (gaming) Windows 10 Pro PC and I want to use it for some home development work without loading up the gaming side with extra installs. Win10 Pro allows you to create virtual machines using Hyper-V and the Hyper-V Manager.
I used the quick start to create a Win11 Dev environment. When I logged in I downloaded and installed Visual Studio 2022 community, and Myql Workbench. I have a MySql Server on a separate box on my network and the Win11 VM can connect to it.
There is a program I wrote using VS2022 and Ximiran to learn Mobile App development and thar is what I want to work on again. It was written on a regular Dev box where I could launch android emulators and/or connect my mobile device to test.
I tried setting up the Android ADM with the standard emulator (Pixel 5 API 30), a more generic 6.7dpi (API 32) and while I was able to DL and install them, they failed.
The Issue
I did read many google and SO entries and I saw that the emulators would not work in Virtual Box, but I did not see anything with hyper-v. I did changes the windows features to use hyper-v, windows hypervisor, and set up the SDK > tools > Extras > intel x86 ... (HAXM accelerator).
When I start either emulator I get an error then when boiled down says "ERROR | x86-64 emulation currently requires hardware acceleration." ... "Android Emulator requires an intel processor with VT-x and NX support. (VT-x is not supported).
The Question
Is this just a situation where no matter what I try this combination of a PC running a VM running an Emulator will just not work?
If it can, what piece am I missing?
The VM knows I have a Intel(R) Core(TM) i7-4970K CPU # 4.00GHz and this is a 64bit OS. This also has a GeForce RTX 3060 gpu which the VM does not see.
Any thoughts would be welcomed. I would like to keep my two environments separate and though I can code almost anything else, I would like to work on my android app in VS2022.
(I may try plugging in my mobile device...hmmmm)

Develop Android Xamarian app on Visual Studio 2019 in Windows Server 2019 Virtual Machine running on Windows Server 2016 AMD Server

I am an experienced C# ASP .NET Developer trying to develop an Android app in Visual Studio 2019 for the First Time. My Visual Studio is installed in a Virtual Machine running Windows Server 2019. This Virtual Machine is running on an AMD processor based server, Host Operating System is Windows Server 2016.
I created the basic/default Xamarian project in visual studio. When I try to run it I get error that I do not have Intel processor and hardware acceleration is disabled. I can click "Continue". Then it tries to run the Emulator and get error message
Turn on "Windows Hypervisor Platform" feature to switch to the Native
Hypervisor and accelerate your emulator.
Since I am already in a VM cannot Turn On Hyper-V. I can, however, click "Run anyway" button. But get another error :- Emulator Error
Device error: WARNING: unexpected '-prop' value
('monodroid.avdname=pixel_2_pie_9_0_-_api_28'), only 'qemu.'
properties are supported WARNING: unexpected '-prop' value
('emu.uuid=0e874e5d-5d0e-4aa9-8f60-0c351dc95185'), only 'qemu.'
properties are supported
Google search revels Android Emulator cannot be run on a Hyper-V Virtual Machine. In my development environment/settings, Is there a way to develop Android App in Visual Studio 2019 running in a Hyper-V VM?
You can't run a VM-accelerated emulator inside another VM, such as a VM hosted by VirtualBox, VMware, or Docker (unless using WSL2). You must run the Android emulator directly on your system hardware
For information about launching and debugging with the Android emulator, see Debugging on the Android Emulator

How do I Run Android in a Windows VM in Virtual Box?

I have a Windows PC with an AMD CPU in which I run VMM Virtual Box with a Windows VM in which I need to launch an AVD from Android Studio.
I don't need an Android VM to run in Virtual Box, Android must run in a nested virtual environment, inside a Windows VM in which the AVD runs.
Since I know that from Virtual Box version 6.1 there's the possibility to have nested virtualization I thought that just enabling it in the system settings would have been enough, but in facts when launching the AVD it just creates the smartphone silhouette, with a black screen which doesn't respond to any input. Here's how it looks
Starting the AVD these two issues comes out, does anyone know how can I solve these? Error 1
Error 2
I need these two level of emulation because I need a repeatable environment to test my software along with Android. Does Anyone have suggestion?
PS: the AVD works fine in the host Windows OS, it's just the guest OS that seem unable to launch the android environment.
I know that it's not at all a good way of testing and performance are really bad, but what I need is a repeatable environment for the validation phase of a thesis. My code is a Java program that use Appium to connect my application to AVD; since I can't configure the Appium server, the AVD and my configuration parameter in each tester's machine, I'd like to use a VM to be run once per computer.

How to emulate Android with Xamarin in an Azure VM?

I've been struggling to have my Xamarin project running in an Azure VM with Visual Studio 2015 and Xamarin. The error it gives me is:
The Virtual Machine Management Service failed to start the virtual machine 'VS Emulator 5-inch KitKat (4.4) XXHDPI Phone.dawud' because one of the Hyper-V components is not running (Virtual machine ID <id_number>.
I have read I need to enable nested virtualization in Hyper-V, but as this is an Azure machine I don't think I can do it.
Do you know what else I can do?
Thanks.

Is there any way, that I can make Android Emulator run on Azure Virtual Machine?

I installed Android Studio on Azure VM and installed all the prerequisites. When I try to run the emulator, I get the following error
When I try to install HAXM, I get the following error:
I checked that my Azure VM runs on AMD Processor. Is there any way, that I can make Android Emulator run on Azure Virtual Machine?
Something that requires virtualization isn't going to run in an Azure VM (which is already virtualized). Same thing with, say, WP8 emulator (see this question, with the same answer).
EDIT - As of mid-2017, there are now VMs that support nested virtualization (Dv3 and Ev3 series, for now). See this post for more information.
The Android emulator works with the following setup:
Azure VM: Windows 10 Enterprise N
Android Studio: 2.3.1
AVD Manager
Hardware: Phone -> Nexus 5X
System Image: Other Images -> Nougat 25 armeabi-v7a [Android 7.1.1]
Start the emulator and wait about 5-10 minutes for the process to complete.
Then run your Android app by attaching it to the running emulator.
Note that "Apply Changes" (lightning bolt icon) also works for small code changes.
If you set the CPU of the emulator to armeabi-v7a it will work (albeit very very slowly). Tested with Rev 25. I assume this works because it doesn't use virtualization, but rather CPU Emulation.
As of mid-2017, there are now VMs that support nested virtualization (Dv3 and Ev3 series, for now). Still, I couldn't run the Android virtual device(AVD) created in the android studio. But, below solution worked for me:
Check if Azure VM supports nested virtualization.
Enable hyper-v in VM as mentioned here 1.
Use Visual Studio Emulator. Visual studio emulator definitely works on azure VM.
Forget about enabling nested virtualization or else.
All you have to do is:
Disable Hyper-V
Install Mumu emulator.
And you'll see emulator working on your VM.

Categories

Resources