I hope you’re doing well. I have a couple of questions and feature suggestions regarding Anbox Cloud:
ADB Connection Issues on AWS:
I’ve noticed an issue when running an instance on an AWS machine. After about 5 minutes, the ADB connection stops working, and attempting to reconnect results in a “connection refused” error. Even after attempting to restart the ADB daemon on the device, the problem persists. This happens both when exposing the ADB service using +adb and when using anbox-connect. Could you provide any guidance on why this might be happening and how to resolve it?
Event Dispatcher for Anbox Events:
Is there an event dispatcher or any sort of notification system in Anbox Cloud that can alert us when certain events occur, such as when a container is created, stopped, deleted, or encounters an error? If this feature does not exist, I’d like to propose it as it would be extremely useful for managing Anbox servers.
Using anbox-connect in Docker:
Running anbox-connect inside a Docker container has been quite challenging due to the following issues:
The Snap Store cannot be used within Docker, making it impossible to install anbox-connect directly.
The binary is dynamically compiled, which complicates copying it into the container as all necessary libraries need to be linked manually.
To address this problem, I have a few suggestions:
Option 1: Develop a library (perhaps in Go, given that anbox-connect is likely written in Go) to allow programmatic connection to instances.
Option 2: Distribute a statically compiled version of anbox-connect to avoid issues with missing libraries.
Option 3: Make anbox-connect available via other package managers like apt, apk, etc., to simplify installation in different environments.
Unable to Register Services Using .rc Files After 1.23 Update:
After updating to version 1.23, it is no longer possible to register services using .rc files copied into /system/etc/init/ via the pre-start hook. This was working correctly in previous versions. For your reference, here’s the .rc file and shell script I’m trying to use:
frida-server.rc:
service frida /data/local/tmp/frida-server.sh
class main
user root
oneshot
frida-server.sh:
#!/bin/sh
# Check if frida-server is running
if ! pgrep -x "frida-server" >/dev/null
then
# Start frida-server
/data/local/tmp/frida-server &
fi
I hope you find these suggestions and observations helpful, and I’m happy to assist in any way I can. Please let me know if you need more details or logs regarding any of these issues.
Thanks a lot for your feedback, this is very valuable!
Let me answer for each point separately.
ADB Connection Issues on AWS:
Could you tell us a bit more about this issue? Is it happening for all instances? If you have an easy way to reproduce it, it would be perfect. Otherwise, could you please provide the logs (anbox and android) from a malfunctioning instance?
Event Dispatcher for Anbox Events:
This is already supported, please take a look at either:
amc monitor for the CLI. Please run amc monitor --help to have a bit of an explanation as it’s (unfortunately) not well-documented at the moment (see LP#2081989)
the 1.0/events endpoint of the AMS HTTP API
If none of these fulfill your needs, please let us know what we can improve.
Using anbox-connect in Docker:
The anbox-connect binary should be statically linked already:
$ file /snap/anbox-connect/current/bin/anbox-connect
/snap/anbox-connect/current/bin/anbox-connect: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=DvqZ_ccczPHsi9zIb6bE/vw1-pNrUrzZq72Gr5Lu_/DR3UKgavS0S5ydPR8b2u/SQI01R2--CveSkIWnLHf, with debug_info, not stripped
Would you mind sharing what base Docker image you are using? We have copied the binary inside Ubuntu docker images on our side, and it seemed to be working.
Unable to Register Services Using .rc Files After 1.23 Update:
As far as I can tell, this should still be working. Could you please share the Anbox and Android logs for that instance? That would help tremendously!
Thanks again for your feedback and your questions, this is very useful to us!
Also, if you are interested in investigating these issues with us, feel free to come have a chat in our Matrix room! It’s (sadly) a bit empty for now, but we would be happy to chat with you there!
ADB Connection Issues on AWS: I’ve attached the logs from an instance that is experiencing both issues 1 and 4, as this problem occurs across all instances.
Event Dispatcher for Anbox Events: Thank you for the pointers! It would be fantastic if this could be integrated into the AMS SDK in the future.
Using anbox-connect in Docker: I retried it, and it’s indeed working now. I’m not sure why I faced linking issues with libc earlier. Nevertheless, I believe distributing anbox-connect via other package managers could be helpful for others to avoid copying the binary directly into Docker containers.
Unable to Register Services Using .rc Files After 1.23 Update: As mentioned, I’m attaching the relevant logs for this issue as well.
After updating to Anbox Cloud 1.25, I have encountered a new issue with ADB connections. Previously, multiple clients could connect to the same device simultaneously without any problems. However, after the update, only one ADB client can be connected at a time.
Could you double-check the image version being used by the applications? Was it 1.24.1 or 1.24.2?
As you mentioned, you are also using anbox-connect to create ADB connections with active sessions. Would you mind sharing how many URLs you have created at most per session in your use case so far?
$ amc image show cth9b7reevh5vc947c90
id: cth9b7reevh5vc947c90
name: jammy:android13:arm64
status: active
versions:
3:
size: 635.67MB
created-at: 2025-02-13 11:11:40 +0100 CET
status: active
remote_id: 1.25.0-20250206152014.git19dfacfa5
used_by:
- cuqv6k3eevh9oq21k4ug
default: false
architecture: aarch64
type: container
variant: android
I’ve created at most 2 URLs, having 2 successful concurrent connections. The problem arises when I try to do the same via the ADB service exposed using -s +adb while launching a new container.
Okay, it looks like the image has been refreshed to 1.25.0-20250206152014 after your upgraded to 1.25. I’ll try it locally and get back to you later.
As for the second question, I’m asking in a more general sense: how many presigned URLs (or shares) do you usually create per session? Since you’ve upgraded to Anbox Cloud 1.25.0, you can check this by running:
anbox-stream-gateway session list
or (if your deployment is based on anbox-cloud-appliance)
sudo anbox-cloud-appliance.gateway share list
I’m asking because starting with version 1.25.1 (the next release, targeting March 12th), each session will be limited to creating a maximum of 5 shares.
I usually don’t create URLs because my application still relies on the exposed ADB service. However, for testing purposes related to this issue, I generated two presigned links for a test container to check whether two ADB clients could connect to the same device simultaneously—and it worked.
As mentioned earlier, the issue only occurs when using the exposed ADB service.
If your question was specifically about the upcoming connection limit in v1.25.1, I can confirm that my application won’t create more than two connections per container.
We’ve tested the 1.23, 1.24, and 1.25 images, and the behavior aligns across these versions: only one client can be connected at a time. When trying to initiate another ADB connection from a different machine, it remains pending until the first client disconnects (e.g., adb disconnect).
I’m now wondering why the case where multiple clients can connect to the same device simultaneously is happening on your end. Are you using an appliance or charm-based deployment? From which version did you upgrade to 1.25?