[GH-ISSUE #17] docker-android under VM has slow performance #11

Closed
opened 2026-03-01 15:39:16 +03:00 by kerem · 8 comments
Owner

Originally created by @alanbuenoerlabs on GitHub (Jun 28, 2017).
Original GitHub issue: https://github.com/budtmo/docker-android/issues/17

Hey Budi,

I don't know if it's because of the noVnc interface or something like that, but the devices on the server got too slow, slow for any kind of task, have you handle this situation too?
I'm mounting the devices on a clean ubuntu server through docker-compose up -d and a simple yml file based on the example you gave. Machine resources were not the problem, I put some more memory and cpu but still without success.

  1. The initialization of the device isn't the problem, it's getting ready in 4-6 minutes, or less. The delay is on the interaction with the device, I send commands from a remote app with the selenium instructions or I move the screen with the mouse on the interactive window of noVnc and the device take about 1-2 seconds to respond.

  2. It's a VMware station with a lot of virtualized servers, this ubuntu I'm using is one of the many there and have only docker and docker-compose installed.

  3. Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz, 8 cores, 8G Memory and a little bit of hard disk.

  4. I used the butomo1989/docker-android-x86-6.0 with the Nexus 5 and Samsung Galaxy S6.
    deviceimage

  5. I already started a Grid individually and then used a command like this that you gave as example:
    docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e APPIUM=True -e CONNECT_TO_GRID=True -e SELENIUM_HOST="172.17.0.X" -e SELENIUM_PORT=4444 -e MOBILE_WEB_TEST=True --name android-container butomo1989/docker-android-x86-6.0

But it was not the solution. :(

  1. I didn't change the scale of the yml file, but I'm thinking the problem isn't the resources, because, looking in the active containers, it didn't scaled up to another container and still have a lot of resources available.

I made the device more soft and fast downloading inside the device container the Intel x86 Atom System Image and adjusting the config.ini file in the .android directory of the device to point to this new image. Than I could play with the device more fluidly and faster, but still couldn't get the speed of the local emulations.

Device new image:
newdeviceimage

Inicial docker-compose.yml (image because Markdown was messing the commands):
docker-compose

How would you tune up the performance of the emulation?

Best regards,

Alan Bueno

Originally created by @alanbuenoerlabs on GitHub (Jun 28, 2017). Original GitHub issue: https://github.com/budtmo/docker-android/issues/17 Hey Budi, I don't know if it's because of the noVnc interface or something like that, but the devices on the server got too slow, slow for any kind of task, have you handle this situation too? I'm mounting the devices on a clean ubuntu server through docker-compose up -d and a simple yml file based on the example you gave. Machine resources were not the problem, I put some more memory and cpu but still without success. 1. The initialization of the device isn't the problem, it's getting ready in 4-6 minutes, or less. The delay is on the interaction with the device, I send commands from a remote app with the selenium instructions or I move the screen with the mouse on the interactive window of noVnc and the device take about 1-2 seconds to respond. 2. It's a VMware station with a lot of virtualized servers, this ubuntu I'm using is one of the many there and have only docker and docker-compose installed. 3. Intel(R) Xeon(R) CPU E5-2640 0 @ 2.50GHz, 8 cores, 8G Memory and a little bit of hard disk. 4. I used the [butomo1989/docker-android-x86-6.0](https://microbadger.com/images/butomo1989/docker-android-x86-6.0) with the Nexus 5 and Samsung Galaxy S6. ![deviceimage](https://user-images.githubusercontent.com/25163252/27639228-f6dc3e22-5beb-11e7-9a35-11f100f28b13.png) 5. I already started a Grid individually and then used a command like this that you gave as example: `docker run --privileged -d -p 6080:6080 -p 4723:4723 -p 5554:5554 -p 5555:5555 -e DEVICE="Samsung Galaxy S6" -e APPIUM=True -e CONNECT_TO_GRID=True -e SELENIUM_HOST="172.17.0.X" -e SELENIUM_PORT=4444 -e MOBILE_WEB_TEST=True --name android-container butomo1989/docker-android-x86-6.0` But it was not the solution. :( 6. I didn't change the scale of the yml file, but I'm thinking the problem isn't the resources, because, looking in the active containers, it didn't scaled up to another container and still have a lot of resources available. I made the device more soft and fast downloading inside the device container the Intel x86 Atom System Image and adjusting the config.ini file in the .android directory of the device to point to this new image. Than I could play with the device more fluidly and faster, but still couldn't get the speed of the local emulations. Device new image: ![newdeviceimage](https://user-images.githubusercontent.com/25163252/27639501-c513ebbe-5bec-11e7-8100-9d8caedda88f.png) Inicial docker-compose.yml (image because Markdown was messing the commands): ![docker-compose](https://user-images.githubusercontent.com/25163252/27639874-01c21620-5bee-11e7-94a6-f27f432bce25.png) How would you tune up the performance of the emulation? Best regards, Alan Bueno
kerem 2026-03-01 15:39:16 +03:00
Author
Owner

@budtmo commented on GitHub (Jun 28, 2017):

Hi @alanbueno ,

Thank you for reporting this issue. as I understand that you are using VMWare to simulate linux OS, could you provide me guideline or step how you enable hardware virtualisation in that VM to be able to use x86 image (of course you can create PR for it)? because as far as I remember VM do not support hardware virtualisation (see #11 ).

In my linux computer 1 docker-container of docker-android consume 1 GB RAM, but the usage of RAM will get bigger when you start play with it and also depends on your application. e.g. hello world android application in emulator should consume less memory than any other bigger application like google map. Could you run top in your command line in your linux machine and see how many memory do you need for docker-android and how many free memory do you have? and is there any other parallel process running in that VMWare?

<!-- gh-comment-id:311694027 --> @budtmo commented on GitHub (Jun 28, 2017): Hi @alanbueno , Thank you for reporting this issue. as I understand that you are using VMWare to simulate linux OS, could you provide me guideline or step how you enable hardware virtualisation in that VM to be able to use x86 image (of course you can create PR for it)? because as far as I remember VM do not support hardware virtualisation (see #11 ). In my linux computer 1 docker-container of docker-android consume 1 GB RAM, but the usage of RAM will get bigger when you start play with it and also depends on your application. e.g. hello world android application in emulator should consume less memory than any other bigger application like google map. Could you run `top` in your command line in your linux machine and see how many memory do you need for docker-android and how many free memory do you have? and is there any other parallel process running in that VMWare?
Author
Owner

@alanbuenoerlabs commented on GitHub (Jun 28, 2017):

Hi @butomo1989,

I realized that it was not so clear in the issue, but it's a VM running on a physical machine with VMWare ESXI 5.5, Hardware acceleration enabled on bios and Nested Virtualization provided.
It can be easily verified with a ubuntu packet called cpu-checker that u can install with:

apt-get install cpu-checker

Once it's installed, we can check the Kvm status with the command:

kvm-ok

It would tell us if this environment is ready to virtualization with hardware acceleration, like shown below:
kvmok

There's no any parallel process running, this ubuntu is exclusively for this device virtualization and the numbers with two devices with and without stress.

Without stress:
memory2devices

With stress (intense interaction with Google Maps):
deviceusagemapsinteraction

Usage:
devicesmaps

<!-- gh-comment-id:311729150 --> @alanbuenoerlabs commented on GitHub (Jun 28, 2017): Hi @butomo1989, I realized that it was not so clear in the issue, but it's a VM running on a physical machine with VMWare ESXI 5.5, Hardware acceleration enabled on bios and Nested Virtualization provided. It can be easily verified with a ubuntu packet called cpu-checker that u can install with: `apt-get install cpu-checker` Once it's installed, we can check the Kvm status with the command: `kvm-ok` It would tell us if this environment is ready to virtualization with hardware acceleration, like shown below: ![kvmok](https://user-images.githubusercontent.com/25163252/27649782-2f07549a-5c09-11e7-9690-1ce195407e86.png) There's no any parallel process running, this ubuntu is exclusively for this device virtualization and the numbers with two devices with and without stress. Without stress: ![memory2devices](https://user-images.githubusercontent.com/25163252/27650781-64995970-5c0c-11e7-8242-4e1285009bae.png) With stress (intense interaction with Google Maps): ![deviceusagemapsinteraction](https://user-images.githubusercontent.com/25163252/27650810-81719abc-5c0c-11e7-96c5-f9fef1c5e813.png) Usage: ![devicesmaps](https://user-images.githubusercontent.com/25163252/27650976-22e2310e-5c0d-11e7-91be-703a33cb738a.png)
Author
Owner

@fernandoravagnani-luizalabs commented on GitHub (Jun 28, 2017):

@butomo1989 here was the steps to enable the virtualization in the VM:

  • first we upgraded the VM's virtual machine hardware, from version 8 to version 10

screenshot from 2017-06-28 14-48-39

  • after that, we enabled the hardware virtualization support on the VM

screenshot from 2017-06-28 14-47-19

  • finaly we checked the Expose hardware assisted virtualization to the guest OS. After this checked option, we were able to use the kvm feature on the OS

ps: using hardware or software CPU and MMU was praticaly the same performance

screenshot from 2017-06-28 15-14-06

<!-- gh-comment-id:311750023 --> @fernandoravagnani-luizalabs commented on GitHub (Jun 28, 2017): @butomo1989 here was the steps to enable the virtualization in the VM: - first we upgraded the VM's virtual machine hardware, from version 8 to version 10 ![screenshot from 2017-06-28 14-48-39](https://user-images.githubusercontent.com/19273547/27652655-eaf0190e-5c12-11e7-9a2b-462dc1864f4e.png) - after that, we enabled the hardware virtualization support on the VM ![screenshot from 2017-06-28 14-47-19](https://user-images.githubusercontent.com/19273547/27652880-b11bf03a-5c13-11e7-805a-147e606c47a5.png) - finaly we checked the Expose hardware assisted virtualization to the guest OS. After this checked option, we were able to use the kvm feature on the OS ps: using hardware or software CPU and MMU was praticaly the same performance ![screenshot from 2017-06-28 15-14-06](https://user-images.githubusercontent.com/19273547/27653171-9c2d1496-5c14-11e7-8e5f-b43148207c50.png)
Author
Owner

@budtmo commented on GitHub (Jun 29, 2017):

Hi,

@alanbueno Honestly I never try to run x86 docker-android image under VM. I just created gitter and could you join there: https://gitter.im/butomo1989/docker-android ? I might need additional informations so I can help you.

@fernandoravagnani-luizalabs Cool! Last time I tried with VM from virtualbox that was created by docker-machine and it didn't work. I will try again to create VM by myself. but I am really glad that it works with other VM like ESXi although there is performance issue. Thank you for the guideline!

<!-- gh-comment-id:311876158 --> @budtmo commented on GitHub (Jun 29, 2017): Hi, @alanbueno Honestly I never try to run x86 docker-android image under VM. I just created gitter and could you join there: https://gitter.im/butomo1989/docker-android ? I might need additional informations so I can help you. @fernandoravagnani-luizalabs Cool! Last time I tried with VM from virtualbox that was created by docker-machine and it didn't work. I will try again to create VM by myself. but I am really glad that it works with other VM like ESXi although there is performance issue. Thank you for the guideline!
Author
Owner

@budtmo commented on GitHub (Jun 29, 2017):

@fernandoravagnani-luizalabs It would be great if you can put that information somehow in README.md and create PR.

<!-- gh-comment-id:311877762 --> @budtmo commented on GitHub (Jun 29, 2017): @fernandoravagnani-luizalabs It would be great if you can put that information somehow in README.md and create PR.
Author
Owner

@budtmo commented on GitHub (Jun 29, 2017):

I tried following cases:
Host OS: OSX; Virtualbox: Ubuntu 16.04; Status: failed (x86 cannot be run under that VM)
Host OS: Ubuntu 16:04; Virtualbox: Ubuntu 16.04; Status: failed (x86 cannot be run under that VM)

It seems Virtualbox has issue with nested virtualisation.

and the solution is by using VMWare.

<!-- gh-comment-id:311963259 --> @budtmo commented on GitHub (Jun 29, 2017): I tried following cases: Host OS: OSX; Virtualbox: Ubuntu 16.04; Status: failed (x86 cannot be run under that VM) Host OS: Ubuntu 16:04; Virtualbox: Ubuntu 16.04; Status: failed (x86 cannot be run under that VM) It seems Virtualbox has issue with nested virtualisation. - https://forums.virtualbox.org/viewtopic.php?f=6&t=82389 - https://gns3.com/discussions/gns3-vm-your-cpu-does-not-suppor and the solution is by using VMWare.
Author
Owner

@andrcuns commented on GitHub (Jun 29, 2017):

What about Vagrant? Then the setup could be automated as well (don't have experience with it though).

<!-- gh-comment-id:311977081 --> @andrcuns commented on GitHub (Jun 29, 2017): What about Vagrant? Then the setup could be automated as well (don't have experience with it though).
Author
Owner

@budtmo commented on GitHub (Jun 29, 2017):

I will try to run under VMWare player and will provide the docs in the end. Regarding vagrant I might just create ticket and mark as "help wanted". Maybe someone who has experience with vagrant can investigate it. @andrcuns

<!-- gh-comment-id:311987594 --> @budtmo commented on GitHub (Jun 29, 2017): I will try to run under VMWare player and will provide the docs in the end. Regarding vagrant I might just create ticket and mark as "help wanted". Maybe someone who has experience with vagrant can investigate it. @andrcuns
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/docker-android#11
No description provided.