Anbox on KDE Community Edition (Manjaro)
#1
This thread is being started to document the trials and tribulations of installing Anbox on my Pinephone.  Likewise, it would be an honor to learn from those who blazed the trail before me.

I managed to install Anbox through pacman by switching to the unstable branch.  (It seems that the unstable branch also has a few fixes to other software that have been helpful, but maybe adding an extra bug or two.  I'm not entirely sure, but I digress.)

This is not recommended if you are squeamish about experimental software.

Code:
sudo vim /etc/pacman-mirrors.conf


(I am still not sure what the default text editor for Manjaro is, but I am a Vi guy.) I changed changed the branch here from "Branch=arm-stable" to "Branch=arm-unstable", on line 6.  I saved the changes and exited the application.

Code:
sudo pacman-mirrors -f5 && sudo pacman -Syyu

This changed my mirrors and updated my operating system software to the unstable branch.  This was scary, but it worked for me (as in it did not brick my phone).

Now for the main course:

Code:
sudo pacman -S anbox-image-aarch64 anbox android-tools

It installed Anbox without issue.  I saw the Anbox logo among my application icons.  I clicked it and got a grey screen, followed by a crash.  Fair enough.

Code:
anbox system-info
Quote:version: danctnix-0_git20201130-r2
cpu:
  arch: 
  brand:
  features:
os:
  name: Manjaro-ARM
  version:
  snap-based: false
kernel:
  version: Linux version 5.10.13-1.0-MANJARO-ARM (builduser@on2-runner) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Fri Feb 5 15:29:57 UTC 2021
  binder: false
  ashmem: true
graphics:
  egl:
    vendor: Mesa Project
    version: 1.4
    extensions:
      - EGL_ANDROID_blob_cache
      - EGL_ANDROID_native_fence_sync
      - EGL_EXT_buffer_age
      - EGL_EXT_image_dma_buf_import
      - EGL_EXT_image_dma_buf_import_modifiers
      - EGL_EXT_swap_buffers_with_damage
      - EGL_KHR_cl_event2
      - EGL_KHR_config_attribs
      - EGL_KHR_create_context
      - EGL_KHR_create_context_no_error
      - EGL_KHR_fence_sync
      - EGL_KHR_get_all_proc_addresses
      - EGL_KHR_gl_colorspace
      - EGL_KHR_gl_renderbuffer_image
      - EGL_KHR_gl_texture_2D_image
      - EGL_KHR_gl_texture_3D_image
      - EGL_KHR_gl_texture_cubemap_image
      - EGL_KHR_image_base
      - EGL_KHR_no_config_context
      - EGL_KHR_partial_update
      - EGL_KHR_reusable_sync
      - EGL_KHR_surfaceless_context
      - EGL_KHR_swap_buffers_with_damage
      - EGL_EXT_pixel_format_float
      - EGL_KHR_wait_sync
      - EGL_MESA_configless_context
      - EGL_MESA_drm_image
      - EGL_MESA_image_dma_buf_export
      - EGL_MESA_query_driver
      - EGL_WL_bind_wayland_display
      - EGL_WL_create_wayland_buffer_from_image
  gles2:
    vendor: n/a
    vendor: n/a
    extensions: []


This is about as far as I have gotten.  I believe binder should be enabled.  There is more work to be done.  I would like to eventually install an android package manager into Anbox and see if it will work.  I will keep you informed of the results.  Any input is greatly appreciated.
  Reply
#2
I started by trying to install binder via this method.


Code:
sudo apt install dkms

git clone https://github.com/neil2ball/anbox-modules

cd anbox-modules

sudo cp anbox.conf /etc/modules-load.d/

sudo cp 99-anbox.rules /lib/udev/rules.d

sudo cp -rT binder /usr/src/anbox-binder-1

sudo dkms install anbox-binder/1

However, that failed.  Sources suggested that this might be the wrong approach.  So, I tried something else.

I also tried to connect the binder requirement with the available binderfs, but that did not work either.  Specificially, I used what follows.

Quote:
  • Create a unit file for binderfs

Code:
Code:
printf '%b' "[Unit]\nDescription=binderfs\n\n[Mount]\nWhat=binder\nWhere=/dev/binderfs\nType=binder\n\n[Install]\n" \

"WantedBy=anbox-container-manager.service\n" | sudo tee /etc/systemd/system/dev-binderfs.mount
  • Edit the anbox-container-manager.service unit file

Code:
Code:
sudo
sed -i 's/After=network.target/After=network.target
dev-binderfs.mount/' /lib/systemd/system/anbox-container-manager.service

sudo sed -i '6i Requires=dev-binderfs.mount' /lib/systemd/system/anbox-container-manager.service

sudo sed -i '\_^ExecStartPre=/sbin/modprobe_s_^_#_' /lib/systemd/system/anbox-container-manager.service
  • Reload the service

Code:
Code:
sudo systemctl daemon-reload

sudo systemctl restart anbox-container-manager.service && systemctl --user restart anbox-session-manager.service


I later tried replacing the android.img provided by pacman with the one linked in the above post, but that also did not work.




I continued to research, finding myself running into the error outlined here.



Quote:
Code:
[ 2020-09-05 14:53:13] [Renderer.cpp:190@initialize] Failed: Missing egl_image related extension(s)
Stack trace (most recent call last) in thread 124889:
#7    Object "", at 0xffffffffffffffff, in
#6    Object "/usr/lib/libc-2.32.so", at 0x7fa5959fd292, in __clone
#5    Object "/usr/lib/libpthread-2.32.so", at 0x7fa595d7c3e8, in start_thread
#4    Object "/usr/bin/anbox", at 0x55e8576ffce0, in emugl::Thread::thread_main(void*)
#3    Object "/usr/bin/anbox", at 0x55e857603982, in RenderThread::main()
#2    Object "/usr/bin/anbox", at 0x55e8576faa0e, in renderControl_decoder_context_t::decode(void*, unsigned long, IOStream*)
#1    Object "/usr/bin/anbox", at 0x55e8576712ee, in
#0    Object "/usr/bin/anbox", at 0x55e857674cd5, in RendererConfigList::getPackInfo(int*, int*) const
Segmentation fault (Address not mapped to object [(nil)])
zsh: segmentation fault (core dumped)  anbox session-manager


I tried the proposed fix of installing lxc-git, but that did not work either.


I found something else that I did not try, but it was an interesting point:

Quote:Well, you seem to be missing /usr/share/libdrm/amdgpu.ids. That's not Anbox's fault. This might help if you messed with your graphics drivers https://askubuntu.com/questions/971343/c...-ub#992654


However, there are still multiple variables that could be causing issues at this point.  One could still be the binder requirement.  If there is some way to get anbox to see binder through binderfs that works (assuming I did it right) that would at least eliminate one issue.  Another is perhaps needing graphics drivers; a theory based on gles2 having nothing listed when you run 'anbox session-info'.

Anyway, that is where i must leave it for now, but I shall return to it at some point.  I will check in to see if there is any input and take any suggestions as well as post the results.
  Reply
#3
I'd guess the modules are already included in a manjaro release but this thread might help you out.
  Reply
#4
Hello.

On this old thread i disscussed how to get Anbox up and working on plasma mobile.

https://forum.pine64.org/showthread.php?tid=11577


Regards!
  Reply
#5
(02-09-2021, 01:43 AM)paju1986 Wrote: Hello.

On this old thread i disscussed how to get Anbox up and working on plasma mobile.

https://forum.pine64.org/showthread.php?tid=11577


Regards!

Code:
sudo pacman -S anbox anbox-image
sudo systemctl start anbox-container-manager
env DISPLAY=:1 anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

[ 2021-02-19 02:21:51] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.NoReply] Message recipient disconnected from message bus without replying
  Reply
#6
I do have some partial success to report.  Be wary of old guides regarding binder.  I ended up wasting a lot of time on them.  Binder and Ashmem are loaded directly into new kernels.  This is why Ashmem is true when you run 'anbox system-info'.  The reason why the Binder section reports false is because binder itself is in a different location (/dev/binderfs/binder) than the one Anbox is looking for (/dev/binder).  So I made a diff patch providing the necessary changes in Anbox to make binder true, which cleared the stack trace that otherwise occurs when you run 'anbox session-manager'.  (Also, I took the liberty of updating the Anbox version to the 01/06/2021 commit.)  Here are the PKGBUILD and required files to make the magic happen.

Here is how 'anbox system-info' looks now:

Code:
version: danctnix-0_git20210106-r1
cpu:
  arch: 
  brand:
  features:
os:
  name: Manjaro-ARM
  version:
  snap-based: false
kernel:
  version: Linux version 5.11.0-0-MANJARO-ARM (builduser@odroid-n2plus-pm) (gcc (GCC) 10.2.0, GNU ld (GNU Binutils) 2.35) #1 SMP Wed Feb 17 17:16:01 UTC 2021
  binder: true
  ashmem: true
graphics:
  egl:
    vendor: Mesa Project
    version: 1.4
    extensions:
      - EGL_ANDROID_blob_cache
      - EGL_ANDROID_native_fence_sync
      - EGL_EXT_buffer_age
      - EGL_EXT_image_dma_buf_import
      - EGL_EXT_image_dma_buf_import_modifiers
      - EGL_EXT_swap_buffers_with_damage
      - EGL_KHR_cl_event2
      - EGL_KHR_config_attribs
      - EGL_KHR_create_context
      - EGL_KHR_create_context_no_error
      - EGL_KHR_fence_sync
      - EGL_KHR_get_all_proc_addresses
      - EGL_KHR_gl_colorspace
      - EGL_KHR_gl_renderbuffer_image
      - EGL_KHR_gl_texture_2D_image
      - EGL_KHR_gl_texture_3D_image
      - EGL_KHR_gl_texture_cubemap_image
      - EGL_KHR_image_base
      - EGL_KHR_no_config_context
      - EGL_KHR_partial_update
      - EGL_KHR_reusable_sync
      - EGL_KHR_surfaceless_context
      - EGL_KHR_swap_buffers_with_damage
      - EGL_EXT_pixel_format_float
      - EGL_KHR_wait_sync
      - EGL_MESA_configless_context
      - EGL_MESA_drm_image
      - EGL_MESA_image_dma_buf_export
      - EGL_MESA_query_driver
      - EGL_WL_bind_wayland_display
      - EGL_WL_create_wayland_buffer_from_image
  gles2:
    vendor: n/a
    vendor: n/a
    extensions: []

Now when I use the following command,

Code:
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

the app manager screen loads, does not crash, and no errors are to be found in the shell.  Of course it still does not do anything, but I will begin to address that later.


The same is true for

Code:
env DISPLAY=:1 anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

just in case you were wondering.


This brings me to 'anbox session-manager' and where to go from here.  As stated above, my patch cleared the stack trace.  However, I still get one warning from the shell:

Code:
[ 2021-02-21 15:31:35] [Renderer.cpp:128@initialize] Failed to select EGL configuration

According to later posts on anbox's github issues section, it was recommended to

Code:
export EGL_PLATFORM=x11

in the shell.  I tried this and ran 'anbox session-manager' again.  This cleared the error.  However, despite having nothing in the shell upon execution, no window launched.  Instead 'anbox session-manager' continued to run while nothing else visually happened.  The anbox github issues page mentioned graphics drivers.  Notice how 'gles2' has nothing in it when 'anbox system-info' is run.  EGL and OpenGL ES 2.0 (gles2) are closely related.  Therefore, my next step will be to figure out how to get anbox to see gles2.

That is all for now.  If you have any knowledge to contribute, please do!  It is a big help.  Thanks also to those who have already lent a hand, (that means you, nas & paju1986).
  Reply
#7
Update Qt5 OpenGL ES 2.0 packages


Quote:The current Qt5 OpenGL ES 2.0 packages (arm-unstable/extra/aarch64) are based on an outdated ICU version and thus fail on systems with the new version.

Would anyone in charge mind updating those packages like the normal Qt5 packages got updated a few days ago?


Quote:
Code:
qt5-es2-base
is the package which needs a rebuild. We might do that in January, as of now most of our developers and maintainers are on their holidays. @strit, @spikerguy, @oberon


https://gitlab.manjaro.org/manjaro-arm/p.../jobs/2239

Quote:rebuild is now in our repos: [manjaro-packages] [BoxIt] Memo (ARM) 11
  Reply
#8
https://github.com/anbox/anbox/issues/1714

[wayland support] replacing pbuffers #1270

Implement native Wayland support for Anbox
  Reply
#9
Why Wayland on Android is a hard problem

Hybris is a solution that commits hybris, by allowing us to use bionic-based HW adaptations in glibc systems 

Running Android next to Wayland

Sorry for all the links, but this is where the research is taking me.  It is a big problem, so it will take some time to come up with a solution.  I will continue to keep you posted as I find out more.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manjaro: Settings doesnt open nbh 0 498 09-24-2023, 05:25 PM
Last Post: nbh
  Can't get ring on Manjaro Pine Phone thorensjubilee 12 3,068 06-09-2023, 04:40 AM
Last Post: thorensjubilee
  Is Manjaro ARM a Rolling Release? jojuma 4 1,422 05-10-2023, 09:27 PM
Last Post: Kevin Kofler
  Where Does Manjaro Phosh Store Its Custom Keystrokes? jakfish 0 718 04-25-2023, 09:49 AM
Last Post: jakfish
Exclamation My short experience with Manjaro Plasma Mobile anonymous 10 4,357 03-02-2023, 07:25 PM
Last Post: Kevin Kofler
  Can't install Manjaro thorensjubilee 1 957 02-09-2023, 08:17 AM
Last Post: thorensjubilee
  Manjaro plasma-mobile Beta 13 Uturn 13 4,560 01-25-2023, 04:15 PM
Last Post: Kevin Kofler
  Manjaro Plasma busted Chief 2 1,479 11-22-2022, 05:00 PM
Last Post: Chief
  MMS workaround for users with separate APN (works atleast on Manjaro Phosh) alaraajavamma 0 1,010 10-10-2022, 12:53 PM
Last Post: alaraajavamma
Question Running AnBox on Manjaro ARM w/ Phosh? danimations 2 2,400 09-05-2022, 03:42 PM
Last Post: nroth

Forum Jump:


Users browsing this thread: 1 Guest(s)