Anbox development

  • If watched the UT development for a year now and the Anbox development for about one and a half year now.

    I want to add new features to Anbox (especially notification support, which is really important for UT), but I wasn't able to find a guide on how to develop Anbox for UT.

    In the installation guide we have flash an image to the boot partition of the device.
    What image is that and how can I build it?
    Do I have to modify the anbox-tool debian package?

    Thanks, Jan-Luca

  • @jld3103 we are waiting for new the Unity8 and Mir to be in place before doing any Anbox development, so that project is on stand-by mode now.

    You have the images for testing here

  • @advocatux So I don't have to build the image?
    But then how do I modify my Anbox installation on UT?

  • @jld3103 I don't know the answer for that, sorry. Maybe you can ask in that main Anbox thread I've linked.

    Anyway, if you want to take a look at the code, the repo is

  • Administrators

    So the easiest way to get started is using our crossbuilder tool, this will setup an lxc container that you can with all the tools to do the cross compiling of the binaries.

    To start with, install anbox on you device and make sure it's working before starting, this way we know that it works before you start 🙂

    First clone and cd into it.

    Then to setup container i do:

    crossbuilder dependencies

    Then i just do

    crossbuilder shell
    cd anbox
    mkdir build-armhf
    cd build-armhf
    make -j10

    crossbuilder will bind mount to you current working folder

    Then with another shell (thats outside of crossbuilder) i push the binaries from the folder to the phone using adb.

    Now you have two options, use upstart or start the binaries manually,

    For upstart do:

    Then adb shell into you device and replace it with the binary you just make

    sudo mount -o rw,remount /
    sudo mv anbox /usr/bin
    stop anbox-session
    sudo stop anbox-container
    sudo start anbox-container
    start anbox-session

    For raw binary start:

    First stop the upstart session

    stop anbox-session
    sudo stop anbox-container

    Then to start anbox you need two services: container (root) and session (user)

    So you need to open two adb shells since there are blocking

    sudo ./anbox container-manager --data-path=/home/phablet/anbox-data --privileged


    ./anbox session-manager --desktop_file_hint=/usr/share/applications/anbox.desktop --mir-rootless

    Please not these where mostly written from memory, so might be a bit rusty 🙂

  • @mariogrip Thanks for that short tutorial. This should definitely be part of the documentation.

  • @mariogrip Is there a team for Anbox development in the team or the community? Anbox is the thing that I'm most interested in from the whole UT project.

  • And are Anbox apps freezed like all other apps? That would be really bad for notifications. But I know, that I was able to play music from an Anbox app. So Android services are not freezed, right?

  • @mariogrip I got this:

    jld3103@pippin:~/Desktop/anbox$ crossbuilder dependencies
    Creating LXD container anbox-usdk-16-04-amd64-armhf-dev using ubports-sdk:ubuntu-sdk-16.04-amd64-armhf-dev.
    Creating anbox-usdk-16-04-amd64-armhf-dev
    Error: Failed to run: /snap/lxd/current/bin/lxd forkstart anbox-usdk-16-04-amd64-armhf-dev /var/snap/lxd/common/lxd/containers /var/snap/lxd/common/lxd/logs/anbox-usdk-16-04-amd64-armhf-dev/lxc.conf: 
    Try `lxc info --show-log anbox-usdk-16-04-amd64-armhf-dev` for more info
    jld3103@pippin:~/Desktop/anbox$ lxc info --show-log anbox-usdk-16-04-amd64-armhf-dev
    Name: anbox-usdk-16-04-amd64-armhf-dev
    Remote: unix://
    Architecture: x86_64
    Created: 2019/07/07 06:48 UTC
    Status: Stopped
    Type: persistent
    Profiles: default
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.343 ERROR    start - start.c:proc_pidfd_open:1607 - Function not implemented - Failed to send signal through pidfd
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.344 ERROR    conf - conf.c:write_id_mapping:2763 - Invalid argument - Failed to write uid mapping to "/proc/8412/uid_map"
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.344 ERROR    conf - conf.c:lxc_map_ids:2962 - Failed to write mapping: 0 1000000 1000000000
    150000 1000 1
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.344 ERROR    start - start.c:lxc_spawn:1770 - Failed to set up id mapping.
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.387 WARN     network - network.c:lxc_delete_network_priv:2743 - Failed to remove interface "veth046PJF" from "lxdbr0"
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.387 ERROR    lxccontainer - lxccontainer.c:wait_on_daemonized_start:851 - Received container state "ABORTING" instead of "RUNNING"
    lxc anbox-usdk-16-04-amd64-armhf-dev 20190707064911.387 ERROR    start - start.c:__lxc_start:2019 - Failed to spawn container "anbox-usdk-16-04-amd64-armhf-dev"
    lxc 20190707064911.413 WARN     commands - commands.c:lxc_cmd_rsp_recv:135 - Connection reset by peer - Failed to receive response for command "get_state"

  • OK. Works when using --privileged

  • I had to use my fixed version of crossbuilder: (There are two branches one for the permission fix and one for my inst-foreign fix)

    Additional steps I had to do:

    sudo dpkg --add-architecture armhf
    sudo echo "deb [arch=armhf] trusty main universe" >> /etc/apt/sources.list
    sudo apt update
    crossbuilder inst-foreign cmake-data
    crossbuilder --privileged dependencies

    Currently I'm struggeling with some other dependencies 😞

  • Today I setup my machine with a new SSD and Ubuntu 18.04 and the depenencies worked flawlessly.
    But I still get the error with the "get_state" thing 😞

Log in to reply