budtmo / docker-android

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

[🐛 Bug ]: Restart of container requires root #364

Closed RasmusDK closed 1 year ago

RasmusDK commented 1 year ago

Operating System

Ubuntu

Docker Image

budtmo/docker-android:emulator_13.0

Expected behaviour

Restart of the docker container should start the existing android emulator.

Actual behaviour

The emulator is not started up. The error below is found in device.stdout.log. It seems to come from change_permission function here: https://github.com/budtmo/docker-android/blob/11279d25958fca15da67b8e0a6b9bdfe674a5139/cli/src/device/emulator.py#L135

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 1130, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 760, 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 159, in start self.change_permission() File "/home/androidusr/docker-android/cli/src/device/emulator.py", line 141, 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.

Logs

No response

budtmo commented 1 year ago

Hi @RasmusDK ,

thank you for the issue. sudo access will be given to pro version. as workaround you can remove the running container and bring a new one. I will close the issue as it is not a bug. feel free to reopen if needed.

RasmusDK commented 1 year ago

hi @budtmo,

Thank you for the quick followup. I had a feeling that you might answer as you did. No problem in that, and I won't reopen the issue.