AndroVM – Documentation

Introduction

The “AndroVM” initiative aims at providing a “as good as possible” support to run Android in Virtual environments. It’s the follow-up of my previous work on Buildroid. Even if you used my previous VM, please read these instructions as many things may have changed (networking, storage, video, …).

The main objective of AndroVM is to provide Android developers a better way to test their software (better than the qemu emulator provided with the Android SDK).

Description

Display

Beginning with the 20121106 release, you can use “Software OpenGL” which uses the VirtualBox VGA driver for display or use “Hardware OpenGL” and use the “AndroVM player” external application for display.

Software OpenGL

We use the “UVesa” linux driver and a software-only OpenGL implementation.
The video resolution can be set through the “AndroVM Configuration” android application embedded in the VM.

Screen orientation change is supported : if an application rotates the screen, it will rotate automatically.

Hardware OpenGL

Beginning with the 20121106 release, Hardware OpenGL ES 2.0 support is included in AndroVM, thanks to the work done by Google. To use it you have to enable it in the “AndroVM configuration” Android app and install “AndroVM player” on your host.

Beginning with the 20130222 release, the TCP connections used to exchange OpenGL content are initiated from the host to the VM. Thus, it’s now possible to have multiple AndroVM running with Hardware OpenGL ; this way, we should also have less problems with firewall software running on the host.

An important thing is that, to use “Hardware OpenGL”, you have to configure the first virtual network card to be conntected to a “host only network” (see the network section hereunder). Beginning with the 20130208 release, the AndroVMplayer tool can now configure it for you : if the first virtual network card of the VM seems not correctly configured, AndroVMplayer will propose you to set it up for you.

When using Hardware OpenGL, the resolution and DPI are not set in the “AndroVM configuration” app but are supplied as parameters when you start “AndroVM player” : the first three parameters are : width, height, DPI. For exemple you would start “AndroVMplayer 1280 720 160″ to have a 1280×720 resolution with 160 DPI.

For Linux/Mac OS versions, you have to use the “run.sh” script to start AndroVMplayer, for example “run.sh 1280 720 160″, whereas on Windows, you directly start AndroVMplayer.exe, for example “AndroVMplayer 1280 720 160″.

Keyboard

By default, the system will use the hardware keyboard. But you can choose to disable it in order to use the Android virtual keyboard (this could be important for application testing). Keyboard configuration is done through the “AndroVM configuration” android application.

Some special (hardware) keys :

  • To unlock screen, press the “Home” or “F1″ key
  • The android “back” button is mapped to the physical “Esc” key

Storage

The VM on ICS (4.0.x) comes with 2 virtual hard disks :

  • one with the android system (boot, /system, /data, …)
  • one with sdcard
The VM on JB (4.1.x) comes with 3 virtual hard disks :
  • one with the android system (boot, /system, …)
  • one for the /data android directory
  • one with sdcard

If you insert a USB stick and connect it to the VM (using VirtualBox) it will be mounted in /mnt/USB

Beginning with the 20130222 release, VirtualBox shared folders are supported ; all the “auto-mount” shared folders configured for the VM will be mounted in the “/mnt/shared” directory.

Networking

The AndroVM comes with 2 virtual Ethernet cards :

  • The first one (eth0) is dedicated to ‘management’ but is, by default, configured as a “null connexion”
  • The second one (eth1) is used by the system to emulate a Wifi connection
To use the eth0 management connection, you have to configure the first network card of your VM as a “host only network” and attach it to a DHCP-enabled network – if you don’t have such a network in your VirtualBox configuration, you can create one (go to the general ‘File’ menu, then ‘Parameters’ and ‘Network’).

The “AndroVM Configuration” can be used to know the IP address used by the network management card (eth0). Then you can execute an “adb connect [IP]” and connect to your AndroVM (shell, push/pull files, …) and debug your application directly from Eclipse.

Installation

The AndroVM can be downloaded as an “OVA” file. Once dowloaded, you just have to import it in VirtualBox.

Please note AndroVM comes in 3 different versions :

  • vbox86p : Built for a “phone”, 480×800 default resolution
  • vbox86t : Built for a “tablet”, 1024×600 default resolution
  • vbox86tp : Built for a “tablet” with phone capabilities, 1024×600 default resolution

Frequently Asked Questions

How can I install Google Apps (including the Market/Play app) ?

Here are the steps :

  • Download Google Apps : gapps-jb-20121011-androvm.tgz [basically the /system directory from the Cyanogen gapps archive without the GoogleTTS app which crashes on AndroVM]
  • Untar the gapps…tgz file on your host – you’ll have a system directory created
  • Get the management IP address of your AndroVM (“AndroVM Configuration” tool) and do “adb connect x.y.z.t”
  • do “adb root”
  • reconnect with “adn connect x.y.z.t”
  • do “adb remount”
  • do “adb push system/ /system/”

Your VM will reboot and you should have google apps including Market/Play.

You won’t have some Google Apps, like Maps, but they can be downloaded from the Market/Play.

After one minute, the screen locks and I can’t unlock

To unlock screen, press the “Home” key and then slide with your mouse.

You can disable screen lock in the Settings (“Development->Always stay awake”).

Configuration tutorial

Here is a small tutorial to help you setting-up AndroVM with hardware accelerated OpenGL rendering, using VirtualBox.
I will assume that you already have VirtualBox installed and working.

Network Adapter

To run with hardware acceleration, as for using the ADB with AndroVM, you’ll need an “Host Only” network adapter. To create one, open VirtualBox, get to the “File” menu, “Preferences…”, “Network”.

Step 1 - VBox Network Preferences

Don’t forget to enable DHCP Server for this network adapter.

Step 2 - Host Only Adapter Configuration

Importing VM

Now, you can import the VM into VirtualBox. Just double-click on the OVA file, or use “File” menu, “Import Appliance”.
It can be a good idea to rename the VM into something more friendly.

Step 3 - Importing OVA

Setting-up VM

Step 4 - VM Parameters

By default, AndroVM has its first network adapter set to disable. Go to the VM network settings and set it to “Host Only Adapter”

Step 5 - Network Adapter 1

Then, start the VM. Now, you’ve got a fully functional software-rendered AndroVM. Now, open the AndroVM Config app, and check the box to enable hardware OpenGL.

Step 6 - AndroVM Config

Note that you might see the VM IP on the top off the app. This is the Management IP. You can adb connect this IP.
If there’s no IP address, then you won’t be able to use hardware OpenGL. Verify your host-only adapter configuration.
Click on the “Save” button, The VM will restart.

Spet 7 - VM Reboot

The VM will stay in that state. Now it’s time to run the AndroVMplayer.

AndroVMplayer

The AndroVMplayer is a software used to display the VM content and manage its events. It won’t work if the VM is not running !
Open a command line interpreter, get to the AndroVMplayer directory, and type :
AndroVMplayer [width] [height] [density]

Step 8 - AndroVMplayer

Wait a few seconds, and the Android boot animation will appear in the AndroVMplayer.

Typical problems

Step 8: the AndroVMplayer blocks on “waiting for connection from VM”

  • If the VM shows a Management IP, try to connect to the VM through adb. If it doesn’t work, then turn off your firewall
  • If the VM doesn’t show a Management IP, the your network adapter is not well configured

72 thoughts on “AndroVM – Documentation

  1. Work great at VirtualBox, Ubuntu 12.04 except Audio Input from Mic doesn’t work. Any hints for that ?

    • Android vm won’t start.All i get is:example:
      [ 4.29.7888888] init :untracked pid 1218 exited,
      it continues forever and never stops,number just gets higher,what is the problem

  2. My computer spec: Win7x64 , VirtualBox 4.2.2

    Hardware OpenGL with AndroVM Player : Run very fast. Sound is okay.
    ( thank you Dan! )

    1.) If an application rotates the screen, the mouse pointer will locate at wrong place.

    2.) The mouse scroll has problem

    3.) Youtube: work great
    Google Map: work great
    Google Street View: work great
    (game) Angry Birds: work great
    (game) Amazing Alex: work great
    (game) Where’s my water: Hang!
    (game) Where’s my Perry: Hang!

  3. Window ID: 00650928
    – FrameBuffer::initialize
    – FrameBuffer::initialize – new FrameBuffer
    – FrameBuffer::initialize – eglGetDisplay
    – FrameBuffer::initialize – eglGetDisplay returns
    – FrameBuffer::initialize – eglInitialize
    – FrameBuffer::initialize – eglChooseConfig
    – FrameBuffer::initialize – eglCreateContext
    listen() returned 0, errno=34
    creating window 0 0 1024 600
    creating vinput server on TCP port 22469 returns 340

    • Boot up the VM in Virtualbox at the same time that you run the command AndroVMPlayer 1024 768 160. If you have the host-only eth0 set up then they’ll talk to each other and you’ll get a GL accelerated window

  4. can you explain better the android play installing? i didn’t understand nothing and i’m in my 6th year of computer science.

    • Sorry for that,
      I’ll try to rewrite it to be more clear.
      In the mean time, it should be easier for you to directly use OVAs with include Google Apps (the ones with gapps in the name).

      Dan.

    • Download one of the “Current release”.

      In the VirtualBox, import the ova file.

      In the setting page of the Virtual Machine, set:

      Eth0 connection mode = Host Only Network
      (for communication between the GuestOS and AndroVM Player)

      Eth1 connection mode = NAT
      (for the GuestOS, to access the internet through your HostOS)

      Turn on your Virtual Machine.

      ———————————————————————–

      If you want to use the Hardware OpenGL, please follow:

      Turn on your Virtual Machine.

      In the android, Run the “AndroVM Configuration” app,
      click the “Hardware OpenGL” and “Save”
      The app will ask you to reboot the android,

      Make sure that your Virtual Machine is running, before you run the AndroVMplayer.exe

      If there isn’t any problem, you may find the Android OS will be display on AndroVM Player.

      If the AndroVM Player froze, you may try to turn off your firewall.

      • After i Change for Hardware OpenGL, Save and Restart Android, VM can not run. VM (virtualbox) displays for example [432.3212331] init: untracked pid 1508 exited.
        Where is the problem?

          • I have lanched AndroVMPlayer and nothings happend, even i turn off firewall.
            My configuration is laptop Samsung R620 witch has 2 phisical network cards.
            I try on the other computer and let now is it works.

          • 1. Network card 1 – Host Only Adapter
            2. Network card 2 – NAT (works fine).
            3. I can not ping to 192.168.56.1 from my pc under cmd command.
            4. Do i have install Android SDK or else?
            5. After i launch AndroVMPlayer, it hangs and i can’t do anything with it, only kill process (it’s no matter if vm works or not).
            6. ipconfig command for my Vbox Host Network displays not an ip address, that is from guest network. Examlple
            Under guest i have 192.168.56.1 255.255.255.0
            Under operating system i have 2 diffrent ip addresses:
            in ipconfig cmd: 169.254.174.75 255.255.0.0
            in properities: 192.168.56.1 255.255.255.0

            I don’t know witch information could be important.

            Thanks for every advise so far.

          • I look everything but in section important i don’t read version of VirtualBox. I use 4.2.4. I changed on older one version and it works perfect.
            Sorry for my misstake.

  5. I was wondering… Is it possible to have this streamed over a network? it would make it nice to have development going on on a certain computer while one computer is being used stricly for VM purposes and i could use my Linux Atom tablet to run the opengl display…

    • Do you mean that one computer runs the VirtualBox ( or VMware ) only; another computer runs the AndroVM_Player only?

      • That’s great news! Would I be correct in assuming that such a change would eliminate the flickering I get when I run in HW OpenGL mode?

  6. My Andro VM Player still frozes my firewall is already off and..

    init: untracked pid 1508 exited.

  7. Nice app but I tried Bad Piggies in OpenGL mode and it don’t recognize mouse clicks(touches) Any solution to make it work?

    • To connect to ADB,
      adb connect 192.168.56.10x (your IP Management)

      To root :
      adb root to gain ADB root access
      OR
      su in an ADB shell

  8. mac os x mountion lion on macbook air
    virtual box 4.2
    androidx86 4.1.1r4 1106
    when start android in vmplayer
    press fn+F1
    the OPTION menu can not open,
    but it work good in VirtualBox only.

    why?
    how to fix ?

  9. Is it possible to upgrade an older version to current, or do you have to start over? I’ve got 4.0.3, wanting to upgrade to 4.1.1, but don’t want to lose everything I have on the older build.

    Thanks!

  10. Hi, I got the android VM to run. How do I install and debug my android application on it ? I’m a new to this…
    Thanks for any help.

  11. Awesome work!

    However I’m having a little problem. I want to use my physical keyboard to write Arabic. Is it possible?
    I’m using Linux.

    Keep up the good work.

  12. Hello.
    I did all what’s in the guide, step by step. But, the output of ./run.sh is this:

    diego@Janet:~/Descargas/AndroVMplayer$ ./run.sh 1024 600 160
    Window ID: 0x520000d
    – FrameBuffer::initialize
    – FrameBuffer::initialize – new FrameBuffer
    – FrameBuffer::initialize – eglGetDisplay
    – FrameBuffer::initialize – eglGetDisplay returns
    – FrameBuffer::initialize – eglInitialize
    libGL error: failed to load driver: swrast
    libGL error: Try again with LIBGL_DEBUG=verbose for more details.
    – FrameBuffer::initialize – eglChooseConfig
    – FrameBuffer::initialize – eglCreateContext
    listen() returned 0, errno=11
    eglMakeCurrent failed
    Unable to setup SubWindow

    I have running the window of AndroVM

    • It seems you don’t have opengl hardware drivers on your linux.
      What’s your GPU ? What version of Linux do you run ?

      Dan.

  13. Hello and thanks for great work!

    Everything is looking good, Google Play is connected and I see my apps, but I cannot install anything. Seems like there’s some storage access problem.

  14. Hi. Just discovered this project and givin’ it a try.
    Anyway running run.sh 1024 600 160 from AndroVMPlayer folder, I get:
    ./AndroVMplayer: No such file or directory,
    but…
    I’m on linux 64bit
    I’m running the 64bit version of AndroVMplayer
    ia32-libs are installed on my system (Ubuntu 12.10)
    some help?

    • Oops sorry there was a mistake in the linux64 package.
      You can redownload it, it should work.

      Dan.

  15. Could you please add actual fullscreen feature and not just a bigger resolution?
    The biggest resolution I can find is 1366, but my screen is 1920×1080.
    If you can’t fix this, can you at least explain to me how I fix this myself?
    I tried to replace 1366×786 with 1920×1080 in the .vbox file, but it didn’t work.

  16. Host : Win 7, VirtualBox 4.2
    Guest: androVM_vbox86t_4.1.1_r4-20121106

    My host pc is accessing internet over proxy, wired access. I am not able to access internet fom android on virtualbox. How can I define proxy settings.
    I’ve tried host-only networkin and bridged networking, neither was successful.

  17. I was impressed too! I’ve rtecnely tried VmWare 7.1 that has DX acceleration (at last!) but still doesn’t have OpenGL. it has software OpenGL through Mesa. But anyway when I launched some 3D tests under virtual WinXP I was like WOW!

  18. Great works!

    I’m running MacOS and everything is working correctly though I didn’t try Google Play.

    I give you one question and one comment;

    Q. How do I gently power off AndroVM?
    – without killing AndroVMplayer process
    – without closing(power off) VM of VirtualBox

    C. If documentation of installing and running AndroVM is more PROCEDUAL, many of users will have your excellent work more easily.

    In my case, after I followed your instruction of setting Host-only network adapter part, then I just ran VM of VirtualBox. All I see was infinite loop of ‘untracked pid’ error.
    By carefully reading your article again, I noticed that I need ANOTHER program called AndroVMRun which seemed to be irrelevant for that time. You certainly mentioned about in the context of article, but somehow it hardly gives clear understanding because people like me thinks just running VM!
    I saw somewhere you are working with improving documentation, a nice instruction could have been writing.

    Once again, I appreciate your excellent works. Please, keep people happy!

    • Hi !

      Q. How do I gently power off AndroVM?
      – without killing AndroVMplayer process
      – without closing(power off) VM of VirtualBox

      Currently, you can’t.
      Next release will come with the “Power button” support, so you’ll be able to restart/power off your system !

      C. If documentation of installing and running AndroVM is more PROCEDUAL, many of users will have your excellent work more easily.

      We are working on it :)

      Thanks for your feedback !
      Sam.

  19. Hi,

    @AndroVM team: you rock! Absolutely stunning application. Very fast performance in Hardware OpenGL mode…. Thank you very much. Even the microphone works. I owe you a few beers, at least!

    However, may I please ask you something?

    I noticed that the newest build of AndroVM still experiences the following bug on my desktop PC (Intel Core2Duo e8200 + Nvidia 8800GT + 4GB RAM + Virtualbox 4.2.4):

    http://code.google.com/p/android/issues/detail?id=35737

    Google Voice Search works the very first time (including microphone), but any time after that it hangs on “initializing”, just like in the bugreport. I am not using bluetooth. I read somewhere that this issue might be resolved in Android 4.2.
    When will you start using Android 4.2 as new code baseline?

    Second thing: The bigger free games in Google Play (bigger than 1 GB) either cause the AndroVM player and the host operating system to crash (while downloading the file), or I cannot start playing the game because the opening menu does not accept my mouse clicks as valid input. Very strange. The smaller games (around 40 MB in size) almost always correctly interpret and accept mouse input (instead of touchscreen). The bigger games almost never accept the mouse input….

    Kind regards,

    Mark

    • Hi Mark,

      Google Voice Search works the very first time (including microphone), but any time after that it hangs on “initializing”, just like in the bugreport. I am not using bluetooth. I read somewhere that this issue might be resolved in Android 4.2.
      When will you start using Android 4.2 as new code baseline?

      Microphone support is at an early stage of development (as for webcam support). Just let us a bit more time to fix it :)

      Second thing: The bigger free games in Google Play (bigger than 1 GB) either cause the AndroVM player and the host operating system to crash (while downloading the file), or I cannot start playing the game because the opening menu does not accept my mouse clicks as valid input. Very strange. The smaller games (around 40 MB in size) almost always correctly interpret and accept mouse input (instead of touchscreen). The bigger games almost never accept the mouse input….

      We are aware of those problems and are working on it. Thanks for the report !

      Sam.

  20. Ihave 2 bugs:

    -I cannot use Bluetooth using my USB Dongle (Installed VirtualBox Guest Additions)
    -To use AndroVM, I need to move my mouse; It´s something like it pauses until I move the mouse (I need to move it each 5 seconds)

    Specs:
    VirtualBox 4.2.4 with Guest Additions 4.2.4
    Intel Pentium Dual Core 2.00 Ghz
    3 GB RAM Memory
    1200 MB Video Memory (Using 128 on VM)

  21. Problem starting AndroVMpayer.exe: (x64 on win 7)

    Window ID: 0000000000040626
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    could not get wglGetExtensionsStringARB
    Failed to create Context 0×3005
    Unable to setup SubWindow

    VM is started and waiting, and I can ping the 192.168.56.101 IP Address.

  22. Bluetooth cannot be enabled in vbox86tp version (tried both laptop bluetooth and different makes USB bluetooth dongles). Bluetooth used to work fine with x86Android builds run in Virtual box. However I wanted shared folders functional on Virtual box so shifted to “vbox86tp version” but bluetooth is not enabled.. I want bluetooth function to communicate with other device.

  23. +1 for bluetooth support – it would be superb if we could use bluetooth in the same way as with x86android ;-) Anyway thanks for providing such a great to tool to us.

  24. Excellent project.. is there any way to insert apps manually into the sdcard? Thanks guys.. help me with this little problem :)

    • Hi,

      You can install them using adb install -s your.apk or just adb push your.apk /scdard and then install them manually !

      Sam.

  25. Trying to learn Android programming, but the emulator is too slow on my Intel 32bit Fedora 17 kernel-PAE. I found instructions to install Androix-x86 using VirtualBox and got everything set up, but I’m running into a strange problem. When the virtual Android OS is booting, the boot animation sometimes animates, but often only animates if I move the mouse into the VBox window and move it around. If I stop moving it, the boot logo stops, too.

    After boot, the same thing occurs in the main Android screens, too. If I don’t keep moving the mouse around, it doesn’t seem to handle inputs.

    Unfortunately, it’s pretty darned slow trying to use Androidx86 that way. Does anyone have an idea why this might be happening?

  26. Pingback: Microbender Blog » there is a windows 7 launcher for android, don’t want to install on my tab. testing as virtual machine…

  27. Pingback: Android – VM Jelly Bean con OpenGl, tablet y teléfono en tu pc, GNU-Linux, Windows y Mac « pedrote2222

  28. Pingback: Emulador Android para PC y con acceso a Google Play gracias a AndroVM | Iván Andréi

  29. Pingback: AndroVM 20130222 release | AndroVM blog

  30. Pingback: Alternatif Android Emulator: AndroVM » Balkoncu

  31. Pingback: How to run Android-x86 4.2 iso on VM VirtualBox? : Android Community - For Application Development

  32. Pingback: ADF Mobile: Avoiding the Android Emulator with AndroVM

  33. Pingback: Virtualizing Android using VirtualBox | LieberLieber Software TeamBlog