Anbox: clone container


I need to start a new container with all applications data of another container.
Ex.: I have a whatsapp account logged in and I want to clone anbox data to another instance without repeat the login procedure.

Can I clone an anbox container?


Hey @dfelici87,

Can I clone an anbox container?

No, we currently do not support cloning existing instances. The best you can do is to backup what is in /var/lib/anbox/data and /var/lib/anbox/cache and restore on a new instance. The problem you potentially then run into is that the Android ID is changing. You can find details about a feature Anbox Cloud has on how to override the Android ID reported for a particular app here.

Let us know if there is anything else we can help with!

thanks for your answer!

I try to copy anbox/data and anbox/cache folders (zip/unzip) from one container to another container of the same application… but doesn’t work.

I have 2 anbox containers of the same application and the android_id are equal, ex.: 6bdf120d83caf882

Can you explain me how to set custom_android_id?

Where I set this flag android.allow_custom_android_id? in the application manifest.yml?


You need to be careful to restore file system permissions and ownership correctly. Android depends on correct ownership and permissions as apps get specified UIDs in the system. You can also look at which might be of hep here.

It’s a feature flag which you can set in the manifest.yaml. For example

name: my app

This will set the Android ID for the package to 32r23r23f

Just to correct this, according to AMS configuration | Anbox documentation, the feature flag that enables you to specify the custom Android ID is android.allow_custom_android_id. Therefore, to influence the Android ID of a specific app during the Android runtime, either through a system app or an anbox-shell command in a post-start hook of an addon, E.g.

anbox-shell setprop<custom_android_id>

you need to put the feature flag into the manifest file.

name: my app
- android.allow_custom_android_id


ok, it’s clear and thanks for your explanation.