Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug ]: After running command, container can not be used #439

Open
Dominique1997 opened this issue Jun 20, 2024 · 7 comments
Open

[🐛 Bug ]: After running command, container can not be used #439

Dominique1997 opened this issue Jun 20, 2024 · 7 comments
Labels

Comments

@Dominique1997
Copy link

Operating System

Ubuntu

Docker Image

all version

Expected behaviour

When starting the container a android device comes online and can be accessed by vnc port

Actual behaviour

When starting the container a android device does not come online and can not be accessed by vnc port

Logs

_Samsung_Galaxy_S9_ANDROID_11_logs.txt

@jorge-gbs
Copy link

I am having the same issue

@VvLin-61
Copy link

same issue

@Ichinya
Copy link

Ichinya commented Jul 3, 2024

same issue

> docker exec -it 823240 cat device_status
STARTING

in docker

$ emulator
INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.2.13.db, detection is enabled for process: 106
INFO    | Android emulator version 34.2.13.0 (build_id 11772612) (CL:N/A)
ERROR   | No AVD specified. Use '@foo' or '-avd foo' to launch a virtual device named 'foo'

$ emulator -list-avds
INFO    | Storing crashdata in: /tmp/android-unknown/emu-crash-34.2.13.db, detection is enabled for process: 136
samsung_galaxy_s10_11.0

@Ichinya
Copy link

Ichinya commented Jul 3, 2024

androidusr@95b68f435bbf:~$ docker-android start device
2024-07-03 06:11:30 INFO Emulator - Sending user behavior analytics to improve the tool
2024-07-03 06:11:32 INFO Emulator - Config file exists
2024-07-03 06:11:32 INFO Emulator - Selected device is already created
sudo: unknown user: root
sudo: unable to initialize policy plugin
Traceback (most recent call last):
  File "/usr/local/bin/docker-android", line 11, in <module>
    load_entry_point('docker-android', 'console_scripts', 'docker-android')()
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/androidusr/docker-android/cli/src/app.py", line 144, in start
    start_device()
  File "/home/androidusr/docker-android/cli/src/app.py", line 77, in start_device
    selected_device.start()
  File "/home/androidusr/docker-android/cli/src/device/emulator.py", line 160, in start
    self.change_permission()
  File "/home/androidusr/docker-android/cli/src/device/emulator.py", line 142, in change_permission
    subprocess.check_call(c, shell=True)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'sudo chown 1300:1301 /dev/kvm' returned non-zero exit status 1.
androidusr@95b68f435bbf:~$ exit

if run root docker

PS D:\> docker exec -u0 -it 823240 docker-android start device
2024-07-03 06:12:37 INFO Emulator - Sending user behavior analytics to improve the tool
2024-07-03 06:12:37 INFO Emulator - Config file exists
2024-07-03 06:12:37 INFO Emulator - Selected device is already created
sudo: you do not exist in the passwd database
Traceback (most recent call last):
  File "/usr/local/bin/docker-android", line 11, in <module>
    load_entry_point('docker-android', 'console_scripts', 'docker-android')()
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/androidusr/docker-android/cli/src/app.py", line 144, in start
    start_device()
  File "/home/androidusr/docker-android/cli/src/app.py", line 77, in start_device
    selected_device.start()
  File "/home/androidusr/docker-android/cli/src/device/emulator.py", line 160, in start
    self.change_permission()
  File "/home/androidusr/docker-android/cli/src/device/emulator.py", line 142, in change_permission
    subprocess.check_call(c, shell=True)
  File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'sudo chown 1300:1301 /dev/kvm' returned non-zero exit status 1.

@Ichinya
Copy link

Ichinya commented Jul 3, 2024

PS D:\> docker exec -u0 -it 823240 chmod 777 /dev/kvm
PS D:\> docker exec -it 823240 /usr/bin/emulator -avd samsung_galaxy_s10_11.0

run emulator, but device_status not update

PS D:\> docker exec -it 823240 cat device_status
STARTING

@jamtheim
Copy link

Same issue here when restaring a container with persistant data

@chodorenko
Copy link

its problem from there

"sudo sed -i '1d' /etc/passwd")

In first start installs rights for /dev/kvm and remove root user from system.
after reboot container for /dev/kvm present old rights and no can use sudo by not exist root user.

@budtmo Can you explain why this was done? And perhaps it is worth removing the deletion of the root user in the container?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants