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

[🐛 PRO | Bug ]: “sudo docker run -d -p 6085:6080 -p 5558:5554 -p 5559:5555 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container2 -v android-data2:/home/androidusr budtmo/docker-android-pro”, It worked the first time, but after running docker restart container2, only the background is displayed, and the Android system doesn't show up.

Open dalangtaosh opened this issue 1 year ago • 8 comments

Operating System

ubuntu24.04

Docker Image

latest

Expected behaviour

“sudo docker run -d -p 6085:6080 -p 5558:5554 -p 5559:5555 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container2 -v android-data2:/home/androidusr budtmo/docker-android-pro”, It worked the first time, but after running docker restart container2, only the background is displayed, and the Android system doesn't show up.

Actual behaviour

“sudo docker run -d -p 6085:6080 -p 5558:5554 -p 5559:5555 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container2 -v android-data2:/home/androidusr budtmo/docker-android-pro”, It worked the first time, but after running docker restart container2, only the background is displayed, and the Android system doesn't show up.

Logs

“sudo docker run -d -p 6085:6080 -p 5558:5554 -p 5559:5555 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container2 -v android-data2:/home/androidusr budtmo/docker-android-pro”, It worked the first time, but after running docker restart container2, only the background is displayed, and the Android system doesn't show up.

dalangtaosh avatar Dec 24 '24 07:12 dalangtaosh

I have the same, could someone explain what i could be doing wrong?

MightyPrefix avatar Dec 26 '24 18:12 MightyPrefix

the same

dej4vu avatar Jan 16 '25 07:01 dej4vu

the same

heiye3344 avatar Jan 17 '25 07:01 heiye3344

I ran the Docker container using the following command

sudo docker run -d -p 6080:6080 -e EMULATOR_DEVICE="Samsung Galaxy S10" -e WEB_VNC=true --device /dev/kvm --name android-container budtmo/docker-android:emulator_9.0

At the time of launch, the 6080 TCP HTTP port served VNC with the "DOCKERANDROID" background, but the emulator did not appear

Image

The device status was consistently BOOTING

watch -n 1 sudo docker exec -it 612ef629c0d7 cat device_status

Container logs revealed the following activity:

user@hostname:~$ sudo docker logs -f 612ef629c0d7
2025-01-19 14:05:28,471 INFO supervisord started with pid 8
2025-01-19 14:05:28,472 INFO supervisord started with pid 9
2025-01-19 14:05:28,473 INFO supervisord started with pid 7
2025-01-19 14:05:29,474 INFO spawned: 'android_port_forward' with pid 13
2025-01-19 14:05:29,475 INFO spawned: 'appium' with pid 14
2025-01-19 14:05:29,477 INFO spawned: 'd_screen' with pid 15
2025-01-19 14:05:29,478 INFO spawned: 'device' with pid 16
2025-01-19 14:05:29,479 INFO spawned: 'd_wm' with pid 17
2025-01-19 14:05:29,480 INFO spawned: 'log_web_shared' with pid 18
2025-01-19 14:05:29,499 INFO spawned: 'vnc_server' with pid 19
2025-01-19 14:05:29,504 INFO spawned: 'vnc_web' with pid 20
2025-01-19 14:05:30,477 INFO success: android_port_forward entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,500 INFO success: appium entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,500 INFO success: device entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,500 INFO success: log_web_shared entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,516 INFO success: d_screen entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,516 INFO success: d_wm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,516 INFO success: vnc_server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:30,516 INFO success: vnc_web entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:31,587 INFO exited: appium (exit status 0; expected)
2025-01-19 14:05:32,478 INFO exited: log_web_shared (exit status 0; expected)
2025-01-19 14:05:32,479 INFO spawned: 'log_web_shared' with pid 65
2025-01-19 14:05:33,393 INFO exited: log_web_shared (exit status 0; not expected)
2025-01-19 14:05:34,395 INFO spawned: 'log_web_shared' with pid 114
2025-01-19 14:05:35,421 INFO success: log_web_shared entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:35,794 INFO exited: log_web_shared (exit status 0; expected)
2025-01-19 14:05:35,814 INFO spawned: 'log_web_shared' with pid 128
2025-01-19 14:05:37,389 INFO success: log_web_shared entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:37,389 INFO exited: log_web_shared (exit status 0; expected)
2025-01-19 14:05:38,392 INFO spawned: 'log_web_shared' with pid 153
2025-01-19 14:05:38,990 INFO exited: log_web_shared (exit status 0; not expected)
2025-01-19 14:05:39,993 INFO spawned: 'log_web_shared' with pid 156
2025-01-19 14:05:41,232 INFO success: log_web_shared entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:41,232 INFO exited: log_web_shared (exit status 0; expected)
2025-01-19 14:05:42,235 INFO spawned: 'log_web_shared' with pid 158
2025-01-19 14:05:43,470 INFO success: log_web_shared entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2025-01-19 14:05:43,470 INFO exited: log_web_shared (exit status 0; expected)

I think the primary issue lies in the log_web_shared service

My OS is Ubuntu 22.04.5 LTS

vadim-belous avatar Jan 19 '25 14:01 vadim-belous

the same

FlowerBirds avatar Jan 20 '25 02:01 FlowerBirds

Same problem here! does anyone know if it is possible to run an older working version? How can i make it use an older version?

Lurs1 avatar Jan 24 '25 22:01 Lurs1

Got the same problem :(

BakaQvO avatar Feb 13 '25 08:02 BakaQvO

To fix this, I fully stop and remove the container and its volumes before launching it again. This ensures a clean environment. The script also includes automatic ADB reconnection and boot completion wait.

#!/bin/bash
docker stop android-container2
docker rm android-container2
docker volume rm android-data2
adb kill-server
pkill adb

#  Start the emulator using Docker
sudo docker run -d \
  -p 6085:6080 -p 5558:5554 -p 5559:5555 \
  -e EMULATOR_DEVICE="Samsung Galaxy S10" \
  -e WEB_VNC=true \
  --device /dev/kvm \
  --name android-container2 \
  -v android-data2:/home/androidusr \
  budtmo/docker-android-pro

# Wait until the emulator is ready
for i in {1..12}; do
  if adb connect 127.0.0.1:5555 | grep -q "connected"; then
    if adb devices | grep -w "127.0.0.1:5555" | grep -q "device"; then
      echo "Emulator is ready!"
      break
    fi
  fi
  sleep 5
done

# Waiting for Android system to finish booting..."
adb -s 127.0.0.1:5555 wait-for-device shell 'while [[ -z $(getprop sys.boot_completed) ]]; do sleep 1; done; input keyevent 82'

NidhalGhazouani avatar Mar 28 '25 00:03 NidhalGhazouani