From 6b7fb433e0a3c1257c3e0896e7860763f6764456 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 14 Apr 2017 10:14:16 +0800 Subject: [PATCH] translated --- .../tech/20170406 Anbox - Android in a Box.md | 213 ------------------ .../tech/20170406 Anbox - Android in a Box.md | 174 ++++++++++++++ 2 files changed, 174 insertions(+), 213 deletions(-) delete mode 100644 sources/tech/20170406 Anbox - Android in a Box.md create mode 100644 translated/tech/20170406 Anbox - Android in a Box.md diff --git a/sources/tech/20170406 Anbox - Android in a Box.md b/sources/tech/20170406 Anbox - Android in a Box.md deleted file mode 100644 index 8ca37900b8..0000000000 --- a/sources/tech/20170406 Anbox - Android in a Box.md +++ /dev/null @@ -1,213 +0,0 @@ -translating---geekpi - -# Anbox - -Anbox is container based approach to boot a full Android system on a -regular GNU Linux system like Ubuntu. - -## Overview - -Anbox uses Linux namespaces (user, pid, uts, net, mount, ipc) to run a -full Android system in a container and provide Android applications on -any GNU Linux based platform. - -The Android inside the container has no direct access to any hardware. -All hardware access is going through the anbox daemon on the host. We're -reusing what Android implemented within the QEMU based emulator for Open -GL ES accelerated rendering. The Android system inside the container uses -different pipes to communicate with the host system and sends all hardware -access commands through these. - -For more details have a look at the following documentation pages: - - * [Android Hardware OpenGL ES emulation design overview](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/android-emugl/DESIGN) - * [Android QEMU fast pipes](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMU-PIPE.TXT) - * [The Android "qemud" multiplexing daemon](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD.TXT) - * [Android qemud services](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD-SERVICES.TXT) - -Anbox is currently suited for the desktop use case but can be used on -mobile operating systems like Ubuntu Touch, Sailfish OS or Lune OS too. -However as the mapping of Android applications is currently desktop specific -this needs additional work to supported stacked window user interfaces too. - -The Android runtime environment ships with a minimal customized Android system -image based on the [Android Open Source Project](https://source.android.com/). -The used image is currently based on Android 7.1.1 - -## Installation - -The installation process currently consists of a few steps which will -add additional components to your host system. These include - - * Out-of-tree kernel modules for binder and ashmem as no distribution kernel - ships both enabled. - * A udev rule to set correct permissions for /dev/binder and /dev/ashmem - * A upstart job which starts the Anbox session manager as part of - a user session. - -To make this process as easy as possible we have bundled the necessary -steps in a snap (see https://snapcraft.io) called "anbox-installer". The -installer will perform all necessary steps. You can install it on a system -providing support for snaps by running - -``` -$ snap install --classic anbox-installer -``` - -Alternatively you can fetch the installer script via - -``` -$ wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer -``` - -Please note that we don't support any possible Linux distribution out there -yet. Please have a look at the following chapter to see a list of supported -distributions. - -To proceed the installation process simply called - -``` -$ anbox-installer -``` - -This will guide you through the installation process. - -**NOTE:** Anbox is currently in a **pre-alpha development state**. Don't expect a -fully working system for a production system with all features you need. You will -for sure see bugs and crashes. If you do so, please don't hestitate and report them! - -**NOTE:** The Anbox snap currently comes **completely unconfined** and is because of -this only available from the edge channel. Proper confinement is a thing we want -to achieve in the future but due to the nature and complexity of Anbox this isn't -a simple task. - -## Supported Linux Distributions - -At the moment we officially support the following Linux distributions: - - * Ubuntu 16.04 (xenial) - -Untested but likely to work: - - * Ubuntu 14.04 (trusty) - * Ubuntu 16.10 (yakkety) - * Ubuntu 17.04 (zesty) - -## Install and Run Android Applications - -## Build from source - -To build the Anbox runtime itself there is nothing special to know. We're using -cmake as build system. A few build dependencies need to be present on your host -system: - - * libdbus - * google-mock - * google-test - * libboost - * libboost-filesystem - * libboost-log - * libboost-iostreams - * libboost-program-options - * libboost-system - * libboost-test - * libboost-thread - * libcap - * libdbus-cpp - * mesa (libegl1, libgles2) - * glib-2.0 - * libsdl2 - * libprotobuf - * protobuf-compiler - * lxc - -On an Ubuntu system you can install all build dependencies with the following -command: - -``` -$ sudo apt install build-essential cmake cmake-data debhelper dbus google-mock \ - libboost-dev libboost-filesystem-dev libboost-log-dev libboost-iostreams-dev \ - libboost-program-options-dev libboost-system-dev libboost-test-dev \ - libboost-thread-dev libcap-dev libdbus-1-dev libdbus-cpp-dev libegl1-mesa-dev \ - libgles2-mesa-dev libglib2.0-dev libglm-dev libgtest-dev liblxc1 \ - libproperties-cpp-dev libprotobuf-dev libsdl2-dev lxc-dev pkg-config \ - protobuf-compiler -``` - -Afterwards you can build Anbox with - -``` -$ mkdir build -$ cd build -$ cmake .. -$ make -``` - -A simple - -``` -$ make install -``` - -will install the necessary bits into your system. - -If you want to build the anbox snap instead you can do this with the following -steps: - -``` -$ mkdir android-images -$ cp /path/to/android.img android-images/android.img -$ snapcraft -``` - -The result will be a .snap file you can install on a system supporting snaps - -``` -$ snap install --dangerous --devmode anbox_1_amd64.snap -``` - -## Run Anbox - -Running Anbox from a local build requires a few more things you need to know -about. Please have a look at the ["Runtime Setup"](docs/runtime-setup.md) -documentation. - -## documentation - -You will find additional documentation for Anbox in the *docs* subdirectory -of the project source. - -Interesting things to have a look at - - * [Runtime Setup](docs/runtime-setup.md) - * [Build Android image](docs/build-android.md) - -## Reporting bugs - -If you have found an issue with Anbox, please [file a bug](https://github.com/anbox/anbox/issues/new). - -## Get in Touch - -If you want to get in contact with the developers please feel free to join the -*#anbox* IRC channel on [FreeNode](https://freenode.net/). - -## Copyright and Licensing - -Anbox reuses code from other projects like the Android QEMU emulator. These -projects are available in the external/ subdirectory with the licensing terms -included. - -The anbox source itself, if not stated differently in the relevant source files, -is licensed under the terms of the GPLv3 license. - ------------------------------------------------ - -via: https://github.com/anbox/anbox/blob/master/README.md - -作者:[ Anbox][a] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:http://anbox.io/ diff --git a/translated/tech/20170406 Anbox - Android in a Box.md b/translated/tech/20170406 Anbox - Android in a Box.md new file mode 100644 index 0000000000..a206f29624 --- /dev/null +++ b/translated/tech/20170406 Anbox - Android in a Box.md @@ -0,0 +1,174 @@ +# Anbox + +Anbox 是一个基于容器的方式来在像 Ubuntu 这样的常规的 GNU Linux 系统上启动一个完整的 Android 系统。 + +## 概述 + +Anbox 使用 Linux 命名空间(user、pid、uts、net、mount、ipc)来在容器中运行完整的 Android 系统并提供任何基于 GNU Linux 平台的 Android 程序。 + +容器内的 Android 无法直接访问任何硬件。所有硬件访问都通过主机上的 anbox 守护进程进行。我们重用基于QEMU的模拟器实现的 Android 中的 GL、ES 加速渲染。容器内的 Android 系统使用不同的管道与主机系统通信并通过它发送所有硬件访问命令。 + +有关更多详细信息,请参考下文档: + + * [Android 硬件 OpenGL ES 仿真设计概述](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/android-emugl/DESIGN) + * [Android QEMU 快速管道](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMU-PIPE.TXT) + * [Android 的 "qemud" 复用守护进程](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD.TXT) + * [Android qemud 服务](https://android.googlesource.com/platform/external/qemu/+/emu-master-dev/android/docs/ANDROID-QEMUD-SERVICES.TXT) + +Anbox 目前适合桌面使用,但也可使用移动操作系统,如 Ubuntu Touch、Sailfish OS 或 Lune OS。然而,由于目前 Android 程序映射针对桌面环境,因此这还需要额外的工作来支持其他的用户界面。 + +Android 运行时环境带有一个基于[ Android 开源项目](https://source.android.com/)镜像的最小自定义 Android 系统。所使用的镜像目前基于 Android 7.1.1 + +## 安装 + +安装过程目前由几个需要添加其他组件到系统中的步骤组成。包括: + +  * 没有分发版内核同时启用的 binder 和 ashmen 原始内核模块 +  * 使用 udev 规则为 /dev/binder 和 /dev/ashmem 设置正确权限 +  * 能够启动 Anbox 会话管理器作为用户会话的一个启动任务 + +为了使这个过程尽可能简单,我们做了一个简单的步骤(见 https://snapcraft.io),称为 “anbox-installer”。这个安装程序会执行所有必要的步骤。你可以在所有支持 snap 的系统运行下面的命令安装它。 + +``` +$ snap install --classic anbox-installer +``` + +另外你可以通过下面的命令下载安装脚本。 + +``` +$ wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer +``` + +请注意,我们还不支持除本文列出的其他 Linux 发行版。请查看下面的章节了解支持的发行版。 + +运行下面的命令进行安装。 + +``` +$ anbox-installer +``` + +本篇会引导你完成安装过程。 + +**注意:** Anbox 目前处于** pre-alpha 的开发状态**。不要指望它具有生产环境你需要的所有功能。你肯定会遇到错误和崩溃。如果你遇到了,请不要犹豫并报告他们! + +**注意:** Anbox snap 目前 **完全没有约束**,这是因为它只能从前沿频道获取。正确的约束是我们想要在未来实现的,但由于 Anbox 的性质和复杂性,这不是一个简单的任务。 + +## 已支持的 Linux 发行版 + +目前我们官方支持下面的 Linux 发行版: + + * Ubuntu 16.04 (xenial) + +未测试但可能支持的: + + * Ubuntu 14.04 (trusty) + * Ubuntu 16.10 (yakkety) + * Ubuntu 17.04 (zesty) + +## 安装并运行 Android 程序 + +## 从源码构建 + +要构建 Anbox 运行时不需要特别了解什么,我们使用 cmake 作为构建系统。你系统中只需要一点构建依赖: + + * libdbus + * google-mock + * google-test + * libboost + * libboost-filesystem + * libboost-log + * libboost-iostreams + * libboost-program-options + * libboost-system + * libboost-test + * libboost-thread + * libcap + * libdbus-cpp + * mesa (libegl1, libgles2) + * glib-2.0 + * libsdl2 + * libprotobuf + * protobuf-compiler + * lxc + +在 Ubuntu 系统中你可以用下面的命令安装所有的依赖: + +``` +$ sudo apt install build-essential cmake cmake-data debhelper dbus google-mock \ + libboost-dev libboost-filesystem-dev libboost-log-dev libboost-iostreams-dev \ + libboost-program-options-dev libboost-system-dev libboost-test-dev \ + libboost-thread-dev libcap-dev libdbus-1-dev libdbus-cpp-dev libegl1-mesa-dev \ + libgles2-mesa-dev libglib2.0-dev libglm-dev libgtest-dev liblxc1 \ + libproperties-cpp-dev libprotobuf-dev libsdl2-dev lxc-dev pkg-config \ + protobuf-compiler +``` + +之后用下面的命令构建 Anbox: + +``` +$ mkdir build +$ cd build +$ cmake .. +$ make +``` + +一个简单的 + +``` +$ make install +``` + +会将必要的二进制安装到你的系统中。 + +如果你想要构建 anbox snap,你可以按照下面的步骤: + +``` +$ mkdir android-images +$ cp /path/to/android.img android-images/android.img +$ snapcraft +``` + +T结果是会有一个 .snap 文件,你可以在支持 snap 的系统上安装。 + +``` +$ snap install --dangerous --devmode anbox_1_amd64.snap +``` + +## 运行 Anbox + +要从本地构建运行 Anbox ,你需要了解更多一点。请参考["运行时步骤"](docs/runtime-setup.md)文档。 + +## 文档 + +在项目源代码的子目录下,你可以找到额外的关于 Anbox 的文档。 + +有兴趣可以看下: + + * [运行时步骤](docs/runtime-setup.md) + * [构建 Android 镜像](docs/build-android.md) + +## 报告 bug + +如果你发现了一个 Anbox 问题,请[提交一个 bug](https://github.com/anbox/anbox/issues/new)。 + +## 取得联系 + +如果你想要与开发者联系,你可以在 [FreeNode](https://freenode.net/) 中加入 *#anbox* 的 IRC 频道。 + +## 版权与许可 + +Anbox 重用了像 Android QEMU 模拟器这样的其他项目。这些项目可在外部、带有许可声明的子目录中得到。 + +anbox 源码本身,如果没有在相关源码中声明其他的许可,默认是 GPLv3 许可。 + +----------------------------------------------- + +via: https://github.com/anbox/anbox/blob/master/README.md + +作者:[ Anbox][a] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:http://anbox.io/