docker-android icon indicating copy to clipboard operation
docker-android copied to clipboard

Emulator is running using nested virtualization. This is not recommended. It may not work at all...

Open rrdhani7 opened this issue 4 years ago • 9 comments

🐛 Bug Report

Operating System: Ubuntu 20.04

Docker Image: budtmo/docker-android-x86-8.1

Docker Version: 20.10.4, build d3cb89e

Docker-compose version (Only if you use it):

Docker Command to start docker-android: docker run

Expected Behavior: Android emulator is working well

Actual Behavior

Screenshot 2021-03-04 at 10 04 47 AM

rrdhani7 avatar Mar 04 '21 03:03 rrdhani7

hey @rrdhani7 did u manage to fix this? im using google cloud with nested virtualization and im getting the same issue but in my case the container works, i can open any app etc, but i cannot connect it to adb correctly

when i did it from my own ubuntu i got emulator-5554 down the localhost:6080 line, then i could call from appium that emulator

`XXX@XXX-2:~$ adb connect localhost:6080
already connected to localhost:6080
XXX@XXX-2:~$ adb devices
List of devices attached
localhost:6080  offline

xxx@xxx-2:~$ docker ps -a
CONTAINER ID   IMAGE                           COMMAND                  CREATED         STATUS                   PO
RTS                                                                                                                
          NAMES
08da0f04e8b7   budtmo/docker-android-x86-8.1   "/bin/sh -c '/usr/bi…"   9 minutes ago   Up 9 minutes (healthy)   45
67/tcp, 0.0.0.0:5554-5555->5554-5555/tcp, :::5554-5555->5554-5555/tcp, 4723/tcp, 0.0.0.0:6080->6080/tcp, :::6080->6
080/tcp   android-container
xxx@xxx-2:~$ 

qwerty32123 avatar Jun 09 '21 16:06 qwerty32123

Screenshot of noVNC

I got this trying 2 images but i think i will have the same problem in all, anyone knows any way of fixing this?

qwerty32123 avatar Jun 09 '21 17:06 qwerty32123

I found a work-around for this issue, definitely there should be better way to handle it.

Either extending Dockerfile or just replacing entrypoint with below work-around will close the window/dialog.

Have/add new process on supervisor.conf file which runs below command. Need to install wmctrl package as Docker file does not have apt update && apt install -y wmctrl

wmctrl -c 'Running in Nested'
  • Also you should handle restarts of supervisor process, basic logic can be added to wait until screen/process appears and then only run command etc..

mustafakirimli avatar Aug 13 '21 16:08 mustafakirimli

Speaking of nested virtualization - I'm curious if you noticed it being actually slow or very slow?

inez avatar Dec 23 '21 01:12 inez

Do you guys were able to handle the situation? I'm using GCP and I got the same message. The performance is much lower than I expected.

asafe199 avatar Jul 19 '23 13:07 asafe199

Same problem here, I try to use it with Docker Compose and Dev Container with Codespaces, but not sure what I need to do to connect to it or open noVNC on a open tab.

Stuck on booting process...

directentis1 avatar Aug 11 '23 08:08 directentis1

I did some experiments using docker commit command and dive tool to see what changes in the container after you click never show again and then OK. Found out that the setting is stored in .config/Android Open Source Project/Emulator.conf in the following form:

[General]
showNestedWarning=false

Then, I've been able to disable the warning with the following command in my Dockerfile where I use docker-android image as base:

RUN mkdir -p "${WORK_PATH}/.config/Android Open Source Project" \
 && echo "[General]\nshowNestedWarning=false\n" > "${WORK_PATH}/.config/Android Open Source Project/Emulator.conf"

muvaf avatar Apr 18 '24 08:04 muvaf

Hi @muvaf ,

Thank you for the solution. Could you create a PR for that? I will review and merge that PR. it will benefit other as well.

budtmo avatar Apr 27 '24 10:04 budtmo

@budtmo Sure, here you go https://github.com/budtmo/docker-android/pull/421

muvaf avatar Apr 27 '24 19:04 muvaf