how to install Android virtual appliances (ova files) downloaded from Genymotion into VirtualBox on another machine that is not running Genymotion

半城伤御伤魂 提交于 2020-01-06 21:13:12

问题


In theory, it should just work.

  • Copy from machine #1: %LOCALAPPDATA%\Genymobile\Genymotion\ova\xxx.ova
  • Install into VirtualBox on machine #2: File -> Import Appliance..
  • Change the Network settings:
    • Update "Adapter 1" => Bridged, Intel PRO/1000 MT Desktop
    • Disable "Adapter 2"
  • start..

In practice:

  • early versions of Android do work, but anything more recent than KitKat just hangs at boot up
  • some of the versions that hang appear to be running an init.d script that results in a loop that repeatedly creates and kills a new process

Does anybody have any idea how to make these Android .ova virtual appliances run in VirtualBox completely standalone from any installation of Genymotion?

To add context, my development environment is already inside a VirtualBox guest OS. To run Genymotion would require that I run VirtualBox from inside VirtualBox, which is (a) a bad idea and (b) won't work. If I could run the Android images from the VirualBox on my host, then I could easily use adb connect <IP of virtualized Android device>:5555 from within my development environment to connect to the virtualized Android device and test/deploy native apps. I don't care at all about having Genymotion installed; I only want to be able to pick-and-choose from their wide selection of Android device images.

Help?

Update:

Here's a screenshot that shows the hanging boot screen while loading the image: Custom Phone - 6.0.0 - API 23 - 768x1280

screenshot.png


回答1:


What you want to do is impossible do to, the way you want to do it, with devices upper than 4.2.

Here is a brief explanation: When you start a Genymotion device on the standard way the Android OS is starting inside a VirtualBox VM but all the UI processing (which uses OpenGL) is done outside the VM to make the rendering pipeline uses your computer's GPU. Using this hardware acceleration makes the Genymotion devices fairly smooth and fast.

When you start the Genymotion VMs directly from VirtualBox, the OS will start but the rendering won't be hardware accelerated. From 2.3 to 4.2 there is a fallback solution: the rendering will be computed by the CPU, from inside the VM. From 4.3, the soft rendering is not a good solution as it will slow down the OS too much to be acceptable, that's the reason why we've disabled it and it cannot be enabled.

To help you according to your dev environment, you can try this solution which is a small hack but should work:

  • You definitely should start your devices using Genymotion directly
  • Before starting a device, you must change the device to use bridged network connection as you said. You can do it using the Genymotion device's settings directly or the command line tool, it will be faster than browsing through VBox soft.

Here is the command line:

gmtool admin edit <device-name> --network-mode bridge --bridged-if <your-host-interface>

Then you will have a problem because an ADB connection will be done by the Genymotion device's window (the one displaying the device). You need to disable it. It can be done using this command line:

gmtool device -n <device-name> adbdisconnect

Then you need to get the local IP of the device. You can get it by running this command:

adb shell "ifconfig | awk '/inet addr/{print substr(\$2,6)}' | awk 'NR==2'"

And then you can connect using ADB from inside your Android dev environment guest VM:

adb connect <device-ip>

An important note: The dev tools (Android Studio notably) have a tendency to kill the ADB server sometimes. This will make you will loose the ADB connection and you will have to reconnect again.

Another note: the command line tool is part of the paid features but considering your setup it seems your not under the "free for personal use" case.

I hope you will make it and maybe discover other nice features we implemented on Genymotion that will suite your interest.

Cheers ;-)



来源:https://stackoverflow.com/questions/39059976/how-to-install-android-virtual-appliances-ova-files-downloaded-from-genymotion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!