You are not logged in.

#1 2020-12-02 13:07:03

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Anbox failed to start container

I was following the wiki page: https://wiki.archlinux.org/index.php/Anbox

I was already using a custom kernel so I rebuilt it with the Android drivers compiled in as described in the wiki.  I then installed the AUR packages anbox-git and anbox-image-gapps.

anbox-container-manager.service seems to start up fine but when I try to load anbox I get:

$ anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2020-12-02 12:49:19] [daemon.cpp:61@Run] [org.freedesktop.DBus.Error.ServiceUnknown] The name org.anbox was not provided by any .service files

Trying to load anbox session-manager, I get the "Failed to start container" error followed by a segfault.

$ anbox session-manager
[ 2020-12-02 12:42:03] [client.cpp:48@start] Failed to start container: Failed to start container: Failed to start container
[ 2020-12-02 12:42:03] [session_manager.cpp:161@operator()] Lost connection to container manager, terminating.
[ 2020-12-02 12:42:03] [daemon.cpp:61@Run] Container is not running
Stack trace (most recent call last) in thread 2406:
#7    Object "", at 0xffffffffffffffff, in 
#6    Object "/usr/lib/libc-2.32.so", at 0x7fbad4287292, in __clone
#5    Object "/usr/lib/libpthread-2.32.so", at 0x7fbad46343e8, in start_thread
#4    Source "/build/gcc/src/gcc/libstdc++-v3/src/c++11/thread.cc", line 80, in execute_native_thread_routine [0x7fbad4439c23]
#3    Object "/usr/bin/anbox", at 0x55e8d20277c5, in 
#2    Object "/usr/bin/anbox", at 0x55e8d1fc0eed, in boost::asio::detail::scheduler::run(boost::system::error_code&)
#1    Object "/usr/bin/anbox", at 0x55e8d2053b69, in boost::asio::detail::reactive_socket_recv_op<boost::asio::mutable_buffers_1, std::function<void (boost::system::error_code const&, unsigned long)>, boost::asio::detail::io_object_executor<boost::asio::executor> >::do_complete(void*, boost::asio::detail::scheduler_operation*, boost::system::error_code const&, unsigned long)
#0    Object "/usr/bin/anbox", at 0x55e8d1fb6954, in 
Segmentation fault (Address not mapped to object [0x55ed8cd44c3f])
Segmentation fault (core dumped)

I found this github issue that seems to be the same error but the fix (echo 1 | sudo tee /sys/fs/cgroup/cpuset/cgroup.clone_children) did not work for me:  https://github.com/anbox/anbox/issues/1149

I'm seeing the following in /var/lib/anbox/logs/container.log where it looks like it's failing to create the network.

lxc 20201202122713.580 TRACE    start - start.c:lxc_spawn:1780 - Allocated new network namespace id
lxc 20201202122713.584 INFO     network - network.c:instantiate_veth:285 - Retrieved mtu 1500 from anbox0
lxc 20201202122713.585 ERROR    network - network.c:instantiate_veth:291 - Operation not supported - Failed to create veth pair "vethofdDph" and "vethw2dGi2"
lxc 20201202122713.585 ERROR    network - network.c:lxc_create_network_priv:3068 - Operation not supported - Failed to create network device
lxc 20201202122713.585 ERROR    start - start.c:lxc_spawn:1786 - Failed to create the network
lxc 20201202122713.585 DEBUG    network - network.c:lxc_delete_network:3665 - Deleted network devices
lxc 20201202122713.585 TRACE    start - start.c:lxc_serve_state_socket_pair:502 - Sent container state "ABORTING" to 13
lxc 20201202122713.585 TRACE    start - start.c:lxc_serve_state_clients:438 - Set container state to ABORTING
lxc 20201202122713.585 TRACE    start - start.c:lxc_serve_state_clients:441 - No state clients registered
lxc 20201202122713.585 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:859 - Received container state "ABORTING" instead of "RUNNING"

I see the service created a NIC named "anbox0" from "ip addr" output.  The wiki just says to enable systemd-networkd (which I'm already using for my real ethernet card.)  It's possible I may have disabled a kernel feature that anbox needs since I built my kernel to be more slimmed down than the Arch kernel but I did enable all of the CGROUP features and enough of the network drivers for KVM/libvirt to work (tun/tap, iptables, bridge, etc.) so I'm not sure if that's the cause and this error message isn't really pointing me anywhere.

Offline

#2 2020-12-04 06:13:43

weirddan455
Member
Registered: 2012-04-15
Posts: 209

Re: Anbox failed to start container

Well I solved my original problem.  My kernel needed CONFIG_VETH.  Now, Anbox is loading but it crashes after using it for a couple of minutes.  I tried compiling a stock Arch kernel (only adding in the things from the wiki that anbox needs) to rule out my custom kernel being the problem and it's doing the same thing there.  From /var/lib/anbox/logs/console.log:

12-04 04:46:29.382   108   147 I InputReader: Device removed: id=2, name='anbox-keyboard', sources=0x00000101
12-04 04:46:29.382   108   147 I InputReader: Device removed: id=3, name='anbox-pointer', sources=0x00002002
12-04 04:46:29.382   108   147 W EventHub: could not get event, removed? (fd: 80 size: 0 bufferSize: 256 capacity: 256 errno: 2)
12-04 04:46:29.382   108   147 I EventHub: Removed device: path=/dev/input/event2 name=anbox-touch id=1 fd=80 classes=0x14
12-04 04:46:29.382   108   147 I InputReader: Device removed: id=1, name='anbox-touch', sources=0x00001002
12-04 04:46:29.382   108   147 D InputReader: Could not retrieve current multitouch slot index.  status=-1
12-04 04:46:29.382   108   262 E gps_qemu: EPOLLERR or EPOLLHUP after epoll_wait() !?
12-04 04:46:29.382   108   137 E QemuSensors: sensor_device_poll_event_locked(fd=61): Could not receive event data len=-1, errno=0: Success
12-04 04:46:29.382   108   137 E SensorService: sensor poll failed (I/O error)
12-04 04:46:29.382   108   137 W SensorService: Exiting SensorService::threadLoop => aborting...
--------- beginning of crash
12-04 04:46:29.382   108   137 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 137 (SensorService)
12-04 04:46:29.382    28    28 E         : QemuPipeStream::readFully failed (buf 0x7ffdf6c2bb9c, len 4, res 4): Connection reset by peer, lethal error, exiting.
12-04 04:46:29.382    28    28 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 28 (surfaceflinger)
12-04 04:46:29.382     9     9 W         : debuggerd: handling request: pid=108 uid=1000 gid=1000 tid=137
12-04 04:46:29.383   108   146 I ActivityManager: Config changes=8 {1.0 ?mcc?mnc [en_US] ldltr sw1080dp w1920dp h1056dp 160dpi xlrg long land -touch -keyb/h/h -nav/h s.6}
12-04 04:46:29.383   498   545 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 545 (RenderThread)
12-04 04:46:29.383  1523  1523 E         : debuggerd: ptrace attach to 262 failed: No such process
12-04 04:46:29.438  1523  1523 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-04 04:46:29.438  1523  1523 F DEBUG   : Build fingerprint: 'Android/anbox_x86_64/x86_64:7.1.1/N6F26Q/root07191722:userdebug/test-keys'
12-04 04:46:29.438  1523  1523 F DEBUG   : Revision: '0'
12-04 04:46:29.438  1523  1523 F DEBUG   : ABI: 'x86_64'
12-04 04:46:29.438  1523  1523 F DEBUG   : pid: 108, tid: 137, name: SensorService  >>> system_server <<<
12-04 04:46:29.438  1523  1523 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
12-04 04:46:29.438  1523  1523 F DEBUG   :     rax 0000000000000000  rbx 00007fb53ce814f8  rcx 00007fb557627947  rdx 0000000000000006
12-04 04:46:29.438  1523  1523 F DEBUG   :     rsi 0000000000000089  rdi 000000000000006c
12-04 04:46:29.438  1523  1523 F DEBUG   :     r8  000000000000ffff  r9  0000000000000000  r10 0000000000000008  r11 0000000000000206
12-04 04:46:29.438  1523  1523 F DEBUG   :     r12 0000000000000089  r13 0000000000000006  r14 00007fb53ce81400  r15 00007fb549191400
12-04 04:46:29.438  1523  1523 F DEBUG   :     cs  0000000000000033  ss  000000000000002b
12-04 04:46:29.438  1523  1523 F DEBUG   :     rip 00007fb557627947  rbp 0000000000000000  rsp 00007fb53ce810c8  eflags 0000000000000206
12-04 04:46:29.440  1523  1523 F DEBUG   : 
12-04 04:46:29.440  1523  1523 F DEBUG   : backtrace:
12-04 04:46:29.440  1523  1523 F DEBUG   :     #00 pc 000000000008d947  /system/lib64/libc.so (tgkill+7)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #01 pc 000000000008a3e1  /system/lib64/libc.so (pthread_kill+65)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #02 pc 00000000000302c1  /system/lib64/libc.so (raise+17)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #03 pc 00000000000287dd  /system/lib64/libc.so (abort+77)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #04 pc 000000000001c4b3  /system/lib64/libsensorservice.so
12-04 04:46:29.440  1523  1523 F DEBUG   :     #05 pc 000000000001c689  /system/lib64/libsensorservice.so
12-04 04:46:29.440  1523  1523 F DEBUG   :     #06 pc 0000000000012c39  /system/lib64/libutils.so (_ZN7android6Thread11_threadLoopEPv+313)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #07 pc 00000000000ab033  /system/lib64/libandroid_runtime.so (_ZN7android14AndroidRuntime15javaThreadShellEPv+99)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #08 pc 0000000000089551  /system/lib64/libc.so (_ZL15__pthread_startPv+177)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #09 pc 0000000000029a4b  /system/lib64/libc.so (__start_thread+11)
12-04 04:46:29.440  1523  1523 F DEBUG   :     #10 pc 000000000001cac5  /system/lib64/libc.so (__bionic_clone+53)

Offline

Board footer

Powered by FluxBB