April 14, 20251 yr Hey mods, please move this to the docker container support forum! I've messaged Squid to ask for this to be published in the community apps repository. Dockerhub: https://hub.docker.com/repository/docker/robotfishe/scrcpy-web/ Github (Dockerfile and scripts): https://github.com/robotfishe/scrcpy-web Github (CA XML): https://github.com/robotfishe/robotfishe-unraid-apps/blob/main/scrcpy-web.xml This is a niche project but I figured it might be useful to someone out there. In a nutshell, this docker container lets you plug an Android device into your Unraid server and access it remotely with a VNC client. It uses scrcpy to get video output from the device over adb (Android debug bridge), which has the advantage of not registering as a "screen recording app" in Android the same way that e.g. TeamViewer does. That means that under certain circumstances (in my experience, Android version 12 and below) you will be able to remote control apps that normally prevent screen recording. The reason I set this up is that I daily drive a rooted Android phone and refuse to give up my UI tweaks, system-wide adblocking, and other root stuff just because banks don't like me acting like the owner of my own device. I've got my old Pixel 4 with a completely stock install of Android 11 plugged into my Unraid box, and now I can remote into it from my "real" phone any time I need to use a financial app or anything else that breaks with an unlocked bootloader. The framerate and latency are pretty bad, but fine for checking my Virgin Money UK credit card that has no website and forces you to use the app. You can set the VNC display resolution and password (if desired) in environment variables, along with arguments to be appended to the scrcpy command. I suggest keeping "-wS" in the SCRCPY_ARGS as this will turn the physical device screen off while also preventing the remote display output from sleeping. See below for info on the other flag that's in SCRCPY_ARGS by default, which is currently mandatory. A couple of things to be aware of: This container must, obviously, have complete access to your phone as a USB device. The template uses "--device /dev/bus" to accomplish this, which is a compromise between security and compatibility. The --device flag is relatively new to Docker, but I'm not sure exactly how new or under what circumstances it will break. If you have issues, you can try deleting that option and running the container as "privileged" instead, but note that this is less secure. On the other hand, if you want additional security, you can try to identify which device under /dev/bus is your target Android device and only give the container access to that. scrcpy can share audio from your Android device to your client as well, but I haven't implemented that on the VNC side in this container. Might fiddle with it at some point in the future, but it's not a priority for my use case. What that means is that unless you are making significant changes to the container, you must include the "--no-audio" option in the SCRCPY_ARGS environment variable. Without this, scrcpy will try to send audio, find that it's got no audio output available, and error out. You need to activate developer options and USB debugging on your Android device. The first time you run this, you will also need to approve the debug connection using your Android device's physical screen. Make sure you check the "always allow from this computer" box. Edited April 14, 20251 yr by robotfishe
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.