Genymotion on VMWare - linux

I'm on Xubuntu running with VMWare on Windows 7. I'm developing an android app' and use genymotion to run virtual android device. But from few days, when I try to run my virtual device genymotion show me this error :
(translated from French)
Impossible to run the Genymotion virtual terminal.
The Genymotion virtual terminal haven't obtained IP address.
For an unknown reason, the VirtualBox's DHCP server haven't assigned IP address to the virtual terminal. Please run VirtualBox to find a solution for the issue.
For further help, please go to :
https://cloud.genymotion.com/page/faq/#collapse-nostart
So, I followed the link and see that I should have the same IP address for the adapter and the DHCP server and explain how to modify. I change the IP of the DHCP server to be the same as the adapter. But looks like it doesn't fix the issue because the same message appear after the modification.
A friend of mine told me to download the latest version of Genymotion. I did but there's still the same issue.
For the reason why I'm on such virtual device is because I had lot of problem have a stable installation with dual boot windows/linux so I choose a virtualisation of linux instead. And I can't work on windows because it's a team work and work on windows have some conflict with work on linux.
I hope I've been understandable and excuse me for the language fault.
EDIT :
I've try creating a new virtualisation of Xubuntu and install genymotion to see if it was an update I mad or an other mistake I could have done that broke genymotion.
But the same problem appear. I think the problem come from the double virtualisation but I don't know how to fix it.

Actually I just found what my problem was (or look's like). In the settings of the virtual device, in the CD/DVD (SATA) section I choose "use ISO image file" instead of "use physical drive".
I don't know why the issue was related with the CD/DVD. But now I can run the genymotion virtual device. It's slow as hell but it work.

I also found a way to run Android Emulator on MAC (running with VMWare on Windows):
First open VirtualBox and start your Android device. Then start the same device in Genymotion.
To have a relative smooth reaction time - set video memory to 128MB and Motherboard memory to 1024MB in VirtualBox.

You cannot really do virtualisation from a virtualized guest.
You must install Genymotion on the host OS.
You can see an entry on this subject on the Genymotion FAQ here: https://cloud.genymotion.com/page/faq/#genymotion-from-virtualized-host

To run the android apps on genymotion or your device from vm, you can follow these instructions:
Install genymotion on your local os
Install arm translation app on your genymotion
Reboot genymotion
Install google play service on genymotion
Reboot again
Download & install adb wireless app from play store on genymotion
Run adb wireless then get allocated ip address that generated by
this app
Run this command on vm
adb connect <IpAddressGeneratedByAdbWireless>
enjoy!

Related

Can I run AVD on a Virtual Windows 10 Desktop

I am currently working form home for an organisation.
Is it possible to run Android Emulator via Android Studio on a Virtual Desktop which has Windows 10 installed.
Also, should I keep my specs low for the Emulator, as I have enough RAM in my VDI.
And do I need to ask the organisation to enable Virtualization in the Virtual Machine, As it may not be possible for me to do so. Or, there is no such things in Virtual Machines?
Currently, When I try to run Emulator, it just gets stuck on black screen forever and timeouts.
I have tried multiple options. But none of them works.
No, after digging in a lot.
It was Azure VDI, windows 10.
And it's not possible to run a virtual machine (Android Emulator) inside another virtual machine.
It may be possible to run in another OS.
But not on Windows which asks to enable Hyper-V.
Which won't allow installation of Intel HAXM.

APK does not install and device is unauthorized and offline

I have a device running Android 6.0.1 and I'm working with Android Studio 2.3.3 on a Mac. When I try to install/run my application (hello world) I get this message.
com.android.ddmlib.AdbCommandRejectedException: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
Error while Installing APK
I know questions like this have been asked all over this site and I have looked though most of them and followed these suggestions
Turn everything off and on a few times
Ensure USB debugging in enabled in developer settings
Stop and start the adb server
Try a different deployment target, virtual devices work fine
My current theory is that my device is not authorized either because my device is not a phone/tablet/watch, it is just a SOM and carrier board.
My only other thought is that this is caused by the device being offline.
When I am selecting a deployment target I can see my device but it says [OFFLINE] beside it and it is slightly greyed out. I don't fully understand what this means given my device is connected the same network as my Mac they can ping each other.
So my question comes down to this
What other troubleshooting can I try?
Is it relevant that my device is offline/ what does that mean/ how can I go online?
The issue was with the .img file I used when getting the OS running on my device. I reinstalled the OS and everything worked after that.

Android Studio emulator keeps freezing, crashing, and is not responding at all

I'm a starting Android development and have recently ran into some problems. I don't know whether it is my hardware or if it's Android Studio but the emulator keeps freezing or is not responding.
The first 2 days Android Studio was running fine. However, after that it cannot run my apps. I reinstalled Android Studio and it worked for one day, but now even if I reinstall it, it won't run any apps and even Android Studio itself would occasionally freeze and I will have to restart it.
The emulator either does this or does not even turn on:
it won't even respond when I click on anything on the emulator
Here is a break down of what's been happening.
Day 1: works fine.
Day 2: Android Studio freezes multiple times when I launch the emulator. Emulator unresponsive to clicks. I uninstall Android Studio thrn install it again. After reinstallation it works 100% again with the same app
Day 3: emulator unresponsive, freezes. Menu bottons such as rotate screen, back etc. unresponsive.
Day 4: same as day 3. Uninstall Android, reinstall. Unresponsive.
You can try changing this line of code System.out.println(userinput1); to Log.d(MainActivity.class.getSimpleName(), userinput1) because on emulator system.out.println() automatically redirects to logcat but sometimes not.
This problem may arise due to low ram size, android studio works fine with 8GB Ram.Or try to config emulator properly. Let me know if problem continues.
I would suggest that import just specific address of class not the whole package or as bundle.
With
import java.util.*;
all classes of java.util package is imported.
The problem might be that, your hardware might be overwhelmed.
I don't think anything is wrong with your code. What is your system configuration? Does other applications work on emulator work? Can you post you
post your logcat?
PS: I know it should have been a comment. But I don't have permissions, sorry.
Problem and solution
Same problem, unusable for serious testing, whole system locking up regularly (Linux Mint Vera | 16GB-RAM | Nvidia GP106 [GeForce GTX 1060 3GB] -- worked fine on Windows 7, exact same hardware (although hard drive config has changed slightly, might need to double-check the OS drive is connected port0 on motherboard in case of performance impact).
It's ironic that Android being Linux based, struggles to run in a Linux env xD.
Tried different:
Linux APIs
Emulator Phone Models
Phone RAM specs, processor specs, etc
( All different graphics modes (both in native A-Studio emulator and using the apt install-google-emulator option for vanilla standalone (old school) version. Old school version runs better (standalone version).
Checked all microcode updates and drivers are in order. (Using Nvidia GP106 [GeForce GTX 1060 3GB]
System is up to date (apt)
Found the best options:
Performance Better: Restart Android Emulated Device with 'Cold Boot' option specified
or
Use Diff Emulator: Virtual Machine Manager / Virsh (KVM-QEMU)
or
Use Physical Device: With Android 11+ you can wifi pair.
With devices APIs lower than 11, there is no Wi-Fi pair feature so I found solution was to install termux on the handset I wanted to use for app testing, which gave me a standardish shell with apt pkg manager -- then I could install sshd and connect to dev-PC with portforward i.e
$ SSH from Phone to PC with: ssh -R 4444:127.0.0.1:5555 ubuntu#192.168.1.20
$ SSH from PC to Phone with: ssh -L 4444:127.0.0.1:5555 ubuntu#192.168.1.20
(The exact command may vary, written from memory as quick guide to get you moving right direction thought ports are correct, syntax may need adjusting and of course, the username#hostIP needs setting to your you-login#your-computers--LAN-IP).
Once an SSH connection has been established, which you can check using something like
$ ss -tulpan | grep 4444
or
$ netstat -tulpan | grep 4444
Once confirmed established, you need to fire up adb to connect to the now available Android adb service that we forwarded from the handset into the dev-PC by running the command (also make sure you have USB debugging enabled on the handset before doing this);
On dev-PC run;
$ adb connect 127.0.0.1:4444
It should say 'CONNECTED'.
Then to double check, run:
$ adb devices
Emulator should show up in Android Studio Device Manager. Give it a few minutes and Android Studio will pick it up!
I can't remember the specific reason I needed to do it this way as opposed to just connecting with a USB cable. I think I was doing some mad routed setup. But there we have it!
I found using a physical device to be the ultimate performance solution but is of course a bulky arrangement.
Update
Increasing memory available to Android Studio and the VM made big difference (I have 16gb RAM).
Android Studio > Help > Change Memory Settings (2048 -> 4096)
Android Studio > Help > Edit Custom VM Options > add/replace-->
(-Xmx4096m
(-Xmx4096m
(Then finally added extra config to Gradle script to allow extra memory but I don't think that would have an impact on the slow running issue as was entire emulator crumbling not just the app.)
In gradle.properties, replace order.gradle.jvmargs.... (with)
org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
Finally, restart Android / Emulator and remember to do a COLD BOOT on your emulator device.

Android Studio running on VMware virtual machine: KVM is not installed

I'm running Android Studio on a Ubuntu VMWare virtual machine. The problem is that when I try to run an app with the AVD emulator I get the following errors in the console:
/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).
I've tried to solve the problem by doing this:
sudo apt-get install qemu-kvm libvirt-bin ubuntu-vm-builder bridge-utils
sudo adduser `id -un` libvirtd
sudo adduser `id -un` kvm
and restarting, but it doesn't work. When I issue the command:
sudo kvm-ok
I get
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used
Could someone tell me how to fix the problem, please?
Thanks
I faced the same problem. I searched and I found the solution it works with me now:
In VMware:
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.
Hope that works with you.
This link HW virtualization in VMware (KVM - Android Studio) helped me to find the solution.
Bad news found in the Using the Emulator section of the official Android developer website:
Not Inside a VM - You cannot run a VM-accelerated emulator inside
another virtual machine, such as a VirtualBox or VMWare-hosted virtual
machine. You must run the emulator directly on your system hardware.
So it seems my best alternative is look for a real device compatible with the Android Studio for running the apps.
You have vCenter and vSphere Web client use this to edit the VMs config Right click the Your_Windows_GuestOs > Edit Settings > CPU > Check the box "Expose hardware assisted virtualization to the guest OS
.
Install Android on a Cloud Virtual machine (AWS windows server)
Since my machine was slow with Android Studio I created a virtual machine on windows server on AWS with the best processor and RAM configurations, which gave me seamless programming and execution experience. But to use the emulator I face the error listed below.
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)
Since we can't connect our device to the Cloud machine, the option #3 is the best way to go.
Once the Android studio is installed,
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
I have android emulators running inside VMWare guest. It is utilizing Windows and not Linux, but the principles apply. As has been mentioned, the biggest item is ensuring the the VMWare processor setting for virtualization is checked.
Here are my specifics:
I'm running Win10 for both Host and Guest.
I have Android studio and android emulators running inside of a single VMWare guest which is being run using VMWare's player software.
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.
I faced this exact same error while running AVD in a cloud VM, adding a license solved it.
So, VMWare any cloud provider will not provide you the ability to create nested virtual machines. It is blocked by default so the Android studio would work but you would not be able to run an AVD, that’s not much useful.
To allow this you would then add the following license while VM creation-
https://compute.googleapis.com/compute/v1/projects/vm-options/global/licenses/enable-vmx
Note: This works only for GCP, you need to add different licenses for VMWare
This was just a short just of what you would do and the major steps involved, however, I highly recommend you to read this blog by me which provides a step by step guide to doing so.
I also urge you to check this answer by me where I explain this in greater detail for GCP.

Android Emulator Blocks sound on VMware linux host

I am using linux 10.04(32 bit) on VMWare. In this vm I have installed Eclipse and running an Android emulator. Sound normally works on the VM but as soon as I start the Android Emulator sound is disconnected, whit this error msg,
The default sound device cannot be opened:
A device ID has been used that is out of range for your system.
Failed to connect virtual device sound.
Can any one please tell how to enable sound while the emulator is running?
I started the emulator on a different port using the -port command still no luck. Any ideas?
This issue was solved after installing skype in to the vm!

Resources