Skip to content

Instantly share code, notes, and snippets.

@monperrus
Last active November 1, 2020 16:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save monperrus/0dca18f828f22503f4e57165339026c9 to your computer and use it in GitHub Desktop.
Save monperrus/0dca18f828f22503f4e57165339026c9 to your computer and use it in GitHub Desktop.
Content of /usr/share/doc/anbox/README.Debian
***** Latest version: https://salsa.debian.org/zhsj/anbox/blob/master/debian/README.Debian
Anbox for Debian
----------------
* Setup
In order to run Android system inside container, you need two kernel
modules: ashmem_linux and binder_linux. Since Debian kernel 4.17, these
two modules are enabled. You can find theme at,
/lib/modules/`uname -r`/kernel/drivers/android/binder_linux.ko and
/lib/modules/`uname -r`/kernel/drivers/staging/android/ashmem_linux.ko.
.
If your kernel doesn't have these two modules, you can follow upstream
instructions to install them with DKMS. Please see
<https://github.com/anbox/anbox-modules/>.
.
You also need to download the Android image to /var/lib/anbox/android.img
The pre-build image can be found at <https://build.anbox.io/android-images>.
.
Then start the anbox-container-manager.service and the
anbox-session-manager.service, anbox-session-manager.service is a systemd
user service.
.
Android application can be started from desktop menu.
* Debug
You can launch the anbox process manually with ANBOX_LOG_LEVEL=debug
environment.
.
For example,
$ env ANBOX_LOG_LEVEL=debug anbox session-manager
$ env ANBOX_LOG_LEVEL=debug anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
.
/var/lib/anbox/logs/container.log contains the LXC log.
/var/lib/anbox/logs/console.log contains the console log of Android system,
however this file is not available currently(LXC 3 needed).
.
Android root shell can be gained by running,
$ sudo /usr/share/anbox/anbox-shell.sh
Then you can run logcat inside to see the Android logs.
* Misc
1. Anbox may not work with Nvidia graphic drivers. If your meet segmentation
fault, please try to uninstall the drivers first.
2. If you see segfault or other errors from Android, you can try to update
Android rootfs image, as it may be fixed by upstream.
-- Shengjing Zhu <zhsj@debian.org> Sat, 26 Oct 2018 10:30:00 +0800
@sudormrfbin
Copy link

The README has been updated to:

Anbox for Debian
----------------

* Setup

In order to run Android system inside container, you need two kernel
modules: ashmem_linux and binder_linux. Since Debian kernel 4.17, these
two modules are enabled. You can find theme at,
/lib/modules/`uname -r`/kernel/drivers/android/binder_linux.ko and
/lib/modules/`uname -r`/kernel/drivers/staging/android/ashmem_linux.ko.
.
If your kernel doesn't have these two modules, you can follow upstream
instructions to install them with DKMS. Please see
<https://github.com/anbox/anbox-modules/>.
.
Run following commands to check if you have the kernel modules:
.
  modinfo binder_linux
  modinfo ashmem_linux
.
You also need to download the Android image to /var/lib/anbox/android.img.
The path is important, since the systemd service metioned below will check it.
The pre-build image can be found at <https://build.anbox.io/android-images>.
.
Then start the anbox-container-manager.service and the
anbox-session-manager.service, anbox-session-manager.service is a systemd
user service.
.
You can run following commands to manually start the services:
.
  sudo systemctl start anbox-container-manager.service
  systemctl --user start anbox-session-manager.service
.
If the above commands all succeed, you can start the Android application from
desktop menu now. Or you launch application from command line:
.
  anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

* Debug

You can launch the anbox process manually with ANBOX_LOG_LEVEL=debug
environment.
.
For example,
.
  env ANBOX_LOG_LEVEL=debug anbox session-manager
  env ANBOX_LOG_LEVEL=debug anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
.
/var/lib/anbox/logs/container.log contains the LXC log.
/var/lib/anbox/logs/console.log contains the console log of Android system,
.
Android root shell can be gained by running:
.
  sudo /usr/share/anbox/anbox-shell.sh
.
Then you can run `logcat` inside to see the Android logs.

* Applications

The upstream Android image doesn't bring any App Store, but you can use adb to
install applications from the command line:
.
  wget https://f-droid.org/FDroid.apk
  adb install FDroid.apk
.
As shown in the above example, you can download F-Droid apk from its website
and install it with adb.

* Misc

1. Anbox may not work with Nvidia graphic drivers. If your meet segmentation
   fault, please try to uninstall the drivers first.
2. If you see segfault or other errors from Android, you can try to update
   Android rootfs image, as it may be fixed by upstream.
3. Some system may lack features to run Anbox, this can be checked with
   command: `anbox check-features`.

More documents can be found at <https://docs.anbox.io/>.

 -- Shengjing Zhu <zhsj@debian.org>  Sun, 27 Oct 2019 23:08:28 +0800

@monperrus
Copy link
Author

monperrus commented Dec 28, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment