budtmo / docker-android

Android in docker solution with noVNC supported and video recording
Other
9.61k stars 1.27k forks source link

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

Closed rrdhani7 closed 5 months ago

rrdhani7 commented 3 years ago

🐛 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

](url)

qwerty32123 commented 3 years ago

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 commented 3 years ago

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?

mustafakirimli commented 3 years ago

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'
inez commented 2 years ago

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

asafe199 commented 1 year ago

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.

directentis1 commented 1 year ago

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...

muvaf commented 5 months ago

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"
budtmo commented 5 months ago

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.

muvaf commented 5 months ago

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