Redroid
1.初始环境
- Ubuntu Desktop 24.04 LTS
- Vmware Workstation
1.安装远程工具
sh
export ALL_PROXY="http://192.168.2.12:7890"
sudo apt update
sudo apt-get install ssh
service ssh start
service ssh status
sudo apt install net-tools
ifconfig
# 桥接模式要在VMware中新建一个桥接配置
2.安装docker
Docker 官方教程:https://docs.docker.com/engine/install/ubuntu/
设置 Docker 的apt存储库。
sh
sudo apt install gnome-terminal
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo docker run hello-world
#配置开机启动
sudo systemctl enable docker
2.安装docker 管理工具 Portainer
管理页面: http://localhost:80
sh
# 创建存储卷
sudo docker volume create portainer_data
# 启动服务
sudo docker run -d -p 80:9000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v portainer_data:/data \
portainer/portainer
提示Virtualization support 错误
关闭虚拟机
在虚拟机设置中开启虚拟化
3.安装Redroid
sh
## 安装 docker https://docs.docker.com/engine/install/#server
## 安装 kernel modules
sudo su
apt install linux-modules-extra-`uname -r`
modprobe binder_linux devices="binder,hwbinder,vndbinder"
modprobe ashmem_linux
## running redroid
sudo docker run -itd --rm --privileged \
--pull always \
-v ~/data:/data \
-p 5555:5555 \
redroid/redroid:9.0.0-latest
## redroid libhoudini support arm arm64
sudo docker run -itd --rm --privileged \
-v ~/data:/data \
-p 5555:5555 \
teddynight/redroid:latest \
androidboot.redroid_net_proxy_type=static \
androidboot.hardware=mt6891 \
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.enable.native.bridge.exec=1 \
ro.enable.native.bridge.exec64=1 \
ro.dalvik.vm.native.bridge=libhoudini.so
### Explanation:
### --pull always -- use latest image
### -v ~/data:/data -- mount data partition
### -p 5555:5555 -- expose adb port
### DISCLAIMER
### Should NOT expose adb port on public network
### otherwise, redroid container (even host OS) may get compromised
4.安装adb工具
sh
## install adb https://developer.android.com/studio#downloads
sudo apt install android-tools-adb
sudo apt install android-tools-fastboot
adb connect 127.0.0.1:5555
### NOTE: change localhost to IP if running redroid remotely
5.安装远程链接工具
sh
## view redroid screen
## install scrcpy https://github.com/Genymobile/scrcpy/blob/master/README.md#get-the-app
sudo apt install scrcpy
scrcpy -s 127.0.0.1:5555
### NOTE: change localhost to IP if running redroid remotely
### typically running scrcpy on your local PC
https://github.com/sickcodes/Droid-NDK-Extractorhttps://blog.seeflower.dev/archives/203/ 在rock5b上使用redroid
https://blog.seeflower.dev/archives/258/ 在x86下体验ReDroid https://ivonblog.com/posts/redroid-android-docker/ ReDroid教學:用Docker跑Android系統,在x86電腦玩ARM手機遊戲