LifestyleAndroid in Docker with out QEMU/emulator

Android in Docker with out QEMU/emulator

-

- Advertisment -

English | 简体中文

Overview

ReDroid (Remote anDroid) is a GPU accelerated AIC (Android In Container) answer. It’s possible you’ll also boot many
cases in Linux host (Docker, podman, k8s etc.). ReDroid supports every arm64 and amd64 architectures.
ReDroid is lawful for Cloud Gaming, VMI (Virtual Cell Infurstrure), Automation Test and extra.

Screenshot of ReDroid 11

Currently supported:

  • Android 12 (redroid/redroid: 12.0.0-most popular, redroid/redroid: 12.0.0-amd64, redroid/redroid: 12.0.0-arm64)
  • Android 12 64bit most productive (redroid/redroid: 12.0.0_64most productive-most popular, redroid/redroid: 12.0.0_64most productive-amd64, redroid/redroid: 12.0.0_64most productive-arm64)
  • Android 11 (redroid/redroid: 11.0.0-most popular, redroid/redroid: 11.0.0-amd64, redroid/redroid: 11.0.0-arm64)
  • Android 10 (redroid/redroid: 10.0.0-most popular, redroid/redroid: 10.0.0-amd64, redroid/redroid: 10.0.0-arm64)
  • Android 9 (redroid/redroid:9.0.0-most popular, redroid/redroid:9.0.0-amd64, redroid/redroid:9.0.0-arm64)
  • Android 8.1 (redroid/redroid:8.1.0-most popular, redroid/redroid:8.1.0-amd64, redroid/redroid:8.1.0-arm64)
- Advertisement -

Examined Platforms:

  • Ubuntu 16.04 / 18.04 / 20.04 (amd64 / arm64)
  • Amazon Linux 2 (amd64 / arm64)
  • Alibaba Cloud Linux 2 (amd64)
  • Alibaba Cloud Linux 3 (amd64 / arm64)
  • WSL 2 (Ubuntu) (amd64)
  • CentOS (amd64*, arm64*)
  • OpenEuler 20.03 (amd64, arm64*)

means need personalized kernel

Getting Started

ReDroid requires some kernel modules (binderfs, ashmem etc.).
Test kernel modules to put in these modules.

- Advertisement -
# originate and repair via `scrcpy`
docker bustle -itd --rm --memory-swappiness=0 --privileged 
    --pull always 
    -v ~/recordsdata:/recordsdata 
    -p 5555: 5555 
    redroid/redroid: 11.0.0-most popular

adb connect <IP>: 5555
scrcpy --serial <IP>: 5555

## explains: 
## --pull always  -- be sure that to utilize the most popular image
## -v ~/recordsdata:/recordsdata  -- mount recordsdata partition
## -p 5555: 5555 -- expose adb port, you might well connect via `adb connect `

Configuration

required params (already added in docker image)

  • qemu=1
  • androidboot.hardware=redroid

uncover params

  • redroid.width=720
  • redroid.top=1280
  • redroid.fps=15
  • ro.sf.lcd_density=320
  • redroid.enable_built_in_display=[0|1]
  • redroid.overlayfs=[0|1]

Community:

  • internet.eth0.dns1=
- Advertisement -

GPU accelerating
ReDroid use mesa3d to toddle 3D rendering.
Currently tested platforms:

  • AMD (arm64, amd64 with amdgpu driver)
  • Intel (amd64 with i915 driver)
  • virtio-gpu (supplier agnostic, arm64 and amd64)

params:

  • redroid.gpu.mode=[auto|host|guest]
  • redroid.gpu.node=[/dev/dri/renderDxxx]

Virtual WiFi (Experiment in ReDroid 10, make broken, repair quickly)

  • ro.kernel.qemu.wifi=1
    Virtual WiFi is still below development, be sure mac80211_hwsim exist (modprobe mac80211_hwsim).
    checkout redroid-10-wifi in supplier/redroid and redroid-10.0.0 in machine/generic/goldfish to make
    your make. bustle docker exec ip r add default via 192.168.232.1 dev wlan0

NOTE: you might well override machine props prefixed with qemu. or ro.. for instance, you might well quandary ro.stable=0, then
you might well also fetch root adb shell by default.

Native Bridge Red meat up

It’s that you just might well imagine to bustle arm Apps in x86 ReDroid instance via libhoudini, libndk_translator or QEMU translator.

Fetch libndk_translator for instance:

# grab libndk_translator libs from Android 11 Emulator
bag /machine ( -title 'libndk_translation*' -o -title '*arm*' -o -title 'ndk_translation*' ) | tar -cf native-bridge.tar -T -

# example development, watch out the file proprietor and mode

machine/
├── bin
│   ├── arm
│   └── arm64
├── etc
│   ├── binfmt_misc
│   └── init
├── lib
│   ├── arm
│   └── libnb.so
└── lib64
    ├── arm64
    └── libnb.so

# Dockerfile
FROM redroid/redroid: 11.0.0-amd64

ADD native-bridge.tar /

COPY manufacturing facility.prop /manufacturing facility/manufacturing facility.prop

# manufacturing facility.prop
ro.product.cpu.abilist=x86_64,arm64-v8a,x86,armeabi-v7a,armeabi
ro.product.cpu.abilist64=x86_64,arm64-v8a
ro.product.cpu.abilist32=x86,armeabi-v7a,armeabi
ro.dalvik.vm.isa.arm=x86
ro.dalvik.vm.isa.arm64=x86_64
ro.allow.native.bridge.exec=1
ro.dalvik.vm.native.bridge=libndk_translation.so
ro.ndk_translation.version=0.2.2

# make docker image
docker make . -t redroid: 11.0.0-amd64-nb

GMS Red meat up

It’s that you just might well imagine to add GMS (Google Cell Service) toughen in ReDroid via Start GApps
or MicroG.

WebRTC Streaming

CALL FOR HELP

Idea to port WebRTC alternate choices from cuttlefish, including frontend (HTML5), backend and plenty digital HALs.

How To Form

It’s Identical as AOSP building course of. Nonetheless I indicate to utilize docker to make.

Test android-builder-docker for runt print.

Troubleshooting

  • Container disappeared at the moment

be sure the required kernel modules are establish in; bustle dmesg -T for detailed logs

  • Container working, but adb can not connect (machine offline etc.)

bustle docker exec -it sh, then test ps -A and logcat

attempt dmesg -T if can not fetch a container shell

Expose

  • Kernel 5.7+, need allow binderfs / ashmem
  • redroid require pid_max lower than 65535, or else might additionally merely bustle into issues. Substitute in host OS, or add pid_max separation toughen in PID namespace
  • SElinux is disabled in ReDroid; that you just might well imagine enabled with selinuxns POC
  • sdcardfs currently no longer carried out, use fuse as a change; might additionally need bustle modprobe fuse first in some OS (AmazonLinux2 ?)
  • CGroups errors left out; some (stune for instance) no longer supported in generic linux.
  • procfs no longer totally seperated with host OS; Community use lxcfs and a few cloud supplier (TencentOS) enhanced of their very own kernel.
  • vintf test disabled (since no kernel)

Contact Me

License

ReDroid itself is below

Be part of the pack! Be part of 8000+ others registered users, and fetch chat, make teams, put up updates and make friends across the enviornment!
www.knowasiak.com/register/

- Advertisement -

2 Comments

  1. Came across this very useful project. It provides Docker images with Android running directly in Docker, without qemu or an emulator. I've never seen this before, all other solutions that I'm aware of either run the Android emulator in Docker or use qemu directly (like Anbox).

    Advantage of this is that it's very lightweight and does not require VT-X or AMD-V, ideal for running in cloud environments that typically do not expose this CPU capability.

You might also likeRELATED
Recommended to you

Display HN: Language model diagnosis and visualization toolkit

Ecco is a python library for exploring and explaining Natural Language Processing models using interactive visualizations. Ecco provides multiple interfaces to aid the explanation and intuition of Transformer-based language models. Read: Interfaces for Explaining Transformer Language Models. Ecco runs inside Jupyter notebooks. It is built on top of pytorch and transformers. Ecco is not concerned…

PDP-11 Booting

So you want to play Adventure, but don't know how to turn on the PDP-11? These instructions are for booting our dual rack machine from its RL01 drives, although booting the single cabinet machine from the RK05 is very similar. Bootup Turn on the VT100 using the switch in the back. It should beep and…

Behind the Spotify Wrapped API scenes

Understanding the components to the Spotify Wrapped generated story.By Den Delimarsky in HackeryDecember 2, 2021Every year (unless you’re one of those Apple Music people) music fans rejoice to get their Spotify Wrapped, or - the musical year in review. It’s a fun way to explore the most frequently listened to songs and artists. And every…
- Advertisement -

The worldly turn: A return to economics that studies the real world

For the workers who are curious why their wages have not increased in the past decade – while the...

Netflix and Microsoft show video gaming has become too big to ignore

Young happy Asian couple playing video games in living room. Cheerful people having fun with computer gaming concept.Blue Planet StudioThe business of video games is having a moment.Less than two weeks after Take-Two announced its $12.7 billion for Zynga, and just days after Microsoft announced its record-breaking $69 billion acquisition of Activision Blizzard, Netflix co-founder…

Must read

Command palettes: how typing commands became the norm again

It took little under a decade for the headline...

Billionaire Chamath Palihapitiya: ‘nobody cares’ about China’s Uyghur genocide

WASHINGTON – Billionaire investor Chamath Palihapitiya triggered a backlash on social media after saying during a recent episode of his podcast that "nobody cares" about the ongoing human rights abuses against the Uyghurs in China.During a 90-minute episode, Palihapitiya told co-host Jason Calacanis on their "All-In" podcast that he would be lying if he said that…
- Advertisement -