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.
Related
We are working remotely on client's virtual machine. I keep getting the VT-X/disabling hyper-V error even after doing the needful.
So, my question is , is it possible to run emulator, which is itself a VM on another VM?
If not, suggest a way to work around this problem.
Thanks in advance
is it possible to run android emulator on client's virtual machine?
I think the problem is not you are working remotely on client's virtual machine, the problem is that your Physical machines turn on the Windows feature : Hyper-V, but when you run an Android Emulator, it needs to disabling the Hyper-V, so it gives the VT-X/disabling hyper-V error.
I have test working remotely on client's virtual machine and turn on the Hyper-V. When I run an Android emulator from Android Studio, it failed and gives me the error message :
To solve this problem, you should turn off your hyper-v and restart the computer. If you cant do this, you could try using Visual Studio Emulator for Android. As the document said :
with Hyper-V compatibility you can run the emulator side-by-side with the Windows Phone Emulator and other Hyper-V VMs
Then, you could run the Android emulator.
I don't know about what happens in a VM.
But, emulator is not possible in nested VM. I found that out while installing android studio when I got the error message explaining the same.
Regarding working emulator with VM, we can go with #Grace Feng
I have a question that looks quite complicated. I need to setup a complete development environment for Android in a virtual machine. I mean, create a virtual machine (player is Virtualbox last version) with Windows 8.1 as guest os.
In this vm, I installed Android Studio which works quite well. My problem is in running any android virtual device. I know I can't run x86 based emulator because I can't disable hyper-v, but I read somewhere that is should be possible to run arm based emulator (even if they are very slower). In fact, I can create and start an emulator, but it stuck with a blank screen, nothing happens and, of course, I can't deploy any application.
My question is:
1. Is it possible to run an AVD in a virtual machine?
2. My virtual machine has a memory of 2GB, maybe this isn't enough for running the AVD?
Thank you in advance
Im using Xamarin in VS2015 on windows 10 to build a cross platform app.
And im using VmWare's VMPlayer to run a virtual instance of OS X to run the iOS emulator. VmPlayer doesn't work with Hyper-V turned ON and the Android Emulator doesnt work with Hyper-V turned OFF.
I was wondering if there is a work around that will allow both the VMplayer and the Android emulator to run at the same time without having to go back and forth turning Hyper-V on and off?
You can run the Visual Studio Android Emulator in vmWare (if you virtualize Windows):
The VM must have at least 2 CPUs assigned
Change the OS type of the VM to "Hyper-V (unsupported)” in the VM's general setting
This step was not required for me in vmWare 8: In Windows, edit the c:\program files (x86)\Microsoft XDE\10.0.10240.0\skus\android\xdesku.xml file and remove the following line from the file: GuestDisplayProvider=”VsEmulator.OpenGLGuestDisplay
If your Windows machine is a physical machine, you can run the VS Android Emulator directly there.
I start an x86 Android VM via the Visual Studio Emulator for Android.
If I look at the Hyper-V Manager, I see that the VM is started. I can actually connect to it via Hyper-V, and it loads and works perfectly.
But the emulator (the thing that looks like a phone) is still stuck at "OS is starting..." It doesn't get farther than that, even though the VM is fully loaded!
How do I fix this?
(It's not one of the typical virtual switch problems, as like I say, the VM loads in Hyper-V Manager.)
I highly suspect this is a configuration issue, possibly inside VS. Android Studio provides a more proper way to create a simulator through a very simple wizard. I suggest you use it to create and launch the emulator, VS will detect it as a device and you will be able to launch it directly from there -no config needed-
A way nicer emulator though is Genymotion. It runs as an Oracle VirtualBox virtual machine and is way faster than Google's native emulator
I used the nuclear option: delete switches, delete VMs, uninstall emulator, uninstall Hyper-V, reboot, reinstall HV, reinstall emulator, ensure firewall rules are not blocking it, reboot. Then run emulator again to recreate switches.
Now I have other problems, but this problem is gone. This is a very brittle product.
I have been running Android Studio 1.5.1 doing development on a WMWare copy of Windows 2012 R2 and everything works fine. I've been able to run the device emulator with no problems and start various versions of Android running in AVD.
Android Studio 2.x Change
I recently installed Android Studio 2.0 (see image below for exact version).
Now when I attempt to run the emulator nothing happens.
Well, actually I do see a message in the status bar of Studio when I attempt to start the device, but then that message disappears and nothing happens after that.
There is a warning that I need to turn off Hyper-V (see image below), but I don't believe that is possible since this is a VM.
No Longer Possible?
Is it not possible to run the emulator on the VM any more?
More recent versions of the Android Emulator require hardware virtualization support (Intel HAXM).
Unfortunately, most virtual machines do not provide HAXM instructions to the guest (a VM within a VM), so you will be unable to use the emulator within the virtual machine.
I just installed Android Studio 2.1 on my Windows 2008 R2 VM (running VMWare) and I'm happy to report that it is possible to run ARM based AVD (Android Virtual Devices) on the VM.
Steps To Run Arm-based Virtual Device on VMWare
Go to location where you've installed the Android SDKs (in my case it is at %appdata%\Android2\SDK\
If you are in the right place you should see a directory structure and directories like the ones shown in the first image below.
Start the AVD.exe by double-clicking it.
You will see a window like the one in the image below
Take a close look and notice that this is running an ARM(armeabi-v71) image. When you download images you have to download ARM-based images. (no x86 images will work on VM).
Also, you cannot start these images from AVD that launches from Android Studio 2.x
Make sure you have an environment variable named ANDROID_SDK_HOME set to path which is similar to the one at the top of the AVD manager (in image).
Once you do all of this and start an ARM-based image on a VMWare VM it will warn you that it is faster with HAXM but at least the image will run.
Finally, you can see if you attempt to launch your Virtual Device from the AVD Manager in Android Studio then it will warn you that Hyper-V needs to be turned off. Of course you cannot turn Hyper-V off on a VM.
EDIT -- Running Android 7 ARM Image
#mcflysoft asked about running an android 7 ARM image. At first I didn't think it worked, but if you open up your SDK manager and install the exact ARM OS image shown in the following picture, it will run on a Windows VM:
ARM image Containing Google APIs
I tried installing the ARM image that contained the Google APIs and that one would not ever start. There were failures logged which I could see in c:\> adb shell logcat.
Beware : It Is Really Slow
However, running Android 7 seems extremely slow and I don't see a web browser.
Not sure how helpful it may be to you, but you can get it working.
Good luck.
The simplest solution I've found so far is to use a device farm, for example Samsung's device farm:
https://developer.samsung.com/remotetestlab/galaxy/rtlDeviceList.action#444
It's free to use and you can deploy your apps just like in an emulator (Right Click -> Test -> Remote Debug Bridge -> follow the instructions).
And since those are real devices, the speed might be even better than on an emulator on your personal PC.
I've had the same problem so I'll post an answer in the hope that someone might find this useful in the future. I can run Android Studio in my VM but when I try to start up an emulator, I can't download an image due to "Your CPU does not support required features (VT-x or SVM)"
Although I didn't get a virtual device up and running, I got round the problem by using BlueStacks. You install BlueStacks on the VM. BlueStacks (at the moment) runs Android 7.1.1, SDK 25. Inside BlueStacks, go to Settings/Preferences and Enable Android Debugger Bridge (adb) following this set of instructions. Then you should be able to run your app on BlueStacks from inside Android Studio. Logcat can see any log statements from BlueStacks.
The alternative (without enabling the debugger bridge) is to locate the .apk file for your app and then open that with BlueStacks APK installer. Logcat still sees the traces.
It's slow on a VM. You also have to set android:testOnly="false" in your XML file