Android Emulator on 4.1

it worked here now i boot normal, the problem was that i didnt exclude from the memory balance.

let me try install anbox or/and waydroid to see what happens…

I’ve been trying the whole day and got stuck severale times on the anbox startup screen, I even tried to use docker which gave me the same result.
Glad to see you have it working, can you describe the steps that made it work for you?

just create a standalone vm without kernel and HVM mode and exclude it from memory balancing, but now im having another problem, waydroid is installed but i get stucked on this:

  1. started the container with sudo waydroid container start
  2. started the session with waydroid session start
    but android doesnt boot, if i check the status it shows that container and session is running but no wayland display, any idea how to fix it @icequbes1?

waydroid-logcat.log (259.2 KB)

i tried to enable wayland by editing /etc/gdm3/daemon.conf and uncomment “WayLandEnable=True” but no success too

I’ve followed these steps in order, I skipped the git clone GitHub - choff/anbox-modules: Anbox kernel modules part because @icequbes1 said it was unnecessary.
I still get the freeze starting screen from Anbox, am I missing a step?
I’m on QubesOs 4.1

  • sudo apt install software-properties-common dkms linux-image-amd64 linux-headers-amd64 qubes-kernel-vm-support grub2 android-tools-adb anbox && sudo apt update && sudo apt upgrade && sudo grub-install /dev/xvda && sudo update-initramfs -u
  • sudo modprobe ashmem_linux
  • sudo modprobe binder_linux
  • ls -1 /dev/{ashmem,binder}
  • apt list --installed linux-image*
  • anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

user@cc:~$ sudo systemctl status anbox-container-manager.service

● anbox-container-manager.service - Anbox Container Manager
Loaded: loaded (/lib/systemd/system/anbox-container-manager.service; enabled; vendor preset: ena>
Active: inactive (dead)
Condition: start condition failed at Sun 2022-04-24 04:11:50 EDT; 6min ago
└─ ConditionPathExists=/var/lib/anbox/android.img was not met
Docs: man:anbox(1)

Apr 24 04:11:50 cc systemd[1]: Condition check resulted in Anbox Container Manager being skipped.

1 Like

I got it working!
Thanks for the tips

For other people interested in the solution, the steps below worked for me.

create New qube
Name and label: anbox-qube
Type: Standalone VM
Template: debian
Networking: sys-firewall
Launch setting after creation

under tab Basic
I gave it 15 GB diskspace
under tab Advanced
/section/Memory/CPU
initial memory: 800 mb
VCPUs:
exclude in memory balancing (tick off the box)
/section/Kernel/
none
/section/Virtualization
Mode: HVM (current)
apply - ok

user@anboxqube:~$ sudo add-apt-repository ppa:morphis/anbox-support
enter
user@anboxqube:~$ sudo apt install software-properties-common
user@anboxqube:~$ sudo modprobe ashmem_linux
user@anboxqube:~$ sudo modprobe binder_linux
user@anboxqube:~$ ls -1 /dev/{ashmem,binder}
user@anboxqube:~$ snap install --devmode --beta anbox
user@anboxqube:~$ sudo apt update
user@anboxqube:~$ anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

Good luck!

2 Likes

Hello, here is how i did it:

  1. Create a new qube StandAloneVM (Fully persistent) with Debian-11 template and check “Launch settings after creation”

01

  1. On Settings window, go to “Advanced”, uncheck “Include in memory balancing”, set your initial memory.
    2.1 On kernel, set it to (none).
    2.2 On Virtualization, set HVM.

  1. Run the vm, open the terminal to update the package list and upgrade the system to install adb, fastboot and anbox: sudo apt update && sudo apt full-upgrade && sudo apt install adb fastboot anbox

  2. Download the Anbox Android Image and the sha256sum file
    wget https://build.anbox.io/android-images/2018/07/19/android_amd64.img.sha256sum && wget https://build.anbox.io/android-images/2018/07/19/android_amd64.img

  1. Verify the image and move/rename to /var/lib/anbox/android.img

  1. Restart vm, open the terminal, check adb devices and start anbox, wait some seconds, if you have done eveything right, it will run fine.

adb devices && anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity

4 Likes

Depending on the kernel in your debian template, installation of the anbox drivers may be necessary.

1 Like

I see this thread has went the direction of Anbox.

After looking further into Waydroid, it runs under Wayland. Qubes OS uses X11.

It might be possible to run the weston compositor within a qube (e.g., nested under X11), start a shell within weston, and then run waydroid.

1 Like

Hello! Nice and great work!
But i have some issue. Can u help me?
This is debian-11

Nice try, but they server is DOWN :smiley:
can you share a file?)

I don’t have the “None” option. Am I missing something?

In the GUI it is Settings->Advanced->Kernel - (provided by qube)

1 Like

Ok, that what I did then.

well, I did follow your step, but didn’t succeeded.

adb didn’t listed any devices.

After running:

$ sudo modprobe ashmem_linux
$ sudo modprobe binder_linux

I could see the emulator listed by adb, but still anbox wouldn’t launch.

Anbox seems to be totally broken generaly speaking , but it’s weird that I can’t reproduce on my machine. The only difference is that I downloaded the img from a mirror ( the link from the post is broken ) and that debian template is a bit more up to date since your post.

Any idea what I could also try ?

Did you start anbox-container-manger.service before starting anbox?

not manually but I can see it with ps -aux

When anbox start, it pop a window with an android logo ( I thing its loading ) and then break

If you start anbox from the command line, do you get an error when it fails to start?

So I start my anbox standalone VM, this is my full prompt:

user@anbox:~$ ps -aux | grep anbox
root         760  0.0  1.6 113168  5552 ?        Ssl  18:12   0:00 /usr/bin/anbox container-manager --daemon --privileged --data-path=/var/lib/anbox
user        1342  0.0  0.2   6320   704 pts/0    S+   18:12   0:00 grep anbox
user@anbox:~$ adb devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached

user@anbox:~$ sudo modprobe ashmem_linux
user@anbox:~$ sudo modprobe binder_linux
user@anbox:~$ adb devices
List of devices attached

user@anbox:~$ anbox launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity
[ 2023-04-10 16:16:00] [launch.cpp:202@operator()] Session manager failed to become ready
user@anbox:~$ adb devices
List of devices attached
emulator-5558	device

Don’t know why you are loading the kernel modules.

Just follow this guide, for me it works, but you need to manually start the service

1 Like