anbox / anbox

Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system
https://anbox.io
GNU General Public License v3.0
8.87k stars 1.15k forks source link

Anbox + Ubuntu 18.04 Won't run (3 installs/machines, same behavior) #1042

Closed Fmstrat closed 5 years ago

Fmstrat commented 5 years ago

Running latest edge 4-bb97f3a (170) 391MB devmode on Ubuntu 18.04. Debug is enabled.

$ anbox.appmgr 
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
[ 2019-01-28 15:57:09] [launch.cpp:182@operator()] Session manager is not yet running, trying to start it
[ 2019-01-28 15:57:10] [launch.cpp:116@launch_session_manager] Started session manager, will now try to connect ..
[ 2019-01-28 15:57:10] [splash_screen.cpp:56@SplashScreen] Window has no associated renderer yet, creating one ...
[ 2019-01-28 15:58:00] [daemon.cpp:61@Run] Application manager service is not running yet

Log collection is attached. System info is there, and as requested in ticket:

$ anbox system-info
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
version: 4
snap-revision: 170
cpu:
  arch:  x86
  brand: Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
  features: 
    - aes
    - sse4_1
    - sse4_2
    - avx
    - avx2
os:
  name: Ubuntu
  version: 18.04.1 LTS (Bionic Beaver)
  snap-based: true
kernel:
  version: Linux version 4.15.0-43-generic (buildd@lgw01-amd64-001) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #46-Ubuntu SMP Thu Dec 6 14:45:28 UTC 2018
  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_EXT_image_dma_buf_import_modifiers
      - 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
      - EGL_KHR_image_base
      - EGL_KHR_image_pixmap
      - EGL_KHR_no_config_context
      - EGL_KHR_reusable_sync
      - EGL_KHR_surfaceless_context
      - EGL_EXT_pixel_format_float
      - 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 3.1 Mesa 18.0.5
    extensions:
      - GL_ANGLE_texture_compression_dxt3
      - GL_ANGLE_texture_compression_dxt5
      - GL_APPLE_texture_max_level
      - GL_EXT_blend_func_extended
      - GL_EXT_blend_minmax
      - GL_EXT_buffer_storage
      - GL_EXT_clip_cull_distance
      - GL_EXT_color_buffer_float
      - GL_EXT_compressed_ETC1_RGB8_sub_texture
      - GL_EXT_discard_framebuffer
      - GL_EXT_disjoint_timer_query
      - GL_EXT_draw_buffers
      - GL_EXT_draw_buffers_indexed
      - GL_EXT_draw_elements_base_vertex
      - GL_EXT_frag_depth
      - GL_EXT_geometry_point_size
      - GL_EXT_geometry_shader
      - GL_EXT_gpu_shader5
      - GL_EXT_map_buffer_range
      - GL_EXT_multi_draw_arrays
      - GL_EXT_occlusion_query_boolean
      - GL_EXT_polygon_offset_clamp
      - GL_EXT_primitive_bounding_box
      - GL_EXT_read_format_bgra
      - GL_EXT_robustness
      - GL_EXT_separate_shader_objects
      - GL_EXT_shader_integer_mix
      - GL_EXT_shader_io_blocks
      - GL_EXT_shader_samples_identical
      - GL_EXT_tessellation_point_size
      - GL_EXT_tessellation_shader
      - GL_EXT_texture_border_clamp
      - GL_EXT_texture_buffer
      - GL_EXT_texture_compression_dxt1
      - GL_EXT_texture_cube_map_array
      - GL_EXT_texture_filter_anisotropic
      - GL_EXT_texture_format_BGRA8888
      - GL_EXT_texture_rg
      - GL_EXT_texture_sRGB_decode
      - GL_EXT_texture_type_2_10_10_10_REV
      - GL_EXT_unpack_subimage
      - GL_INTEL_performance_query
      - GL_KHR_blend_equation_advanced
      - GL_KHR_context_flush_control
      - GL_KHR_debug
      - GL_KHR_no_error
      - GL_KHR_robust_buffer_access_behavior
      - GL_KHR_robustness
      - GL_MESA_shader_integer_functions
      - GL_NV_draw_buffers
      - GL_NV_fbo_color_attachments
      - GL_NV_image_formats
      - GL_NV_read_buffer
      - GL_NV_read_depth
      - GL_NV_read_depth_stencil
      - GL_NV_read_stencil
      - GL_OES_EGL_image
      - GL_OES_EGL_image_external
      - GL_OES_EGL_sync
      - GL_OES_compressed_ETC1_RGB8_texture
      - GL_OES_depth24
      - GL_OES_depth_texture
      - GL_OES_depth_texture_cube_map
      - GL_OES_draw_buffers_indexed
      - GL_OES_draw_elements_base_vertex
      - GL_OES_element_index_uint
      - GL_OES_fbo_render_mipmap
      - GL_OES_geometry_point_size
      - GL_OES_geometry_shader
      - GL_OES_get_program_binary
      - GL_OES_gpu_shader5
      - GL_OES_mapbuffer
      - GL_OES_packed_depth_stencil
      - GL_OES_primitive_bounding_box
      - GL_OES_required_internalformat
      - GL_OES_rgb8_rgba8
      - GL_OES_sample_shading
      - GL_OES_sample_variables
      - GL_OES_shader_image_atomic
      - GL_OES_shader_io_blocks
      - GL_OES_shader_multisample_interpolation
      - GL_OES_standard_derivatives
      - GL_OES_stencil8
      - GL_OES_surfaceless_context
      - GL_OES_tessellation_point_size
      - GL_OES_tessellation_shader
      - GL_OES_texture_3D
      - GL_OES_texture_border_clamp
      - GL_OES_texture_buffer
      - GL_OES_texture_cube_map_array
      - GL_OES_texture_float
      - GL_OES_texture_float_linear
      - GL_OES_texture_half_float
      - GL_OES_texture_half_float_linear
      - GL_OES_texture_npot
      - GL_OES_texture_stencil8
      - GL_OES_texture_storage_multisample_2d_array
      - GL_OES_vertex_array_object
      - GL_OES_vertex_half_float
      - GL_OES_viewport_array

Please describe your problem: When starting the appmgr, anbox fails to load.

What were you expecting?: Load.

Additional info:

$ anbox check-features
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
Your computer does meet all requirements to run Anbox

Thanks! anbox-system-diagnostics-2019-01-28.zip

Fmstrat commented 5 years ago

As a note, I get the same result on my desktop machine with 18.04.

Fmstrat commented 5 years ago

I also noticed an ethtool error in the syslog. I've seen a lot of similar issues here, is it possible that these could be related to installing Ubuntu Desktop 18.04.1 in "minimal" mode? Perhaps there are some missing packages that anbox requires?

Fmstrat commented 5 years ago

Lastly, also saw some AppArmor messages:

Jan 28 15:26:32 ubuntuMBP kernel: [ 2315.063251] audit: type=1400 audit(1548707192.546:604): apparmor="DENIED" operation="open" profile="snap-update-ns.anbox" name="/proc/sys/net/core/somaxconn" pid=7136 comm="4" requested_mask="r" denied_mask="r" fsuid=385601105 ouid=0
Jan 28 15:26:32 ubuntuMBP kernel: [ 2315.063275] audit: type=1400 audit(1548707192.546:605): apparmor="DENIED" operation="create" profile="snap-update-ns.anbox" pid=7136 comm="4" family="inet" sock_type="stream" protocol=6 requested_mask="create" denied_mask="create"
Jan 28 15:26:32 ubuntuMBP kernel: [ 2315.063283] audit: type=1400 audit(1548707192.546:606): apparmor="DENIED" operation="create" profile="snap-update-ns.anbox" pid=7136 comm="4" family="inet6" sock_type="stream" protocol=6 requested_mask="create" denied_mask="create"
Jan 28 15:26:32 ubuntuMBP kernel: [ 2315.063291] audit: type=1400 audit(1548707192.546:607): apparmor="DENIED" operation="create" profile="snap-update-ns.anbox" pid=7136 comm="4" family="inet6" sock_type="stream" protocol=6 requested_mask="create" denied_mask="create"
Fmstrat commented 5 years ago

Tried some other items:

sudo systemctl start snap.anbox.container-manager.service
anbox.appmgr

Which gives:

realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
[ 2019-01-28 21:12:08] [launch.cpp:182@operator()] Session manager is not yet running, trying to start it
[ 2019-01-28 21:12:08] [launch.cpp:116@launch_session_manager] Started session manager, will now try to connect ..
[ 2019-01-28 21:12:08] [splash_screen.cpp:50@SplashScreen] Window has no associated renderer yet, creating one ...
[ 2019-01-28 21:12:14] [daemon.cpp:61@Run] Failed to retrieve ready property from application manager
SirOaken commented 5 years ago

In a separate terminal try running the command anbox session-manager If it runs without spitting errors at you then in another separate terminal run. anbox.appmgr Let me know how it goes.

Fmstrat commented 5 years ago
$ sudo systemctl status snap.anbox.container-manager.service
● snap.anbox.container-manager.service - Service for snap application anbox.container-manager
   Loaded: loaded (/etc/systemd/system/snap.anbox.container-manager.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-01-31 08:15:34 EST; 14s ago
  Process: 17728 ExecStop=/usr/bin/snap run --command=stop anbox.container-manager (code=exited, status=0/SUCCESS)
 Main PID: 17839 (anbox)
    Tasks: 9 (limit: 4915)
   CGroup: /system.slice/snap.anbox.container-manager.service
           └─17839 /snap/anbox/170/usr/bin/anbox container-manager --data-path=/var/snap/anbox/common/ --android-image=/snap/anbox/170/

Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:        calling init: /snap/anbox/170/usr/lib/x86_64-linux-gnu/lib
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:        calling init: /snap/anbox/170/usr/lib/x86_64-linux-gnu/lib
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:        calling init: /snap/anbox/170/usr/lib/x86_64-linux-gnu/lib
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:        initialize program: /snap/anbox/170/usr/bin/anbox
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:        transferring control: /snap/anbox/170/usr/bin/anbox
Jan 31 08:15:34 ubuntuMBP anbox.container-manager[17839]:      17839:
$ anbox session-manager
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
realpath: '': No such file or directory
[ 2019-01-31 13:15:54] [Renderer.cpp:168@initialize] Using a surfaceless EGL context
[ 2019-01-31 13:15:54] [Renderer.cpp:251@initialize] Successfully initialized EGL
[ 2019-01-31 13:15:54] [service.cpp:41@Service] Successfully acquired DBus service name
[ 2019-01-31 13:15:54] [client.cpp:49@start] Failed to start container: Failed to start container: Failed to start container
[ 2019-01-31 13:15:54] [session_manager.cpp:145@operator()] Lost connection to container manager, terminating.
[ 2019-01-31 13:15:54] [daemon.cpp:61@Run] Container is not running
[WW 2019-01-31 13:15:54] [session_manager.cpp:145@operator()] Lost connection to container manager, terminating.
$

No luck there, either. anbox-system-diagnostics-2019-01-31.zip

Fmstrat commented 5 years ago

Any thoughts?

Fmstrat commented 5 years ago

So I have another proof point for this. Ubuntu Desktop 18.04.2, full install, HP Spectre x360 13" with i7, exact same behavior as the Macbook Pro and i7 Desktop.

Could someone from the Anbox team do a fresh Ubuntu install to check this out? Seems to happen consistently with any new install.

Fmstrat commented 5 years ago

I was trying to think of any commonality between the systems and I came up with one. Domain users. I tried running it from the one local user, and viola, it worked. I noticed this in the syslog with the domain user:

Feb 19 20:31:56 ubuntuSpectre NetworkManager[1126]: <info>  [1550626316.7872] device (veth5VM8UU): driver '(null)' does not support carrier detection.
Feb 19 20:31:56 ubuntuSpectre NetworkManager[1126]: <info>  [1550626316.7873] device (veth5VM8UU): driver 'veth' does not support carrier detection.

Any thoughts about what might be happening?

Fmstrat commented 5 years ago

A little more digging. While my domain user is not able to run anbox, I can sudo to the local user (which happens to be named user) to run it in the domain user's session:

$ xhost +SI:localuser:user
$ sudo mkdir -p /run/user/1000
$ sudo chown user:users /run/user/1000
$ sudo su - user bash -c anbox.appmgr

I'm still not sure why the domain user can't run, though. Is there a particular debug element I should look for?

Lazorne commented 5 years ago

Same issue, Ubuntu Mate 18.04.2

version: 4 snap-revision: 171 cpu: arch: x86 brand: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz features:

looncraz commented 5 years ago

I have this issue as well, with Ubuntu 19.04.

Starting anbox session-manager from a terminal outputs the following one-liner:

[ 2019-04-30 15:33:14] [session_manager.cpp:130@operator()] Failed to start as either binder or ashmem kernel drivers are not loaded

looncraz commented 5 years ago

So, ashmem is contained in android-androresolvd. It has an undeclared dependency on ifupdown2 ( for 'ifquery'), so that needs to be installed first.

Installing android-androresolvd spits out the following error:

Apr 30 10:49:31 looncraz-PC systemd[1]: Starting LSB: Updates /etc/resolv.conf from Android system props... Apr 30 10:49:31 looncraz-PC android-androresolvd[23507]: Cannot access system properties via ANDROID_PROPERTY_WORKSPACE environment setting. Apr 30 10:49:31 looncraz-PC systemd[1]: android-androresolvd.service: Control process exited, code=exited, status=255/EXCEPTION Apr 30 10:49:31 looncraz-PC systemd[1]: android-androresolvd.service: Failed with result 'exit-code'. Apr 30 10:49:31 looncraz-PC systemd[1]: Failed to start LSB: Updates /etc/resolv.conf from Android system props. dpkg: error processing package android-androresolvd (--configure): installed android-androresolvd package post-installation script subprocess returned error exit status 1

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

ntzxtyz commented 4 years ago

I had an error like this: [ 2020-07-22 11:16:39] [daemon.cpp:61@Run] Failed to connect to socket /run/anbox-container.socket: No such file or directory

LukeChow commented 4 years ago

root@AnboxServer:~# anbox.appmgr realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory realpath: '': No such file or directory [ 2020-07-24 03:15:47] [daemon.cpp:61@Run] Failed to connect to DBus ------Ubuntu16.04

Carottinger commented 1 year ago

A pitty that even 4 years later the problem still exists and still nobody contributes to it (looks like anbox is dead)