diff --git a/README.md b/README.md index 8efc9ac..8afd9b1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Anbox install files +# Anbox installation This repository contains recommended Anbox configuration to run the program as securely as possible. @@ -8,6 +8,10 @@ Additionally, this repository provides feature-patched Android OS image file for `PKGBUILD` file is Arch Linux specific file. Otherwise, you can use rest of the files on any Linux distribution. +## Anbox installation + +Anbox installation steps are roughly described in [Installation Steps](installation-steps.md). + ## Anbox files Many files have originally been provided by [anbox-git AUR package](https://aur.archlinux.org/packages/anbox-git/). However, small changes have been made. diff --git a/installation-steps.md b/installation-steps.md new file mode 100644 index 0000000..f4697b0 --- /dev/null +++ b/installation-steps.md @@ -0,0 +1,33 @@ +# Anbox installation steps + +1) Install Anbox (`anbox-git`), Anbox kernel modules `ashmem_linux` + `binder_linux` (`anbox-modules-dkms-git`) + +2) Load installed kernel modules (`modprobe ashmem_linux binder_linux`). Check existence of `/usr/lib/modules-load.d/anbox.conf` file + +3) Check the kernel modules have been loaded (`lsmod | grep linux`) + +4) Install Android base image `android.img` (`anbox-image`). I recommend patched image file (in androidOS_files folder) but you can get unpatched image on [Anbox website](https://build.anbox.io/android-images/) + +5) Install [subuid](https://fjordtek.com/git/Fincer/anbox-install/src/branch/master/anbox_files/subuid) and [subgid](https://fjordtek.com/git/Fincer/anbox-install/src/branch/master/anbox_files/subgid) files into `/etc/` folder. + +6) Enable and start `lxc.service` (LXC package required). + + - `sudo systemctl enable lxc && sudo systemctl start lxc && systemctl is-active lxc` + +7) Enable and start `anbox-container-manager.service` + + - `sudo systemctl enable anbox-container-manager && sudo systemctl start anbox-container-manager && systemctl is-active anbox-container-manager` + +8) Start user service `anbox-session-manager.service` + + - `systemctl --user start anbox-session-manager` + + - **NOTE**: to avoid further problems, instead of enabling `anbox-session-manager.service`, I recommend using [anbox-session-manager wrapper shell script](anbox_files/anbox-session-manager) to circumvent conflicts with X11 session start process + +9) You should have several Android app desktop shortcuts. Test you can open any of those Android application. + +10) Install new applications by using `adb install -r ` command. + +If you encounter any errors os start up issues, consult log files `/var/lib/anbox/logs/{console.log,container.log}`. Additionally, check `anbox-session-manager` status (`systemctl --user status anbox-session-manager`), `anbox-container-manager` status (`systemctl status anbox-container-manager`), LXC service status (`systemctl status lxc.service`), network interface information (`ifconfig` or `ip addr`). Additionally, run the Anbox session manager directly from command line with debug options: `ANBOX_LOG_LEVEL=debug anbox session-manager` (non-root) + +**NOTE**: In many cases, failures on start up are caused by errors in LXC user/group mapping, stuck Android processes or network failures. **I strongly recommend reading log files instead of purely relying on standard output of the Anbox container or session manager**. For instance, the Anbox session manager complained about Boost TLS error, although the true issue was improper LXC user/group mappings. I fixed the situation by analysing and reading log entries.