I have been able to run android apps on fossapup64, using anbox (natively, ie, not using an ARM emulator) - which runs android in a container
It was quite challenging, but it's working. I will outline my summarized steps and make a guide, if someone else is interested in running this too: [btw, personally I always run puppy in PUPMODE 5, so I'm not worried of any changes this may do to the OS, but not sure how permanent/significant changes could happen in other more persistent pupmodes with save files)
1-A couple of kernel modules are necessary, one for anonymous shared memory (ashmem) and another for the FUSE filesystem (bindfs), both of which are part of the android kernel and actually included in the recent ubuntu kernels, but not in the puppy kernel. So, in terminal:
Code: Select all
pkg add-repo ppa:morphis/anbox-support ubuntu bionic
pkg repo bionic-morphis
pkg get anbox-modules-dkms
It's ubuntu bionic because the repo does not have one for focal [since the focal kernel already has these module built-in], but it makes no difference
Or, even easier than the above, just download and install:
http://ppa.launchpad.net/morphis/anbox- ... 13_all.deb
http://archive.ubuntu.com/ubuntu/pool/m ... u1_all.deb
2-The kernel sources and the devx should be installed now
3-I have found that building the bindfs module won't work and give an error - this will happen on kernels above 5.1. The solution is to replace the code of /usr/src/anbox-1/binder/binder.c with the code in https://github.com/anbox/anbox-modules/ ... r/binder.c (the repo includes an outdated version which was never updated for some reason)
4-To build and load the modules (with dkms, errors when using make):
Code: Select all
dkms add -m anbox -v 1
dkms build -m anbox -v 1
dkms install -m anbox -v 1
modprobe ashmem-linux
modprobe binder-linux
(I chose at this point to uninstall the kernel sources and devx, to free up RAM)
5-Now we should download anbox. It's a snap package. Snap packages are just like the standard sfs files Puppy uses for years, which shows how it has been way ahead - it has only recently being adopted in Ubuntu. I have found that the way to download snap packages is:
Code: Select all
curl -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/anbox
[you could replace "anbox" with any another snap package btw]
The 1st link is what interests - the most stable 64 bit package
6-Once it's downloaded, just rename the file to .sfs and install it. That simple
7-Unfortunately anbox will not load, and in puppy we have to (attempt to) launch it in a different way. First, when and if anbox loads, it will probably need network access. This will bridge the current network connection to the container:
Code: Select all
sh /bin/anbox-bridge.sh start
8-We have to manually launch the manager for the container:
Code: Select all
anbox container-manager --daemon --android-image=/android.img --data-path=/anbox-data
9-Anbox uses a container called lxc. Out of the snap package, it will not run because it assumes systemd, which is not used in puppy (running lxc-checkconfig will show that the Cgroup v1 systemd controller and Cgroup v1 freezer controllers are missing)
To go around this, install cgroupfs-mount (you can find it using the puppy package manager, for instance). Then run the file /usr/bin/cgroupfs-mount
And also, create this directory
Code: Select all
mkdir -p /var/snap/anbox/common/lxc
Otherwise it would not launch the container or even mention why not
10-In another terminal window:
Code: Select all
export $(dbus-launch)
anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
Anbox will launch. Now, to obtain an internet connection, we need to:
11-Download android-tools-adb from the PPM
12-In a new terminal window:
Code: Select all
root# adb shell
x86_64:/ $ su
x86_64:/ # ip rule add pref 32766 table main
x86_64:/ # ip route add default dev eth0 via 192.168.250.1
At the moment, step 12 as to be repeated every time anbox is started.
And we now have a working android environment within puppy, able to run some android apps (not very stable yet, but that's probably anbox itself, still beta). Just needs x86 apk application packages installed as needed through the adb