Ubuntu-20.04安装anbox与waydroid问题解决

anbox介绍 (from wikipedia)

Anbox是一个自由及开放源代码兼容层,旨在将Android上的移动应用程序移动游戏移植到GNU/Linux发行版上运行[2]。Anbox的初始版本于2017年4月11日正式发布。

安装anbox

主要参考这个文章:https://ubuntuhandbook.org/index.php/2021/10/anbox-run-android-apps-ubuntu/

  1. load kernel modules
1
2
sudo modprobe ashmem_linux
sudo modprobe binder_linux

​ 查看内核情况: (使用这个命令, 不要使用anbox官网的那个)

1
lsmod | grep -e ashmem_linux -e binder_linux

​ 结果如下(数字无所谓)即可

1
2
3
$ lsmod | grep -e ashmem_linux -e binder_linux
binder_linux 200704 31
ashmem_linux 20480 10
  1. install anbox
1
snap install anbox --beta --devmode

​ updata:

1
snap refresh --beta --devmode anbox

​ show anbox version

1
snap info anbox
  1. set proxy

    安装adb: sudo apt install adb

    使用ifconfig命令获取本机ip (要找形如192.168.1.xxx的)

    一个参考形式的grep:

    1
    ifconfig | grep -o 'inet 192.168.1.[0-9]*' |  grep -o '192.168.1.[0-9]*'

    得到了本机地址: 192.168.1.235

    假设代理端口在7890:()

    1
    adb shell settings put global http_proxy 192.168.1.235:7890
  2. 安装google play添加arm支持

    使用github上的脚本: https://github.com/geeks-r-us/anbox-playstore-installer/

    1
    2
    sudo apt install lzip
    wget -O - https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh | bash
  3. root(未尝试)

    [Installing UI root access manager on Anbox Magisk|failed] [SuperSu|succeeded] · Issue #894 · anbox/anbox

waydroid

https://waydro.id/#install

  1. 介绍(from arch wiki)

    Waydroid 是一种基于容器的方法,用于在常规 GNU/Linux 系统上启动完整的 Android 系统。

  2. 一些问题:

    1. 需要切换到wayland 但是在wayland下fcitx5的输入框位置不会随窗口移动
    2. 大问题: 安装后无法开机
  3. 解决这个问题:
    主要是安装waydroid库的时候引入了高版本的mutter-common;
    需要在secure模式命令行恢复:
    先删除那个库 rm xxx

    1
    2
    3
    4
    sudo apt update
    sudo apt-cache madison mutter-common #查看ubuntu源中mutter-common版本
    sudo apt install mutter-common=3.36.9-0ubuntu0.20.04.2 #安装制定版本
    reboot #重启即可

参考链接

https://docs.anbox.io/userguide/install.html

https://blog.eldernode.com/install-anbox-on-ubuntu-20-04/

https://zhuanlan.zhihu.com/p/50994213

https://ubuntuhandbook.org/index.php/2021/10/anbox-run-android-apps-ubuntu/

-------------end-------------