Anbox installation - Troubleshooting



  • Hello, I wanted to install Anbox for Ubuntu Touch on a BQ M10 FHD, and followed the instructions here. I'll go into details:

    • Botched it the first time and went into fastboot mode without having fastboot installed on the computer. Restarted the phablet manually
    • Botched set the variables wrong the first time around, continued typing in the values "frieza" and "boot" myself (without the quotes, obviously).
    • Flashing the boot partition with the image works. Now, the second part does of the instruction does not work for me. Note: Did not delete the image from my HDD, I skipped the rm command.

    Here is where my questions come into play:

    • With the different boot image, should the phablet launch differently? Starts up just normal. I logged in on the phablet the first few times before doing the remount; In my latest try I just connected the adb shell without logging in at the phablet.

    • Should there be an output or some visible result from the remount command? As far as I understand it,

      sudo mount -o rw,remount /

      should give me read and write access to something, but I guess it did not. The first time I wrote "-o rw, remount /" which gave me an error. "... rw,remount /" produces nothing. Anyway, after that the update works, but the install command gives me an error that there is not enough space in /var/.../archives writing from memory now, can provide the exact output later. There is about 5gb left on the phablet, which I hope to be enough space. So, my best guess was, that I do not actually have write access.

    • Do I have to go through the entire process every time? I mean: Go into fastboot mode, flash boot image, reboot? Or can I simply try the remount as much as I like?

    Thank you for your support!



  • Hi!

    The mount -o remount, rw / command gives you read/write permission to the root partition. On successful completion the command does not give any output.

    The error message you see is because there is not enough space on the root partition install the necessary files. You may still have 5GB free on the tablet as a whole, but that is on the writable portions of the filesystem, (the /writable partition if I remember correctly)

    Unfortunately the current Xenial images for the BQ M10 use up almost all the space of the root partition and repartitioning the device is not for the faint of heart.



  • Ah, this clears up some of the issues. I also have a libertine container on the M10, maybe I could set up anbox inside that container?



  • That is an interesting idea... no idea if it would work, though. But there's only one way to find out! :)



  • Same problem for the container. Installing snapd does not work because there is not enough space availabel. Guess I'll have to try partitioning then. There is no crucial data on the device, so installing a clean Ubuntu Touch if something fails will not bring me any pain.

    Do you have any instructions on how to do it? I found some instructions, but they were not really explaining what each command does, and there seem to be different approaches.



  • installing a clean Ubuntu Touch if something fails will not bring me any pain

    @markh4b just a reminder. You can do that or just do a "Factory Reset" to have your device in a clean state again ;)



  • So, back to installing anbox into a libertine container at the moment.

    • First I tried cloning the installer from github. This told me that it is deprecated and that I should install via snap.
    • Installation of snap (to be specific: 'snapd') requires the apparmor package in the container.
    • Installation of apparmor failed:

    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Reading package lists...
    Building dependency tree...
    Reading state information...
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    After this operation, 0 B of additional disk space will be used.
    Setting up apparmor (2.10.95-0ubuntu2.9) ...
    mktemp: failed to create file via template: '/run/user/32011/confined/com.ubuntu.terminal/tmp.XXXXXXXXXX': No such file or directory

    • Tried it via adb shell then, with the following output (apparently it already has apparmor)

    libertine-container-manager install-package -p apparmor
    Hit:1 http://ports.ubuntu.com/ubuntu-ports xenial InRelease
    Hit:2 http://ppa.launchpad.net/ci-train-ppa-service/stable-phone-overlay/ubuntu xenial InRelease
    Hit:3 http://ports.ubuntu.com/ubuntu-ports xenial-updates InRelease
    Reading package lists...
    Reading package lists...
    Building dependency tree...
    Reading state information...
    apparmor is already the newest version (2.10.95-0ubuntu2.9).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up apparmor (2.10.95-0ubuntu2.9) ...
    update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
    diff: /var/lib/apparmor/profiles/.apparmor.md5sums: No such file or directory
    Reading package lists...
    Building dependency tree...
    Reading state information...
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    ChrootContainer.py:235: INFO: _run_ldconfig(): Refreshing the container's dynamic linker run-time bindings...

    • Installing snapd from adb shell worked fine, now on to installing the actual anbox. This gave me massive errors:

    libertine-container-manager exec -c "snap install --devmode --beta anbox"
    panic: user: lookup userid 32011: no such file or directory [recovered]
    panic: user: lookup userid 32011: no such file or directory

    goroutine 1 [running]:
    panic(0xab7e5e78, 0xbbe986d8)
    /usr/lib/go-1.6/src/runtime/panic.go:481 +0x370
    main.main.func1()
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:370 +0x7c
    panic(0xab7e5e78, 0xbbe986d8)
    /usr/lib/go-1.6/src/runtime/panic.go:443 +0x490
    github.com/snapcore/snapd/client.storeAuthDataFilename(0x0, 0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/login.go:99 +0xb4
    github.com/snapcore/snapd/client.readAuthData(0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/login.go:135 +0x34
    github.com/snapcore/snapd/client.(*Client).setAuthorization(0xbbe8cff0, 0xbbe55420, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/client.go:133 +0x34
    github.com/snapcore/snapd/client.(*Client).raw(0xbbe8cff0, 0xab879b08, 0x4, 0xbbea4310, 0xf, 0x0, 0xbbea2780, 0xf56ca6d8, 0xbbe7a780, 0xab33b8dc, ...)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/client.go:191 +0x2c0
    github.com/snapcore/snapd/client.(*Client).do(0xbbe8cff0, 0xab879b08, 0x4, 0xbbea4310, 0xf, 0x0, 0xbbea2780, 0xf56ca6d8, 0xbbe7a780, 0xab7e6500, ...)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/client.go:236 +0x114
    github.com/snapcore/snapd/client.(*Client).doAsyncFull(0xbbe8cff0, 0xab879b08, 0x4, 0xbbea4310, 0xf, 0x0, 0xbbea2780, 0xf56ca6d8, 0xbbe7a780, 0x0, ...)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/client.go:300 +0xc8
    github.com/snapcore/snapd/client.(*Client).doAsync(0xbbe8cff0, 0xab879b08, 0x4, 0xbbea4310, 0xf, 0x0, 0xbbea2780, 0xf56ca6d8, 0xbbe7a780, 0x0, ...)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/client.go:293 +0x7c
    github.com/snapcore/snapd/client.(*Client).doSnapAction(0xbbe8cff0, 0xab87d248, 0x7, 0xffe21818, 0x5, 0xbbe8e7b0, 0x0, 0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/snap_op.go:167 +0x4ac
    github.com/snapcore/snapd/client.(*Client).Install(0xbbe8cff0, 0xffe21818, 0x5, 0xbbe8e7b0, 0x0, 0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/client/snap_op.go:85 +0x68
    main.(*cmdInstall).installOne(0xbbe8e510, 0xffe21818, 0x5, 0xbbe8e7b0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/cmd/snap/cmd_snap_op.go:356 +0x19c
    main.(*cmdInstall).Execute(0xbbe8e510, 0xbbea2500, 0x0, 0x4, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/cmd/snap/cmd_snap_op.go:465 +0x278
    github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags.(*Parser).ParseArgs(0xbbdcfbc0, 0xbbd64098, 0x4, 0x5, 0x0, 0x0, 0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags/parser.go:316 +0x918
    github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags.(*Parser).Parse(0xbbdcfbc0, 0x0, 0x0, 0x0, 0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/vendor/github.com/jessevdk/go-flags/parser.go:186 +0xac
    main.run(0x0, 0x0)
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:391 +0x30
    main.main()
    /build/snapd-754fGy/snapd-2.34.2/_build/src/github.com/snapcore/snapd/cmd/snap/main.go:375 +0xb6c

    Might have to do with git not being installed? Let's try that again. Nope, still the same output with git installed in the container.



  • Update: Meanwhile I tried repartitioning the device with a method from here: The one that increases the partition size to 6gb (previous partition size was 2gb, checked that beforehand). Now the device still boots correctly and works normally, but adb shell connection gets stuck on updates/installations somewhere between 90% and 100%. Error message is usually that the device is out of memory.



  • @markh4b I get the same results as you trying to install a snap inside a libertine container. I think it has something to do with it the fact that the exec command does not set up the same bindings as the libertine-launch command does.

    Concerning the errors when installing from the 'repartitioned' filesystem, could you post the exact error message?



  • @arubislander It was a really generic message, such as "not enough space left on device". I cannot remember exactly, and I can offer to reproduce it from the 12th of August onward. Currently the device is flashed with Android, instead of Ubuntu.



  • @markh4b Ah, OK. That's an out-of-storage-space error. Either the extra 4 Gigs were still not enough or the filesystem was not expanded to make use of the extra space.



  • @arubislander Probably the latter, because I hardly understand whether the commands are sufficient:

    $ sudo -s
    # dd if=/dev/null of=/userdata/ubuntu.img bs=1M seek=6000 count=0
    # resize2fs -f /userdata/ubuntu.img
    # reboot

    My best guess is that it seeks 6000 blocks of size 1 megabyte each, and writes those to a file ubuntu.img, then resizes/expands the root partition with this new file and reboots?



  • @markh4b
    Yes, I don't understand the seek part myself. But my guess is that it just increases the size of whatever file was already there.
    But the resize command should result in the filesystem using the newly created space.



  • @arubislander said in Anbox installation - Troubleshooting:

    @markh4b I get the same results as you trying to install a snap inside a libertine container. I think it has something to do with it the fact that the exec command does not set up the same bindings as the libertine-launch command does.

    Sounds plausible. Did you try with libertine-launch?



  • @markh4b said in Anbox installation - Troubleshooting:

    @arubislander Probably the latter, because I hardly understand whether the commands are sufficient:

    $ sudo -s
    # dd if=/dev/null of=/userdata/ubuntu.img bs=1M seek=6000 count=0
    # resize2fs -f /userdata/ubuntu.img
    # reboot

    My best guess is that it seeks 6000 blocks of size 1 megabyte each, and writes those to a file ubuntu.img, then resizes/expands the root partition with this new file and reboots?

    I don't understand it either. I simply do resize2fs ubuntu.img 5G from TWRP. No dd needed. (And certainly no sudo !). At most it might want you to fsck -y, but resize2fs will tell you if it's needed



  • @doniks said in Anbox installation - Troubleshooting:

    Sounds plausible. Did you try with libertine-launch?

    Yes, I did. It tells me it cannot find the snap command. Furhtermore: libertine-launch apt search snap | grep snap returns only

    libsnappy1v5/now 1.1.3-2 armhf [installed,local]
    

    I would have expected at least snapd to appear in that list.



  • @arubislander

    Waaait a minute. First you said

    @arubislander said in Anbox installation - Troubleshooting:

    @markh4b I get the same results as you trying to install a snap inside a libertine container.

    I understood that you were referring to @markh4b post where he describes a botched attempt of installing some packages via apt and running out of diskspace, however at the end he has snap installed nevertheless, but not working properly.

    Now you say

    Furhtermore: libertine-launch apt search snap | grep snap returns only

    libsnappy1v5/now 1.1.3-2 armhf [installed,local]
    

    I would have expected at least snapd to appear in that list.

    Now I'm confused. Which way is it? Are you getting the same results as @markh4b or are you failing at a totally different step where snap is not even being offered to be installed from apt?



  • @doniks said in Anbox installation - Troubleshooting:

    Which way is it? Are you getting the same results as @markh4b or are you failing at a totally different step where snap is not even being offered to be installed from apt?

    It is both. I can do libertine-container-manager install-package -p snapd and the package gets installed. It even shows that it is installed in the Libertine GUI under the Settings. And after that I get the same results as @markh4b did. But the snapd package does not show up in the list with libertine-launch apt search snap | grep snap.

    The two things are probably totally unrelated. The reason snapd does not work in the container, I guess, is that since the libertine container is a chroot, it doesn't use systemd, and snapd depends on systemd to work properly. The reason the snapd package does not show up in a apt search snap I cannot begin to guess about.



  • Strange.



  • @doniks
    when I do: libertine-container-manager exec -c 'apt update && apt search snapd' I do get the snapd package listed. So, that mystery is also solved.


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.