Anbox on Byzanthium

I want to get Anbox on my Librem 5 (Byzanthium)

I followed these instructions; https://source.puri.sm/david.hamner/librem-5-anbox-setup but it did not work. All the required files are present in the /var/lib/anbox folder. Anbox gets installed but does not open up. It crashes.

Has anyone able to get it to work?

2 Likes

Here is the error from the /var/lib/anbox/logs/containers.log file

lxc-attach default 20220403032320.816 TRACE    commands - commands.c:lxc_cmd:301 - Connection refused - Command "get_init_pid" failed to connect command socket
lxc-attach default 20220403032320.816 ERROR    attach - attach.c:lxc_attach:981 - Failed to get init pid

Looks like there is some problem with the lxc or systemd

@dos, @david.hamner, Can you help with it?

These instructions are outdated. All you need to do is to install the deb from https://source.puri.sm/Librem5/debs/anbox and put android.img into /var/lib/anbox.

4 Likes

Byzanthium? Since when did it acquire a Castellano accent? Is it not Byzantium?

1 Like

@buzzLightyear were you able to get anbox running on Byzantinum?

I installed these packages:

Downloaded this android image to /var/lib/anbox

And this was the result: anbox does not read out the cpu architecture


and exits with this error
You're running Anbox on a not yet supported architecture

@dos is it ok to ping you for assistance on this?

Thanks

Hi guys, I’m new here and slowly getting familiar with the Librem 5.
Has anyone built an actual image? I can’t get Docker to run under my Arch.

I could not. I tried building from source as per the information at the https://source.puri.sm/Librem5/debs/anbox link but the image building fails. I tried building it on the phone itself so maybe that is a mistake but it does not work out.

Then I realized/discovered that there is a anbox package in the repository. (Try doing a apt-cache search anbox, the description says “Android in a Box”). I installed it and it shows up as an icon on the desktop.

When opened, the screen becomes all white and then the Anbox application crashes. Upon further analysis, the failure is because it cannot reach/start anbox-container-manager service. That was my logical end point for the weekend.

I tried copying the android.img file to the /var/lib/anbox location but it does not help. So, looks like the implementation is not complete. @dos can you provide more pointers for installation?

There is no anbox package in PureOS repositories.

There are no instructions there, the README comes from upstream project and isn’t relevant. You’re definitely not going to be able to build an image on the phone, it requires 60GB of disk space and 16GB of RAM.

I’ve build my image with https://source.puri.sm/sebastian.krzyszkowiak/anbox-image-builder/

The apt-get fails to find `gcc-multilib g+±multilib and some more libraries. I even tried changing to Ubuntu 20.04 in the Dockerfile. It still fails to find those libraries.

Hello together,

a friend built me the image with the


I copied it to /var/lib/anbox.

I loaded package-pureos-byzantium:arm64 from https://source.puri.sm/Librem5/debs/anbox and installed both files with sudo dpkg -i anbox*.

I have rebooted as described in the wiki.

now I can’t get any further.
i also get the error " You're running Anbox on a not yet supported architecture" with -system-info
and anbox does not start either.

do we need to start some services or so?

@dos It would be great if you could help us with what we are doing wrong or what steps are still missing.

@st.boom, how and where did you get the package-debian-buster:arm64?
I do not see the option mentioned in the

Current Screenshot view;

take the green hook.
here you go. https://source.puri.sm/Librem5/debs/anbox/-/pipelines/70654

@st.boom, I took the ARM image from this location; https://build.anbox.io/android-images/2017/08/04/ and copied it in the /var/lib/anbox location.
Next, I installed the two packages from the artifacts.zip file. The dpkg fails with unmet dependencies error. However, dpkg -l shows those two packages.
Then the Anbox icon is visible on desktop. When I try opening the Anbox application, I see following error;
purism@pureos:~$ anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2022-04-06 00:41:42] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files

Note the anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity command is from the Anbox.desktop file

If you are able to install the two files from artifacts.zip file then you might want to try the android.img file from the above link.

@dos, The 16 GB RAM / 60 GB hard disk only on Ubuntu 18.04 or 20.04 seems to be far fetched requirement. I have manjaro with 16 GB RAM and the compilation fails as mentioned in my earlier message. Can there be a easy way or can you offer any more suggestions?

@buzzLightyear
i get the same error as you, with my own image and the Image what you posted:
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2022-04-07 04:11:10] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files

I don’t get any errors when installing.

@dos, @david.hamner, Not sure if the android.img is proper but it does not throw any platform (amd64 or arm) error so I guess it is okay to use the img file from the https://build.anbox.io/android-images/2017/08/04/ location. I guess the anbox DEB package is also proper. Can you provide further instructions, directions on what else is needed to address the issue?

@dos, @david.hamner, can you provide some instructions, directions to the issues mentioned in this post?

1 Like

Is there anyone who was able to make the Anbox work on Byzanthium?

Yes, I’m using it regularly.

I’m going to try setting it up on a fresh phone when I find some time to see what are the pitfalls you guys are falling into.

4 Likes

good morning everyone,
I’ve done some research, hope it helps:

sudo systemctl status start anbox-container-manager 

not running
so i did:

sudo systemctl start anbox-container-manager
sudo systemctl status start anbox-container-manager

now active (running)
so now:

env ANBOX_LOG_LEVEL=debug anbox session-manager
[ 2022-04-10 08:34:17] [daemon.cpp:61@Run] Failed to initialize SDL: x11 not available

so I tried

export DISPLAY=:0
env ANBOX_LOG_LEVEL=debug anbox session-manager
[ 2022-04-10 08:41:46] [Renderer.cpp:165@initialize] Using a surfaceless EGL context
[ 2022-04-10 08:41:46] [Renderer.cpp:248@initialize] Successfully initialized EGL

so i tryed:

env ANBOX_LOG_LEVEL=debug anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2022-04-10 08:45:37] [launch.cpp:168@operator()] Session manager is not yet running, trying to start it
[ 2022-04-10 08:45:37] [launch.cpp:117@launch_session_manager] Started session manager, will now try to connect ..
[ 2022-04-10 08:47:23] [launch.cpp:202@operator()] Session manager failed to become ready


systemctl --user enable --now anbox-session-manager
Failed to enable unit: Unit file anbox-session-manager.service does not exist.

with my own image:

env ANBOX_LOG_LEVEL=debug anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2022-04-10 09:03:01] [launch.cpp:202@operator()] Session manager failed to become ready

Something is probably up.

purism@pureos:~$ adb install FDroid.apk
* daemon not running; starting now at tcp:5037
* daemon started successfully
Performing Streamed Install
Success
purism@pureos:~$ adb shell pm grant org.fdroid.fdroid android.permission.WRITE_EXTERNAL_STORAGE
purism@pureos:~$ adb shell pm grant org.fdroid.fdroid android.permission.READ_EXTERNAL_STORAGE
purism@pureos:~$ adb shell settings put secure install_non_market_apps 1
purism@pureos:~$ anbox launch --action=android.intent.action.MAIN --package=org.fdroid.fdroid --component=org.fdroid
.fdroid.views.main.MainActivity
[ 2022-04-10 09:24:18] [launch.cpp:202@operator()] Session manager failed to become ready

I’ve got it! It’s running!

first built the image with the:

copy it to /var/lib/anbox.

download the package “package-pureos-byzantium:arm64” from:

and install both files with:

sudo dpkg -i anbox*.

reboot the system. And after that do:

sudo systemctl enable anbox-container-manager
sudo systemctl start anbox-container-manager

check if it’r running:

sudo systemctl status start anbox-container-manager

do:
(is apparently only needed when starting from the console.)

export DISPLAY=:0

start anbox with the icon
after that:

adb install FDroid.apk
* daemon not running; starting now at tcp:5037
* daemon started successfully
   Performing Streamed Install
   Success

purism@pureos:~$ adb shell pm grant org.fdroid.fdroid android.permission.WRITE_EXTERNAL_STORAGE
purism@pureos:~$ adb shell pm grant org.fdroid.fdroid android.permission.READ_EXTERNAL_STORAGE
purism@pureos:~$ adb shell settings put secure install_non_market_apps 1 anbox launch --action=android.intent.action.MAIN --package=org.fdroid.fdroid --component=org.fdroid.fdroid.views.main.MainActivity

the onscreen keyboard does strange things.
When I press backspace, I get an = and stuff like that.
EDIT: only happens when you start from the console.

Otherwise it looks fine.

if you have installed an app go to /home/purism/.local/share/applications/anbox/
copy the desktop file of your app to /home/purism/.local/share/applications/
otherwise the changes will be undone by anbox.

open the desktop file.and change

NoDisplay=true to NoDisplay=false.

and add:

X-Purism-FormFactor=Workstation;Mobile;

Then the app is also displayed in the menu. And is also displayed under Mobile Apps.

4 Likes