Back in August, @MartijnBraam started packaging Anbox but got stuck somewhere in the process. I just rebased the branch to the latest master and updated some dependencies.
However one of it's dependencies, dbus-cpp, fails to compile (we package it ourselves). We're guessing it's a musl problem, which might make this quite hard to resolve.
[ 4%] Building CXX object src/core/dbus/CMakeFiles/dbus-cpp.dir/fixture.cpp.o/home/pmos/build/src/build/src/core/dbus/fixture.cpp:26:29: fatal error: core/posix/exec.h: No such file or directory #include <core/posix/exec.h> ^compilation terminated.make[2]: *** [src/core/dbus/CMakeFiles/dbus-cpp.dir/build.make:63: src/core/dbus/CMakeFiles/dbus-cpp.dir/fixture.cpp.o] Error 1make[1]: *** [CMakeFiles/Makefile2:1451: src/core/dbus/CMakeFiles/dbus-cpp.dir/all] Error 2make: *** [Makefile:141: all] Error 2
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related.
Learn more.
[ 11%] Building CXX object src/CMakeFiles/process-cpp.dir/core/posix/child_process.cpp.oIn file included from /usr/include/fortify/stdio.h:20:0, from /usr/include/c++/6.4.0/cstdio:42, from /usr/include/c++/6.4.0/ext/string_conversions.h:43, from /usr/include/c++/6.4.0/bits/basic_string.h:5417, from /usr/include/c++/6.4.0/string:52, from /usr/include/c++/6.4.0/stdexcept:39, from /usr/include/c++/6.4.0/array:39, from /usr/include/c++/6.4.0/tuple:39, from /usr/include/c++/6.4.0/functional:55, from /usr/include/core/connection.h:21, from /usr/include/core/signal.h:21, from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/signal.h:24, from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/signalable.h:22, from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/process_group.h:22, from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/process.h:22, from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/child_process.h:22, from /home/pmos/build/src/process-cpp-3.0.1/src/core/posix/child_process.cpp:19:/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:36:5: error: expected identifier before '(' token stdin = 1 << 0, ^/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:36:5: error: expected '}' before '(' tokenIn file included from /home/pmos/build/src/process-cpp-3.0.1/include/core/posix/child_process.h:23:0, from /home/pmos/build/src/process-cpp-3.0.1/src/core/posix/child_process.cpp:19:/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:36:18: error: cannot convert 'int' to 'core::posix::StandardStream' in initialization stdin = 1 << 0, ^/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:37:19: error: cannot convert 'int' to 'core::posix::StandardStream' in initialization stdout = 1 << 1, ^/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:38:19: error: cannot convert 'int' to 'core::posix::StandardStream' in initialization stderr = 1 << 2 ^/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:39:2: error: extra ';' [-Werror=pedantic] }; ^/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:41:23: error: 'StandardStream' does not name a type CORE_POSIX_DLL_PUBLIC StandardStream operator|(StandardStream l, StandardStream r); ^~~~~~~~~~~~~~/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:42:23: error: 'StandardStream' does not name a type CORE_POSIX_DLL_PUBLIC StandardStream operator&(StandardStream l, StandardStream r); ^~~~~~~~~~~~~~/home/pmos/build/src/process-cpp-3.0.1/include/core/posix/standard_stream.h:44:1: error: expected declaration before '}' token } ^cc1plus: all warnings being treated as errorsmake[2]: *** [src/CMakeFiles/process-cpp.dir/build.make:87: src/CMakeFiles/process-cpp.dir/core/posix/child_process.cpp.o] Error 1make[1]: *** [CMakeFiles/Makefile2:1036: src/CMakeFiles/process-cpp.dir/all] Error 2make: *** [Makefile:141: all] Error 2
That would be the macro inserting a ( as @ollieparanoid surmised. Apparently the standard does say these symbols should be macros, but my GNU libc stdio.h defines them without parens. The parens muck up the enum definition, I think.
Maybe the best solution is inserting your own stdio.h into process-cpp's internal include path (don't install it to the system), which does something like this (untested):
Thanks for the hint @scintill, that helped so much! I ended up adding 3 #undef line just before the namespace that failed to compile in standard_stream.h and that did the trick. With linking against execinfo to fix undefined reference errors for backtrace stuff (which is present in glibc, but not in musl) and fixing one uint -> unsigned int, the process-cpp package compiles now.
dbus-cpp was an easy fix as well, I only needed to change the subpackages.
Now it starts compiling anbox and fails because lxc is missing or something.
I've rebased the branch and applied the fixes.
Awesome job! Up to the next error, we're close now!
[100%] Linking CXX executable anbox/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot open output file anbox: Is a directorycollect2: error: ld returned 1 exit status
Note that I disabled unit tests entirely, as it requires a framework called gmock which I failed to get to install as of yet. I might look into it again later, but I feel it isn't as important.
@ollieparanoid suggested trying to build outside of the source directory. That did seem to resolve above linking error, but a new one occurs.
[100%] Linking CXX executable anbox/usr/lib/gcc/x86_64-alpine-linux-musl/6.4.0/../../../../x86_64-alpine-linux-musl/bin/ld: ../external/process-cpp-minimal/src/libprocess-cpp.a(backtrace.cpp.o): undefined reference to symbol 'backtrace_symbols'//usr/lib/libexecinfo.so.1: error adding symbols: DSO missing from command linecollect2: error: ld returned 1 exit statusmake[2]: *** [src/CMakeFiles/anbox.dir/build.make:119: src/anbox] Error 1make[1]: *** [CMakeFiles/Makefile2:2134: src/CMakeFiles/anbox.dir/all] Error 2make: *** [Makefile:130: all] Error 2
Also, using -j1 (which I did for above) gives me vastly different results than not specifying -j at all.
When doing the latter I get the following:
[ 31%] Linking CXX static library librenderControl_dec.aIn file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLEScontext.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/GLEScontext.cpp:17:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:18:56: fatal error: OpenGLESDispatch/gles_extensions_functions.h: No such file or directory #include "OpenGLESDispatch/gles_extensions_functions.h" ^compilation terminated.make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:111: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/GLEScontext.cpp.o] Error 1make[2]: *** Waiting for unfinished jobs....In file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/GLDispatch.cpp:17:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:18:56: fatal error: OpenGLESDispatch/gles_extensions_functions.h: No such file or directory #include "OpenGLESDispatch/gles_extensions_functions.h" ^compilation terminated.In file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLEScontext.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLESvalidate.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/GLESvalidate.cpp:17:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:18:56: fatal error: OpenGLESDispatch/gles_extensions_functions.h: No such file or directory #include "OpenGLESDispatch/gles_extensions_functions.h" ^compilation terminated.make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:63: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/GLDispatch.cpp.o] Error 1make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:135: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/GLESvalidate.cpp.o] Error 1In file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLEScontext.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/TextureUtils.h:21, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/TextureUtils.cpp:16:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:18:56: fatal error: OpenGLESDispatch/gles_extensions_functions.h: No such file or directory #include "OpenGLESDispatch/gles_extensions_functions.h" ^compilation terminated.make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:231: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/TextureUtils.cpp.o] Error 1[ 31%] Built target renderControl_decGenerating /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/build/external/android-emugl/host/include/OpenGLESDispatch/gles1_only_functions.h[ 31%] Built target xdg_testGenerating /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/build/external/android-emugl/host/include/OpenGLESDispatch/gles1_extensions_functions.hGenerating /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/build/external/android-emugl/host/include/OpenGLESDispatch/gles2_only_functions.hIn file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLEScontext.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/objectNameManager.cpp:18:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:21:51: fatal error: OpenGLESDispatch/gles2_only_functions.h: No such file or directory #include "OpenGLESDispatch/gles2_only_functions.h" ^compilation terminated.make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:303: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/objectNameManager.cpp.o] Error 1Generating /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/build/external/android-emugl/host/include/OpenGLESDispatch/gles2_extensions_functions.hIn file included from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLDispatch.h:23:0, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/include/GLcommon/GLEScontext.h:20, from /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/libs/Translator/GLcommon/FramebufferData.cpp:19:/home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/external/android-emugl/host/include/OpenGLESDispatch/gles_functions.h:22:57: fatal error: OpenGLESDispatch/gles2_extensions_functions.h: No such file or directory #include "OpenGLESDispatch/gles2_extensions_functions.h" ^compilation terminated.make[2]: *** [external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/build.make:327: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/FramebufferData.cpp.o] Error 1make[1]: *** [CMakeFiles/Makefile2:1573: external/android-emugl/host/libs/Translator/GLcommon/CMakeFiles/GLcommon.dir/all] Error 2make[1]: *** Waiting for unfinished jobs....Generating /home/pmos/build/src/anbox-03f69c8685e8e05a8c296896431d0645da831092/build/external/android-emugl/host/include/OpenGLESDispatch/gles3_only_functions.h[ 32%] Linking CXX static library libanbox-protobuf.a[ 32%] Built target GLHeaders[ 32%] Built target anbox-protobufmake: *** [Makefile:130: all] Error 2
@PureTryOut: could you upload your latest version uploaded to the feature/anbox branch? I've just tried it, but I hit the cannot open output file anbox: Is a directory error which is already solved in your latest post.
That would be awesome indeed. I believe there are just a few things left to be done:
write an OpenRC service file, so far there are only systemd ones out there
write a .desktop file
create a basic Android image to use in Anbox
I don't have any experience with OpenRC init files really. I could learn how to do it, but it might be better if someone else tried.
We can take the .desktop file from Arch here.
For the Android image we could use the pre-built one by the Anbox project, but I'm not sure if we want that (we probably do as building our own image has some insane pc requirements).
EDIT: It seems I had a .desktop file locally, just uncommitted. I pushed it to the branch.
Right now it fails to build again, it seems some Boost libraries are updated. Some C++ experts out here?
In file included from /home/pmos/build/src/anbox-f68725cff813700e448fb3b2f3d57d88e2c7daae/src/anbox/cmds/session_manager.cpp:56:0:/usr/include/core/dbus/asio/executor.h:29:7: error: using typedef-name 'boost::asio::io_service' after 'class' class io_service; ^~~~~~~~~~In file included from /usr/include/boost/asio.hpp:69:0, from /home/pmos/build/src/anbox-f68725cff813700e448fb3b2f3d57d88e2c7daae/src/anbox/runtime.h:21, from /home/pmos/build/src/anbox-f68725cff813700e448fb3b2f3d57d88e2c7daae/src/anbox/audio/server.h:21, from /home/pmos/build/src/anbox-f68725cff813700e448fb3b2f3d57d88e2c7daae/src/anbox/cmds/session_manager.cpp:26:/usr/include/boost/asio/io_service.hpp:27:20: note: 'boost::asio::io_service' has a previous declaration here typedef io_context io_service; ^~~~~~~~~~make[2]: *** [src/CMakeFiles/anbox-core.dir/build.make:1363: src/CMakeFiles/anbox-core.dir/anbox/cmds/session_manager.cpp.o] Error 1make[1]: *** [CMakeFiles/Makefile2:2088: src/CMakeFiles/anbox-core.dir/all] Error 2make: *** [Makefile:130: all] Error 2
As discussed in #postmarketOS, I think it would be good to make it work with the pre-built Android images first (possibly look into building our own ones later if it makes sense). That leaves the OpenRC service and .desktop files. Could you take a shot at them?
Slowly making progress, here's the first screenshot!
That's the part running as user and it's saying in the terminal that it can't connect to the session daemon and then gives up after a few seconds, but still it's satisfying to have at least some visual
Status:
Container manager starts, mounts the android image and runs in background
Session manager doesn't run yet: it requests a new container from container manager, and the container can't be set up because of an error coming from lxc (it would fail earlier because a fifo can not be set up, but I have a workaround for that now).
lxc_cgfs - cgroups/cgfs.c:cgfs_init:2363 - cgroupfs failed to detect cgroup metadata
I've added a service file, some post-install and post-deinstall hooks and made the loop kernel module autoload, so step 1 in README.anbox now happens automatically on boot.
However, I don't get to the point you have gotten @ollieparanoid (using the instructions in README.anbox). When I try to load anbox session-manager I just get the following:
[ 2018-04-30 14:33:27] [client.cpp:49@start] Failed to start container: Failed to start container: Failed to start container
[ 2018-04-30 14:33:27] [session_manager.cpp:162@operator()] Lost connection to container manager, terminating.
Nothing happens on the screen either. Also, the result isn't any different if I don't create the fifo file.
Thanks for the streamlining! Yeah, the session manager does not work yet, I get the same output and from anbox session-manager. And /var/lib/anbox/logs/container.log has the real error message:
Current fatal error in step 4:
lxc_cgfs - cgroups/cgfs.c:cgfs_init:2363 - cgroupfs failed to detect cgroup metadata
The loading screen appears, when you just ignore that and try to launch an Android app anyway (and of course it fails because session manager is not running):
My understanding is, that the container manager uses the LXC library to set up the containers. And it passes a bunch of configuration variables to LXC (which is quite readable when looking at the anbox source actually), and one of them is lxc.cgroup.use. This variable is empty, and then in the LXC code lxc_cgroup_load_meta() fails because it is empty. I had something along the lines of that noted down, but I didn't have time yet to look into it further.
Also right now we are running anbox in privileged mode, which means the container manager and session manager need root rights as I understand, but we could also make it run without root rights which would be better of course. The official snap packaging uses the non-privileged mode as well from what I can tell. In the anbox code, it passes different configuration options to LXC, so this might even avoid the error above.
Finally, another idea for debugging I had was installing Ubuntu in a VM and running anbox there as snap (which is the supported installation method by upstream), then figuring out what the value for lxc.cgroup.use is in Ubuntu, so we can emulate it. The config options may also be set by a global config file or something, so I'm not entirely sure how it would work in Ubuntu.
Damn, that is disappointing... Besides the musl issue, is sd-bus even usable without systemd? Hopefully we can convince him to use a different dbus binding.
I just rebased the feature/anbox branch on the latest master, it hadn't been touched for a year lol. Thanks for your work so far @GrantM11235, hopefully we can get Anbox running any time soon.
I've noticed you added a (removed by upstream) udev rules file to basically modprobe(?) the required kernel modules. Might it not be preferable to built those modules in the kernel? If anything, we should at least make anbox-modules a separate package.
I manage to get past the LXC "cannot start" error using:
# this fails, as there is no container to start; but it seems to fix something related to cgroups?sudo rc-service lxc start# the command from `rc-service anbox-container-manager start`sudo anbox container-manager --priviledged--data-path=/var/lib/anbox/
(with service anbox-container-manager disabled)
But then when I run anbox session-manager, it seems to work correctly but a lot of errors appear in /var/lib/anbox/logs/console.log (EDIT: I posted a better log latter. For reference, here is the long, old one and an extract)
Now, anbox session-manager keeps trying to start the session, but fails. anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity waits for the session manager a bit then give up.
It seems to go fairly far, though, as I could enable the network bridge using https://github.com/anbox/anbox/issues/270: ip addr shows a new interface vethU4WD5X@if11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master anbox0 state UP group default qlen 1000
I've definitely got post the LXC problem: the last line in /var/lib/anbox/logs/container.log is lxccontainer - lxccontainer.c:wait_on_daemonized_start:877 - Container is in "RUNNING" state. That's great!
Now the following error seems to be the blocking one:
12-30 22:43:20.379 105 105 E System : ******************************************12-30 22:43:20.380 105 105 E System : ************ Failure starting system services12-30 22:43:20.380 105 105 E System : java.lang.RuntimeException: Failed to create service com.android.server.am.ActivityManagerService$Lifecycle: service constructor threw an exception12-30 22:43:20.380 105 105 E System : at com.android.server.SystemServiceManager.startService(SystemServiceManager.java:103)12-30 22:43:20.380 105 105 E System : at com.android.server.SystemServer.startBootstrapServices(SystemServer.java:419)12-30 22:43:20.380 105 105 E System : at com.android.server.SystemServer.run(SystemServer.java:332)12-30 22:43:20.380 105 105 E System : at com.android.server.SystemServer.main(SystemServer.java:219)12-30 22:43:20.380 105 105 E System : at java.lang.reflect.Method.invoke(Native Method)12-30 22:43:20.380 105 105 E System : at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)12-30 22:43:20.380 105 105 E System : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)12-30 22:43:20.380 105 105 E System : Caused by: java.lang.reflect.InvocationTargetException12-30 22:43:20.380 105 105 E System : at java.lang.reflect.Constructor.newInstance0(Native Method)12-30 22:43:20.380 105 105 E System : at java.lang.reflect.Constructor.newInstance(Constructor.java:430)12-30 22:43:20.380 105 105 E System : at com.android.server.SystemServiceManager.startService(SystemServiceManager.java:92)12-30 22:43:20.380 105 105 E System : ... 6 more12-30 22:43:20.380 105 105 E System : Caused by: java.lang.IllegalArgumentException: Invalid argument: 10512-30 22:43:20.380 105 105 E System : at android.os.Process.setThreadGroup(Native Method)12-30 22:43:20.380 105 105 E System : at com.android.server.UiThread.<init>(UiThread.java:35)12-30 22:43:20.380 105 105 E System : at com.android.server.UiThread.ensureThreadLocked(UiThread.java:40)12-30 22:43:20.380 105 105 E System : at com.android.server.UiThread.get(UiThread.java:49)12-30 22:43:20.380 105 105 E System : at com.android.server.am.ActivityManagerService$UiHandler.<init>(ActivityManagerService.java:1607)12-30 22:43:20.380 105 105 E System : at com.android.server.am.ActivityManagerService.<init>(ActivityManagerService.java:2629)12-30 22:43:20.380 105 105 E System : at com.android.server.am.ActivityManagerService$Lifecycle.<init>(ActivityManagerService.java:2603)12-30 22:43:20.380 105 105 E System : ... 9 more12-30 22:43:20.380 105 105 D AndroidRuntime: Shutting down VM
It seems to be a problem with Zygote, which is part of the Android image. I wonder if another image would work better. It seems odd that the image would not know how to talk to itself, especially as it works elsewhere.
The odd part is that the invalid argument is different each time, "105", "152", "196", "240", "284", "329". It seems like it is increasing by between 40 and 50 each time. It looks a bit like an amount of process started in the LXC container between two attempts.
I obtained this one by running anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity without running the session manager before.
At that time, I could get adb shell to run, but anbox could not start the application manager. It was apparently because the Android Application Manager could not start Zygote, the "app embryo" from which all apps are forked. I couldn't adb install either.
After @afontain's MR is merged into the anbox branch, it seems like a good idea to me to create a new MR to merge the anbox branch into master.
Because then we don't need to deal with two branches anymore, and contributions should become easier (e.g. rebasing the kernel with that one change is annoying).
I'd suggest only merging the kernel change, or the kernel change and the two dependencies; but not anbox. It brings the same benefits, and allows merging Anbox itself only when it'll be functional.
I also believe the two dependencies (and maybe Anbox too!) should be merged to Alpine itself, if possible. I could do the upstreaming work for that, if you want.
I'd suggest only merging the kernel change, or the kernel change and the two dependencies; but not anbox. It brings the same benefits, and allows merging Anbox itself only when it'll be functional.
Fine with me, would you like to make MRs to prepare the kernel change + two dependencies to get merged into master?
I also believe the two dependencies (and maybe Anbox too!) should be merged to Alpine itself, if possible. I could do the upstreaming work for that, if you want.
If you are willing to maintain it in Alpine, then it would be great. But I'd still wait with that, until it is at least somewhat usable in postmarketOS, otherwise the dependencies aren't really useful in Alpine either.
we do create a network interface automatically using network manager as of now (anbox-networkmanager subpackage). It would be nice to do it with openRC's networking scripts, as network manager isn't everyone's favourite and the current way has an issue: network manager needs to be started, so installation can't be done at pmbootstrap install stage;
I checked if it works with binderfs: the answer is that it actually doesn't work;
we autoenable the container manager with the postmarketos-anbox metapackage.
also, the out of the box support is much better, as I got F-Droid bundled into the android image, as a privileged system app. That way, there is no need for adb install FDroid.apk or to enable installation from unknown sources!
The big downside is that, as of now, it seems to only work on my computer.
6 days after the previous status report, progress has been made:
I updated two pmOS kernel configs: linux-postmarketos-stable and linux-postmarketos-allwinner (the latter being used for the pinephone);
I managed to make Anbox work out of the box on x86_64, at least for linux-postmarkeos-stable with my computer and device-tablet-x64uefi;
I found a way to compile Anbox on every architecture supported by postmarketOS, which is great! I sent a PR and opened an issue upstream, which is awaiting an answer;
@Minecrell could build newer versions of the Android images, which means the images will be more up to date and that they will all come from the same release: this will help avoid bugs creeping up because the images are different;
I could get Anbox merged into Alpine;
There is still work though:
Anbox doesn't work under QEMU yet (tried on both x86_64 and aarch64)
Nobody has succeeded running Anbox on his device so far, including x86_64 (the last attempts were before I managed to make it work out of the box);
I have yet to see the Wayland backend functionning.
Although I tried to make it work on my pinephone, there has been no success made so far to run Anbox on any ARM device. I'll try again with Minecrell's image later.
Later will also come considerations such as "how can we make the virtual keyboard pop out on plasma mobile" (phosh should work fine) or "how to force the wayland backend so that it can fit in phosh and not look blurry" or "how to issue a back button" (that's done using the escape key on desktop).