LogoopenSUSE Build Service > Projects
Sign Up | Log In

Android In a Box

Anbox is container based approach to boot a full Android system on a regular GNU Linux system like Ubuntu.

Source Files

Filename Size Changed Actions
_service 517 Bytes 4 months ago Download File
anbox-bridge.service 284 Bytes about 1 year ago Download File
anbox-container-manager.service 196 Bytes about 1 month ago Download File
anbox-session-manager.service 197 Bytes about 1 month ago Download File
anbox.changes 0 Bytes 4 months ago Download File
anbox.desktop 229 Bytes 4 months ago Download File
anbox.preset 28 Bytes about 1 year ago Download File
anbox.spec 5.68 KB 14 days ago Download File

Comments for home:gasinvein:anbox (52)

gmg 137 gmg137 wrote about 1 year ago

Can not run, suggesting the following error:

anbox launch [EE 2017-04-23 05:20:40] [launch.cpp:76@operator()] Anbox session manager service isn't running!

anbox session-manager [EE 2017-04-23 05:20:15] [session_manager.cpp:119@operator()] Failed to start as either binder or ashmem kernel drivers are not loaded

anbox system-info version: 0.1.0 os: name: openSUSE Leap version: 42.2 snap-based: false kernel: version: Linux version 4.4.57-18.3-default (geeko@buildhost) (gcc version 4.8.5 (SUSE Linux) ) #1 SMP Thu Mar 30 06:39:47 UTC 2017 (39c8557) binder: false ashmem: false graphics: egl: vendor: Mesa Project version: 1.4 (DRI2) extensions: - EGL_CHROMIUM_sync_control - EGL_EXT_create_context_robustness - EGL_EXT_image_dma_buf_import - EGL_KHR_create_context - EGL_KHR_fence_sync - EGL_KHR_get_all_proc_addresses - EGL_KHR_gl_renderbuffer_image - EGL_KHR_gl_texture_2D_image - EGL_KHR_gl_texture_cubemap_image - EGL_KHR_image - EGL_KHR_image_base - EGL_KHR_image_pixmap - EGL_KHR_surfaceless_context - EGL_KHR_wait_sync - EGL_MESA_configless_context - EGL_MESA_drm_image - EGL_MESA_image_dma_buf_export - EGL_NOK_swap_region - EGL_NOK_texture_from_pixmap - EGL_NV_post_sub_buffer - EGL_WL_bind_wayland_display gles2: vendor: Intel Open Source Technology Center vendor: OpenGL ES-CM 1.1 Mesa 11.2.2 extensions: - GL_EXT_blend_minmax - GL_EXT_multi_draw_arrays - GL_EXT_texture_filter_anisotropic - GL_EXT_texture_lod_bias - GL_OES_byte_coordinates - GL_OES_fixed_point - GL_OES_stencil_wrap - GL_OES_compressed_paletted_texture - GL_OES_query_matrix - GL_OES_read_format - GL_OES_single_precision - GL_EXT_texture_compression_dxt1 - GL_OES_draw_texture - GL_OES_point_size_array - GL_OES_point_sprite - GL_EXT_texture_format_BGRA8888 - GL_OES_compressed_ETC1_RGB8_texture - GL_OES_depth24 - GL_OES_element_index_uint - GL_OES_fbo_render_mipmap - GL_OES_framebuffer_object - GL_OES_mapbuffer - GL_OES_rgb8_rgba8 - GL_OES_stencil8 - GL_OES_texture_env_crossbar - GL_OES_texture_mirrored_repeat - GL_OES_texture_npot - GL_OES_EGL_image - GL_OES_packed_depth_stencil - GL_OES_texture_cube_map - GL_APPLE_texture_max_level - GL_EXT_discard_framebuffer - GL_EXT_read_format_bgra - GL_OES_blend_equation_separate - GL_OES_blend_func_separate - GL_OES_blend_subtract - GL_OES_EGL_image_external - GL_OES_EGL_sync - GL_OES_vertex_array_object - GL_ANGLE_texture_compression_dxt3 - GL_ANGLE_texture_compression_dxt5 - GL_EXT_map_buffer_range - GL_KHR_debug - GL_OES_surfaceless_context - GL_EXT_color_buffer_float - GL_OES_texture_storage_multisample_2d_array

Filippe LeMarchand gasinvein wrote about 1 year ago

Please post dkms status output

gmg 137 gmg137 wrote about 1 year ago

dkms status output: anbox-ashmem, 0.0.1.git20170429-45.1, 4.4.57-18.3-default, x86_64: installed anbox-binder, 0.0.1.git20170429-45.1, 4.4.57-18.3-default, x86_64: installed anbox-ashmem, 0.0.1.git20170429-45.1, 4.4.49-16-default, x86_64: installed-weak from 4.4.57-18.3-default anbox-binder, 0.0.1.git20170429-45.1, 4.4.49-16-default, x86_64: installed-weak from 4.4.57-18.3-default

Filippe LeMarchand gasinvein wrote about 1 year ago

Kernel modules seem fine. Do you have android image in /var/lib/anbox/android.img? Is anbox-container-manager.service running?

David Fong vkelim wrote about 1 year ago

thanks for pointing out where android image is! I had two different errors on Leap 42.2

On using the command 'anbox version', I have the error 'anbox local-/bin/sh: git: command not found'

On using the command 'anbox session-manager', I have the error 'Floating point exception (core dumped)'

Filippe LeMarchand gasinvein wrote about 1 year ago

>Floating point exception (core dumped)

See https://github.com/anbox/anbox/issues/278

In short, I don't know what causes the problem and can't fix it, so just use kernel modules from here and snap-based Anbox.

gmg 137 gmg137 wrote 11 months ago

Can now start, but always stuck in the boot interface.

/var/lib/anbox/logs/container.log:

        lxc 20170830033847.935 DEBUG lxc_conf - conf.c:lxc_map_ids:3377 - Either one or both of the newuidmap and newgidmap binaries do not exist or are missing necessary privilege.
        lxc 20170830033847.935 ERROR lxc_start - start.c:lxc_spawn:1182 - Failed to set up id mapping.
        lxc 20170830033847.995 INFO lxc_conf - conf.c:lxc_delete_network:3074 - Removed interface "(null)" with index 49.
        lxc 20170830033848.672 WARN lxc_conf - conf.c:lxc_delete_network:3095 - Failed to remove "vethPXQTJN" from host: Invalid argument.
        lxc 20170830033848.140 ERROR lxc_start - start.c:__lxc_start:1354 - Failed to spawn container "default".
        lxc 20170830033848.444 WARN lxc_commands - commands.c:lxc_cmd_rsp_recv:177 - Command get_cgroup failed to receive response: Connection reset by peer.
Julius Schwartzenberg jschwart wrote 11 months ago

I can't compile the module (with DKMS) on OpenSUSE Leap 42.3. This is the error I get in /var/lib/dkms/anbox-ashmem/0.0.1.git20170817-50.1/build/make.log:

In file included from /var/lib/dkms/anbox-ashmem/0.0.1.git20170817-50.1/build/ashmem.c:30:0: /usr/src/linux-4.4.79-19/include/linux/mman.h:73:1: note: declared here calc_vm_prot_bits(unsigned long prot, unsigned long pkey) ^ /var/lib/dkms/anbox-ashmem/0.0.1.git20170817-50.1/build/ashmem.c:381:2: error: too few arguments to function ‘calc_vm_prot_bits’ if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask)) &

Filippe LeMarchand gasinvein wrote 11 months ago

It looks like an upstream problem.

Julius Schwartzenberg jschwart wrote 11 months ago

I have the impression that the focus for Anbox is on newer kernels. Could this be the case? Against which kernel did you manage to compile (which version of) the modules?

Filippe LeMarchand gasinvein wrote 11 months ago

Not really. As far as I know, Anbox's primary platform is Ubuntu LTS, which has not latest kernel. Anbox's kernel modules were updated some weeks ago, and since that it builds fine against latest kernel, but, I guess, something was broken with older kernels.

Julius Schwartzenberg jschwart wrote 7 months ago

The problem turned out to be in a kernel patch from SUSE. Here is a diff which solves the issue: diff --git a/kernel/ashmem/ashmem.c b/kernel/ashmem/ashmem.c index c846db6..64d598e 100644 --- a/kernel/ashmem/ashmem.c +++ b/kernel/ashmem/ashmem.c @@ -374,7 +374,7 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) }

/* requested protection bits must match our allowed protection mask */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || (CONFIG_SUSE_KERNEL && LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 39)) if (unlikely((vma->vm_flags & ~calc_vm_prot_bits(asma->prot_mask, 0)) & calc_vm_prot_bits(PROT_MASK, 0))) { #else

It seems that Leap 42.3 just updated to a newer 4.14 kernel though, so this problem likely won't occur anymore. It requires a different patch though, see https://aur.archlinux.org/packages/anbox-git/

When I run 'anbox session-manager' now I get this error: Floating point exception (core dumped)

And dmesg shows: traps: anbox[22415] trap divide error ip:55c431 sp:7fff3f5bf7f0 error:0 in anbox400000+22d000

Filippe LeMarchand gasinvein wrote 7 months ago

Can you please give a link to this patch, or post it here using markdown (to preserve new lines)?

Julius Schwartzenberg jschwart wrote 7 months ago

Here's a proper version of the patch: https://pastebin.com/Q9Y2SLtG

Filippe LeMarchand gasinvein wrote 7 months ago

Added the patch, thx. But now it raises 64bit-portability-issue. I'm not a programmer, so help is welcome.

Julius Schwartzenberg jschwart wrote 2 months ago

It seems all those newer kernels are quite buggy. I'm not sure why they are being released. The 4.4 kernel is also still being updated (in Leap 42.3) and it works much better. With the patch applied things compile out of the box now!

I still get the floating point exception when trying to start the session manager though. Would there be a way to debug this further?

Filippe LeMarchand gasinvein wrote 2 months ago

Sorry, I'm not actively using Anbox anymore, at least for now. Feel free to fork my OBS project.

Peng Yi nerditation wrote 11 months ago

I'd like to report/suggest a missing dependency to package "lxc".

the story goes like this: I am not familiar with containers. after many hours of debugging, finally got anbox to work.

at the beginning, anbox simply didn't start. when I run the session-manager command, it gave the messages:

[ 2017-08-28 12:44:24] [client.cpp:49@start] Failed to start container: Failed to start container: Failed to start container
[ 2017-08-28 12:44:24] [session_manager.cpp:162@operator()] Lost connection to container manager, terminating.
[ 2017-08-28 12:44:24] [daemon.cpp:58@Run] Container is not running
[ 2017-08-28 12:44:24] [session_manager.cpp:162@operator()] Lost connection to container manager, terminating.
fish: “anbox session-manager” terminated by signal SIGSEGV (Address boundary error)

to my ignorance, I went to the wrong direction. I installed the debugsource and debuginfo packages for anbox, trying to locate the "crash" using gdb.

finally, I realized the problem was lxc failed to start the contaner. so I checked the lxc logfile, and found some error message like this:

lxc 20170828123412.106 DEBUG    lxc_conf - conf.c:lxc_map_ids:3377 - Either one or both of the newuidmap and newgidmap binaries do not exist or are missing necessary privilege.

after some googling, I realize it was lxc complaining that the installed command newuidmap and newgidmap didn't have sufficient privilege.

fixed that, I still got lxc errors in the logfile:

lxc 20170828124419.144 ERROR    lxc_conf - conf.c:setup_rootfs:1194 - No such file or directory - Failed to access to "/usr/lib64/lxc/rootfs". Check it is present.

this was where I got stuck for many hours. because I am such a noob, the results google gave were not helpful. then suddenly I got to think, wait a moment, am I missing some packges on my machine?

so I tried zypper wp /usr/lib64/lxc/rootfs, then zypper told me I need to install the package lxc.

that moment was really embarrassing for me, so I'd like to suggest add to your package the dependency for the necessary files or packages, so when novice users like me do the "Yast one click install" thing, the proper dependency can be resolved automatically.

finally, thank you for making this build available for suse users. anbox is a brilliant project.

Peng Yi nerditation wrote 11 months ago

it seems the screen is not redrawn properly as it needed for some (most???) apps. I can click buttons or type in some text but the contents of the window stays frozen. then if I manually trigger a redraw, by moving or resizing the window, the window is updated.

I suppose this is a configuration issue but don't know where to start checking, like which logfile should I examine? I am using KDE desktop. any advice could be helpful. thank you.

Filippe LeMarchand gasinvein wrote 11 months ago

Yes, LXC definitely should be in dependencies. Thank you.

gmg 137 gmg137 wrote 11 months ago

anbox session-manager error:

$anbox session-manager
[ 2017-08-30 09:00:29] [session_manager.cpp:147@operator()] Failed to start as either binder or ashmem kernel drivers are not loaded
$sudo dkms status
anbox-ashmem, 0.0.1.git20170829-55.1, 4.12.8-1-default, x86_64: installed (original_module exists)
anbox-binder, 0.0.1.git20170829-55.1, 4.12.8-1-default, x86_64: installed (original_module exists)

/var/lib/anbox/logs/container.log error:

            lxc 20170830082026.997 INFO     lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 10.
            lxc 20170830082026.997 INFO     lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 11.
            lxc 20170830082026.998 INFO     lxc_start - start.c:lxc_check_inherited:235 - Closed inherited fd: 13.
            lxc 20170830082026.998 DEBUG    lxc_monitor - monitor.c:lxc_monitord_spawn:387 - Using pipe file descriptor 14 for monitord.
            lxc 20170830082026.102 DEBUG    lxc_monitor - monitor.c:lxc_monitord_spawn:364 - Successfully synced with child process.
            lxc 20170830082026.104 DEBUG    lxc_monitor - monitor.c:lxc_monitord_spawn:333 - Finished waiting on pid 13045.
            lxc 20170830082026.105 INFO     lxc_monitor - monitor.c:lxc_monitor_sock_name:201 - using monitor socket name "lxc/aeef0a0c26bad0c1//var/lib/anbox/containers" (length of socket name 46 must be <= 105)
            lxc 20170830082026.105 DEBUG    lxc_monitor - monitor.c:lxc_monitor_open:225 - opening monitor socket lxc/aeef0a0c26bad0c1//var/lib/anbox/containers with len 46
            lxc 20170830082026.114 INFO     lxc_conf - conf.c:instantiate_veth:2706 - Retrieved mtu 1500 from anbox0
            lxc 20170830082026.115 INFO     lxc_conf - conf.c:instantiate_veth:2731 - Attached 'vethJQNYHM': to the bridge 'anbox0': 
            lxc 20170830082026.115 DEBUG    lxc_conf - conf.c:instantiate_veth:2748 - instantiated veth 'vethJQNYHM/vethPGAT12', index is '17'
            lxc 20170830082026.115 INFO     lxc_cgroup - cgroups/cgroup.c:cgroup_init:68 - cgroup driver cgroupfs-ng initing for default
            lxc 20170830082026.116 DEBUG    lxc_cgfsng - cgroups/cgfsng.c:filter_and_set_cpus:480 - No isolated cpus detected.
            lxc 20170830082026.116 DEBUG    lxc_cgfsng - cgroups/cgfsng.c:handle_cpuset_hierarchy:650 - "cgroup.clone_children" was already set to "1".
            lxc 20170830082026.116 INFO     lxc_start - start.c:lxc_spawn:1130 - Failed to pin the rootfs for container "default".
            lxc 20170830082026.117 INFO     lxc_start - start.c:lxc_spawn:1165 - Cloned CLONE_NEWNS.
            lxc 20170830082026.117 INFO     lxc_start - start.c:lxc_spawn:1165 - Cloned CLONE_NEWPID.
            lxc 20170830082026.117 INFO     lxc_start - start.c:lxc_spawn:1165 - Cloned CLONE_NEWUTS.
            lxc 20170830082026.117 INFO     lxc_start - start.c:lxc_spawn:1165 - Cloned CLONE_NEWIPC.
            lxc 20170830082026.117 INFO     lxc_start - start.c:lxc_spawn:1165 - Cloned CLONE_NEWNET.
            lxc 20170830082026.118 DEBUG    lxc_conf - conf.c:lxc_map_ids:3377 - Either one or both of the newuidmap and newgidmap binaries do not exist or are missing necessary privilege.
            lxc 20170830082026.118 ERROR    lxc_start - start.c:lxc_spawn:1182 - Failed to set up id mapping.
            lxc 20170830082026.171 INFO     lxc_conf - conf.c:lxc_delete_network:3074 - Removed interface "(null)" with index 17.
            lxc 20170830082026.175 WARN     lxc_conf - conf.c:lxc_delete_network:3095 - Failed to remove "vethJQNYHM" from host: Invalid argument.
            lxc 20170830082026.176 ERROR    lxc_start - start.c:__lxc_start:1354 - Failed to spawn container "default".
            lxc 20170830082026.227 WARN     lxc_commands - commands.c:lxc_cmd_rsp_recv:177 - Command get_cgroup failed to receive response: Connection reset by peer.
Filippe LeMarchand gasinvein wrote 11 months ago

Are ahmem and binder modules really present? You can check with ls -l /lib/modules/$(uname -r)/*/{ashmem,binder}_linux.ko

Are your newuidmap/newgidmap binaries setuid?

gmg 137 gmg137 wrote 11 months ago

After setting setuid anbox can already run, but the application can not connect to the network. I try to run no effect: nmcli con add type bridge ifname anbox0 -- connection.id anbox-net ipv4.method shared ipv4.addresses 192.168.250.1/24

Filippe LeMarchand gasinvein wrote 11 months ago

When Anbox is already started, is its interface (vethN or so) attached to bridge?

Also, you don't need networkmanager to create bridge anymore, because anbox-bridge.service is provided, which runs original script for bringing up network.

gmg 137 gmg137 wrote 11 months ago

Thank you,,,How do I determine if the interface is attached to the bridge?

Filippe LeMarchand gasinvein wrote 11 months ago

brctl show

gmg 137 gmg137 wrote 11 months ago

brctl show:

bridge name bridge id       STP enabled interfaces
anbox0      8000.fe44872c600b   no      vethPJ2Y7W

nmctl conn show

anbox0              138bec7c-19de-41bb-9984-3fc0876b829b  bridge           anbox0
gmg 137 gmg137 wrote 11 months ago

PS: I do not know why, paste a large section of the code always failed -_- ||

Filippe LeMarchand gasinvein wrote 11 months ago

This looks fine. Does android get an ip address?

gmg 137 gmg137 wrote 11 months ago

adb shell ifconfig:

eth0      Link encap:Ethernet  HWaddr 4e:9e:0b:2d:1f:50
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0 
          inet6 addr: fe80::4c9e:bff:fe2d:1f50/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:5022 TX bytes:586 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0 
          inet6 addr: ::1/128 Scope: Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:4 errors:0 dropped:0 overruns:0 frame:0 
          TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 
          collisions:0 txqueuelen:1000 
          RX bytes:248 TX bytes:248 

ifconfig:

anbox0: 
        inet 192.168.250.1  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::209a:efff:fee4:7951  prefixlen 64  scopeid 0x20
        ether fe:44:24:60:58:36  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 544 (544.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 54  bytes 9864 (9.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: 
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::862f:1efa:147d:7189  prefixlen 64  scopeid 0x20
        ether 40:8d:5c:78:d2:3d  txqueuelen 1000  (Ethernet)
        RX packets 993594  bytes 1203677686 (1.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 546664  bytes 41102923 (39.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: 
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
gmg 137 gmg137 wrote 11 months ago

ifconfig:

anbox0: flags=4163 UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
        inet 192.168.250.1  netmask 255.255.255.0  broadcast 0.0.0.0
        inet6 fe80::209a:efff:fee4:7951  prefixlen 64  scopeid 0x20
        ether fe:44:24:60:58:36  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 544 (544.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 54  bytes 9864 (9.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163  UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
        inet 192.168.1.2  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::862f:1efa:147d:7189  prefixlen 64  scopeid 0x20
        ether 40:8d:5c:78:d2:3d  txqueuelen 1000  (Ethernet)
        RX packets 993594  bytes 1203677686 (1.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 546664  bytes 41102923 (39.1 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73  UP,LOOPBACK,RUNNING  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 7748  bytes 117534093 (112.0 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7748  bytes 117534093 (112.0 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

veth0PHSDF: flags=4163  UP,BROADCAST,RUNNING,MULTICAST  mtu 1500
        inet6 fe80::fc44:24ff:fe60:5836  prefixlen 64  scopeid 0x20
        ether fe:44:24:60:58:36  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 656 (656.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 30  bytes 5582 (5.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
Filippe LeMarchand gasinvein wrote 11 months ago

Looks like the problem is the host bridge and Android being in different subnets. Try to use anbox-bridge.service instead of NetworkManager.

gmg 137 gmg137 wrote 11 months ago

I removed the connection created by nmcli, restart anbox-bridge.service the problem remains the same.

sudo systemctl status anbox-bridge.service

anbox-bridge.service - Anbox network bridge
   Loaded: loaded (/usr/lib/systemd/system/anbox-bridge.service; enabled; vendor preset: enabled)
   Active: active (exited) since Fri 2017-09-01 16:59:07 CST; 7min ago
  Process: 14266 ExecStart=/usr/lib/anbox/anbox-bridge.sh start (code=exited, status=0/SUCCESS)
 Main PID: 14266 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   CGroup: /system.slice/anbox-bridge.service

9月 01 16:59:07 linux-bnry.suse systemd[1]: Starting Anbox network bridge...
9月 01 16:59:07 linux-bnry.suse systemd[1]: Started Anbox network bridge.
Filippe LeMarchand gasinvein wrote 11 months ago

Then maybe you should file a bug report to https://github.com/anbox/anbox/issues

gmg 137 gmg137 wrote 11 months ago

Good, Thank you!

Alessandro Longo alxlg wrote 11 months ago

Hi, following the suggestions online I was able to solve my issues but I'm still blocked by an error when I start the session-manager:

[ 2017-09-03 14:49:38] [client.cpp:49@start] Failed to start container: Failed to start container: Failed to start container
[ 2017-09-03 14:49:38] [session_manager.cpp:162@operator()] Lost connection to container manager, terminating.
[ 2017-09-03 14:49:38] [daemon.cpp:58@Run] Container is not running
[ 2017-09-03 14:49:38] [session_manager.cpp:162@operator()] Lost connection to container manager, terminating.
[1]    29732 segmentation fault (core dumped)  anbox session-manager

Is this an upstream issue? My system-info output is the following:

version: local-/bin/sh: git: command not found
os:
  name: openSUSE Tumbleweed
  version: 
  snap-based: false
kernel:
  version: Linux version 4.12.8-1-default (geeko@buildhost) (gcc version 7.1.1 20170629 [gcc-7-branch revision 249772] (SUSE Linux) ) #1 SMP PREEMPT Thu Aug 17 05:30:12 UTC 2017 (4d7933a)
  binder: true
  ashmem: true
graphics:
  egl:
    vendor: Mesa Project
    version: 1.4 (DRI2)
    extensions:
      - EGL_ANDROID_native_fence_sync
      - EGL_CHROMIUM_sync_control
      - EGL_EXT_buffer_age
      - EGL_EXT_create_context_robustness
      - EGL_EXT_image_dma_buf_import
      - EGL_KHR_config_attribs
      - EGL_KHR_create_context
      - EGL_KHR_fence_sync
      - EGL_KHR_get_all_proc_addresses
      - 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
      - EGL_KHR_image_base
      - EGL_KHR_image_pixmap
      - EGL_KHR_no_config_context
      - EGL_KHR_reusable_sync
      - EGL_KHR_surfaceless_context
      - EGL_KHR_wait_sync
      - EGL_MESA_configless_context
      - EGL_MESA_drm_image
      - EGL_MESA_image_dma_buf_export
      - EGL_NOK_texture_from_pixmap
      - EGL_WL_bind_wayland_display
  gles2:
    vendor: Intel Open Source Technology Center
    vendor: OpenGL ES-CM 1.1 Mesa 17.1.6
    extensions:
      - GL_EXT_blend_minmax
      - GL_EXT_multi_draw_arrays
      - GL_EXT_texture_filter_anisotropic
      - GL_EXT_texture_lod_bias
      - GL_OES_byte_coordinates
      - GL_OES_fixed_point
      - GL_OES_stencil_wrap
      - GL_OES_compressed_paletted_texture
      - GL_OES_query_matrix
      - GL_OES_read_format
      - GL_OES_single_precision
      - GL_EXT_texture_compression_dxt1
      - GL_OES_draw_texture
      - GL_OES_point_size_array
      - GL_OES_point_sprite
      - GL_EXT_texture_format_BGRA8888
      - GL_OES_compressed_ETC1_RGB8_texture
      - GL_OES_depth24
      - GL_OES_element_index_uint
      - GL_OES_fbo_render_mipmap
      - GL_OES_framebuffer_object
      - GL_OES_mapbuffer
      - GL_OES_rgb8_rgba8
      - GL_OES_stencil8
      - GL_OES_texture_env_crossbar
      - GL_OES_texture_mirrored_repeat
      - GL_OES_texture_npot
      - GL_OES_EGL_image
      - GL_OES_packed_depth_stencil
      - GL_OES_texture_cube_map
      - GL_APPLE_texture_max_level
      - GL_EXT_discard_framebuffer
      - GL_EXT_read_format_bgra
      - GL_OES_blend_equation_separate
      - GL_OES_blend_func_separate
      - GL_OES_blend_subtract
      - GL_OES_EGL_image_external
      - GL_OES_EGL_sync
      - GL_OES_vertex_array_object
      - GL_ANGLE_texture_compression_dxt3
      - GL_ANGLE_texture_compression_dxt5
      - GL_EXT_map_buffer_range
      - GL_KHR_debug
      - GL_OES_surfaceless_context
      - GL_EXT_compressed_ETC1_RGB8_sub_texture
      - GL_EXT_polygon_offset_clamp
Filippe LeMarchand gasinvein wrote 11 months ago

Is anbox-container-manager running?

Alessandro Longo alxlg wrote 11 months ago

Yes, I manually start it with systemd, is it correct?

Filippe LeMarchand gasinvein wrote 11 months ago

Yes. Look at /var/lib/anbox/logs/container.log when you run session-manager, are there any errors?

Alessandro Longo alxlg wrote 11 months ago

Yes, there are the following lines at the end, maybe is it the issue you reported on upstream's GitHub?

lxc 20170903151331.181 DEBUG    lxc_conf - conf.c:lxc_map_ids:3377 - Either one or both of the newuidmap and newgidmap binaries do not exist or are missing necessary privilege.
            lxc 20170903151331.181 ERROR    lxc_start - start.c:lxc_spawn:1182 - Failed to set up id mapping.
            lxc 20170903151331.239 INFO     lxc_conf - conf.c:lxc_delete_network:3074 - Removed interface "(null)" with index 11.
            lxc 20170903151331.241 WARN     lxc_conf - conf.c:lxc_delete_network:3095 - Failed to remove "vethINWB5B" from host: Invalid argument.
            lxc 20170903151331.241 ERROR    lxc_start - start.c:__lxc_start:1354 - Failed to spawn container "default".
            lxc 20170903151331.291 WARN     lxc_commands - commands.c:lxc_cmd_rsp_recv:177 - Command get_cgroup failed to receive response: Connection reset by peer.
Alessandro Longo alxlg wrote 11 months ago

Update: I changed the following permissions:

sudo chmod 04755 /usr/bin/newuidmap
sudo chmod 04755 /usr/bin/newgidmap

Now I don't get any error and session-manager don't produce any output, it just run in background. Is it normal? I tried to start the main Anbox activity with launch command but nothing happens, it doesn't produce any output like session-manager. Both block the terminal with no output.

Alessandro Longo alxlg wrote 11 months ago

Update 2: in the end the launch command produce the following output while session-manager is still running:

anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2017-09-03 18:57:12] [launch.cpp:234@operator()] Stopped waiting as we've already waited for too long. Something
[ 2017-09-03 18:57:12] [launch.cpp:235@operator()] is wrong with your setup or the container has failed to boot.
[ 2017-09-03 18:57:12] [launch.cpp:236@operator()] If you think you found a bug please don't hesitate to file on
[ 2017-09-03 18:57:12] [launch.cpp:237@operator()] at https://github.com/anbox/anbox/issues/new
Attempted to unregister path (path[0] = null path[1] = null) which isn't registered
Filippe LeMarchand gasinvein wrote 11 months ago

Try to run both session-manager and the activity with env var ANBOX_LOG_LEVEL=debug and check the output.

Alessandro Longo alxlg wrote 11 months ago
  • session-manager
[ 2017-09-03 19:14:29] [Renderer.cpp:165@initialize] Using a surfaceless EGL context
[ 2017-09-03 19:14:29] [Renderer.cpp:248@initialize] Successfully initialized EGL

(and keep running...)

  • activity
[ 2017-09-03 19:14:45] [launch.cpp:220@operator()] Android hasn't fully booted yet. Waiting a bit ..
[ 2017-09-03 19:18:45] [launch.cpp:234@operator()] Stopped waiting as we've already waited for too long. Something
[ 2017-09-03 19:18:45] [launch.cpp:235@operator()] is wrong with your setup or the container has failed to boot.
[ 2017-09-03 19:18:45] [launch.cpp:236@operator()] If you think you found a bug please don't hesitate to file on
[ 2017-09-03 19:18:45] [launch.cpp:237@operator()] at https://github.com/anbox/anbox/issues/new
Attempted to unregister path (path[0] = null path[1] = null) which isn't registered
Filippe LeMarchand gasinvein wrote 11 months ago

Looks like container still doesn't start or can't boot Android, check log again.

Alessandro Longo alxlg wrote 11 months ago

container.log has no error...

Filippe LeMarchand gasinvein wrote 11 months ago

That's strange. Can you try official snap-based build and check if it works fine?

Alessandro Longo alxlg wrote 11 months ago

I tried but anbox-installer says OpenSUSE is not a supported distro...

Filippe LeMarchand gasinvein wrote 11 months ago

You don't need anbox-intsller. Just install kernel modules from here and the snap, e.g. snap install --edge --devmode anbox

Alessandro Longo alxlg wrote 11 months ago

Thank you very much for your help. I have the same error with the Snap version but I can't see the container with adb logcat, while I works with Anbox from this repo. Is it normal?

Filippe LeMarchand gasinvein wrote 11 months ago

I didn't use adb with anbox, but I guess it may be related to network misconfiguration.

Also, if official snap doesn't work for you, it is definitely not a packaging issue, so you probably should file a bug report to upstream.

Alessandro Longo alxlg wrote 11 months ago

Filled thanks