README.md 6.3 KB
Newer Older
S
Simon Fels 已提交
1 2
# Anbox

S
Simon Fels 已提交
3
Anbox is container based approach to boot a full Android system on a
4
regular GNU Linux system like Ubuntu.
S
Simon Fels 已提交
5 6 7 8 9

## 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
10
any GNU Linux based platform.
S
Simon Fels 已提交
11

12 13 14 15 16 17
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.
S
Simon Fels 已提交
18 19 20

For more details have a look at the following documentation pages:

D
Dan Wiechert 已提交
21 22 23 24
 * [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)
25 26 27 28 29 30 31 32 33

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
S
Simon Fels 已提交
34

35 36
## Installation

37 38 39 40 41 42 43 44 45 46 47 48 49
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
50 51

```
52
$ snap install --classic anbox-installer
53 54
```

55
Alternatively you can fetch the installer script via
56

S
Simon Fels 已提交
57
```
58
$ wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer
S
Simon Fels 已提交
59 60
```

61 62 63
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.
64

65
To proceed the installation process simply called
66

S
Simon Fels 已提交
67
```
68
$ anbox-installer
S
Simon Fels 已提交
69
```
70

71
This will guide you through the installation process.
72

73 74 75
**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!
76

77 78 79 80 81 82
**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
83

84 85 86 87 88 89 90 91 92 93 94
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
S
Simon Fels 已提交
95

96 97
## Build from source

98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
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
136

137
```
138 139 140 141
$ mkdir build
$ cd build
$ cmake ..
$ make
142
```
143

144
A simple
145

146
```
147
$ make install
148
```
149 150 151

will install the necessary bits into your system.

152 153 154 155 156 157 158 159 160 161 162 163 164 165
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
```
S
Simon Fels 已提交
166

167
## Run Anbox
S
Simon Fels 已提交
168

169 170 171
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.
S
Simon Fels 已提交
172

173
## documentation
S
Simon Fels 已提交
174

175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
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
S
Simon Fels 已提交
193

194 195 196
Anbox reuses code from other projects like the Android QEMU emulator. These
projects are available in the external/ subdirectory with the licensing terms
included.
S
Simon Fels 已提交
197

198 199
The anbox source itself, if not stated differently in the relevant source files,
is licensed under the terms of the GPLv3 license.