budtmo / docker-android

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

Screen not showing up in noVNC, even with virtualization activated #305

Open yoyole123 opened 2 years ago

yoyole123 commented 2 years ago

🐛 Bug Report

Operating System: fedora 30, 64 bit

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

Docker Version:
19.03.12

Docker Command to start docker-android:
sudo docker run --privileged -p 6080:6080 -p 5555:5555 -p 5554:5554 -p 4723:4723 -e DEVICE="Samsung Galaxy S9" --name android-container docker-android

Expected Behavior

GUI is displayed in noVNC at localhost:6080

Actual Behavior

The emulator crashes shortly after running the container. The phone screen shows up for a second in localhost:6080 but immediatly shuts down.

More Details:

I have read every relevant issue on this page, with emphesis on the famous issue 93, and tried every relevant solution - with no success. I also have another Fedora 30 machine which runs docker-android with the same command and settings with no issues. I have tried to check virtualization - it is supported and activated.

2019-08-22 07:03:30,587 CRIT Supervisor running as root (no user in config file)
2019-08-22 07:03:30,605 INFO supervisord started with pid 6
2019-08-22 07:03:31,614 INFO spawned: 'xvfb' with pid 9
2019-08-22 07:03:31,617 INFO spawned: 'port-forward' with pid 10
2019-08-22 07:03:31,623 INFO spawned: 'novnc' with pid 11
2019-08-22 07:03:31,626 INFO spawned: 'openbox' with pid 12
2019-08-22 07:03:31,650 INFO spawned: 'x11vnc' with pid 13
2019-08-22 07:03:31,650 INFO spawned: 'screen-copy' with pid 14
2019-08-22 07:03:31,670 INFO spawned: 'docker-appium' with pid 16
2019-08-22 07:03:31,670 INFO spawned: 'atd' with pid 23
2019-08-22 07:03:31,713 INFO spawned: 'auto-recording' with pid 25
2019-08-22 07:03:31,719 INFO spawned: 'adb-utils' with pid 26
2019-08-22 07:03:31,781 INFO exited: android-screen-copy (exit status 0; not expected)
2019-08-22 07:03:31,805 INFO exited: atd (exit status 0; not expected)
2019-08-22 07:03:32,674 INFO success: xvfb entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,674 INFO success: port-forward entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,674 INFO success: novnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,674 INFO success: openbox entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,674 INFO success: x11vnc entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:31,771 INFO spawned: 'screen-copy' with pid 96
2019-08-22 07:03:32,674 INFO success: docker-appium entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,888 INFO spawned: 'atd' with pid 98
2019-08-22 07:03:32,888 INFO success: auto-recording entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:32,888 INFO success: adb-utils entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-08-22 07:03:37,859 INFO exited: 'screen-copy' (exit status 0; not expected)
2019-08-22 07:03:32,901 INFO exited: atd (exit status 0; not expected)
2019-08-22 07:03:32,888 INFO spawned: 'screen-copy' with pid 167
2019-08-22 07:03:34,914 INFO spawned: 'atd' with pid 168
2019-08-22 07:03:37,859 INFO exited: 'screen-copy' (exit status 0; not expected)
2019-08-22 07:03:32,901 INFO exited: atd (exit status 0; not expected)
2019-08-22 07:03:38,085 INFO gave up: atd entered FATAL state, too many start retries too quickly
2019-08-22 07:03:38,085 INFO gave up: screen-copy entered FATAL state, too many start retries too quickly
2019-08-22 07:03:38,085 INFO exited: docker-appium (exit status 0; expected)

EDIT - A solution:

I have found a solution which works on my system. Details can be found in a comment I left, here.

yoyole123 commented 2 years ago

Ok, I have a solution! For some reason, the container runs the emulator using flags and a "@" sign that causes it to crash on my machine. I made edits to app.py (the section after line 227) and after re-building the image, it works for me:

    if is_first_run:
        logger.info('Emulator was not previously initialized. Preparing a new one...')
        cmd = 'emulator/emulator {name} -wipe-data {custom_args}'.format(name=avd_name, custom_args=custom_args)
    else:
        logger.info('Using previously initialized AVD...')
        cmd = 'emulator/emulator {name} {custom_args}'.format(name=avd_name, custom_args=custom_args)
IvanTurgenev commented 2 years ago

Having the same issue on fedora 35, ima try your fix