Waydroid doesn't work in latest stable channel, because the package version is outdated, and requires an older kernel API, which is not supported in the newest kernel (5.18 was the first version to deprecate ashmem). There is a Waydroid config option to disable use of ashmem, but the shipped version fails to start because it tries to load the module despite it being disabled in the config.
This config issue has been solved in a more recent release of Waydroid, so updating the package could solve the problem.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Thanks for the info @ollieparanoid - I tried it on edge already yesterday, however, the patch was not merged back then. I will try to check it tomorrow.
I've looked into this for a bit. There's a lot of good information in the upstream issue:
CONFIG_BPF_SYSCALL needs to be enabled
psi=1 needs to be set
!3901 (closed) makes these changes and can be installed on postmarketOS edge with mrtest add 3901 for people who want to help out debugging and fixing this.
So with this installed, my debugging session:
Install and extract the android images:
$ sudo waydroid init
Starting the container (what the waydroid-container service does)
$ waydroid --details-to-stdout session start[gbinder] Service manager /dev/binder has appeared[gbinder] WARNING: Service manager /dev/binder has died
Then it hangs/is in a main loop waiting.
This "/dev/binder" message is mentioned in the upstream message.
Meanwhile on the container terminal from 2.:
(003556) [21:50:32] % /usr/lib/waydroid/data/scripts/waydroid-net.sh startvnic is waydroid0(003556) [21:50:32] % chmod 777 -R /dev/dri(003556) [21:50:32] % chmod 777 -R /dev/fb0(003556) [21:50:32] % chmod 777 -R /dev/video3(003556) [21:50:32] % chmod 777 -R /dev/video2(003556) [21:50:32] % chmod 777 -R /dev/video1(003556) [21:50:32] % chmod 777 -R /dev/video0(003556) [21:50:32] % mv /var/lib/waydroid/config_session /var/lib/waydroid/lxc/waydroid(003556) [21:50:32] % mount -o ro /var/lib/waydroid/images/system.img /var/lib/waydroid/rootfs(003556) [21:50:32] % mount -t overlay -o ro,lowerdir=/var/lib/waydroid/overlay:/var/lib/waydroid/rootfs,upperdir=/var/lib/waydroid/overlay_rw/system,workdir=/var/lib/waydroid/overlay_work/system,xino=off overlay /var/lib/waydroid/rootfs(003556) [21:50:33] % mount -o ro /var/lib/waydroid/images/vendor.img /var/lib/waydroid/rootfs/vendor(003556) [21:50:33] % mount -t overlay -o ro,lowerdir=/var/lib/waydroid/overlay/vendor:/var/lib/waydroid/rootfs/vendor,upperdir=/var/lib/waydroid/overlay_rw/vendor,workdir=/var/lib/waydroid/overlay_work/vendor,xino=off overlay /var/lib/waydroid/rootfs/vendor(003556) [21:50:33] % mount -o bind /var/lib/waydroid/waydroid.prop /var/lib/waydroid/rootfs/vendor/waydroid.prop(003556) [21:50:33] Save config: /var/lib/waydroid/waydroid.cfg(003556) [21:50:33] % lxc-start -P /var/lib/waydroid/lxc -F -n waydroid -- /init(003556) [21:50:33] New background process: pid=5780, output=background(003556) [21:50:33] % lxc-info -P /var/lib/waydroid/lxc -n waydroid -sHRUNNING[gbinder] Service manager /dev/binder has appeared[gbinder] WARNING: Service manager /dev/binder has diedlxc-start: waydroid: ../src/lxc/conf.c: run_buffer: 322 Script exited with status 126lxc-start: waydroid: ../src/lxc/start.c: lxc_end: 985 Failed to run lxc.hook.post-stop for container "waydroid"
The container stops at this point. I had some logcat output earlier, but didn't save it and can't get it anymore with above procedure currently.
$ sudo waydroid logcat[21:53:58] WayDroid container is STOPPED
The wiki page mentions cgroups, so this might be relevant:
$ mount | grep cgrouptmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,size=4096k,nr_inodes=1024,mode=755)cgroup2 on /sys/fs/cgroup/unified type cgroup2 (rw,nosuid,nodev,noexec,relatime)cgroup on /sys/fs/cgroup/elogind type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/libexec/elogind/elogind-cgroups-agent,name=elogind)openrc on /sys/fs/cgroup/openrc type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc)cpuset on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)cpu on /sys/fs/cgroup/cpu type cgroup (rw,nosuid,nodev,noexec,relatime,cpu)cpuacct on /sys/fs/cgroup/cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct)blkio on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)memory on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)devices on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)freezer on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)net_cls on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)perf_event on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)net_prio on /sys/fs/cgroup/net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,net_prio)hugetlb on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)pids on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
So... unfortunately it doesn't work yet, but !3901 (closed) should get us closer. If somebody is willing to invest some time to figure this out, then install it on edge, try to start the container and session and figure out what's going on. Get the logcat output, read the waydroid source, and if you have a rough idea, maybe upstream is willing to help out some more.
Personally I won't spend more time on debugging this as I'd rather run native applications and have enough other tasks.
Bonus points for updating the wiki page with up-to-date instructions when this works again. (also right now it says one should install iptables and dnsmasq... but if these are hard dependencies, these should be depends of the waydroid package instead of having the user install them manually; creating a MR to alpine's aports would fix that.)
CC: @deathmist: thanks for the helpful comments you made in the upstream issue. Do you have another pointer for figuring this out? And I wonder if you have it working with another device than the pinephone on postmarketOS since you made !3508 (merged)... or can we assume it's broken on every device with pmOS?
As I mentioned on !3901 (closed) already if those two configs fix the issue they should be added to the Waydroid kconfig check assuming they are what's missing :)
After that all existing kernels checking community or waydroid options should be fixed and as needed backports to stable provided so Waydroid starts working there as well
Thanks for the detailed reply! I've enabled both CONFIG_BPF_SYSCALL=y & CONFIG_CGROUP_BPF=y now (also in !3901 (closed)) and tested that on a pinephone, and it gets further, see logs below. As it doesn't completely work yet, I'll not include it in this service pack; but it seems like we are close. Agreed that once we know the missing kernel options, pmb kconfig check should be adjusted and it should be fixed for all devices in main and community.
Hm it really shouldn't take that long; on my Lenovo tablet (booted from a USB 3.0 stick mind you) after first launch it only takes 15 seconds to get to UI after invocation of waydroid show-full-ui; maybe a waydroid logcat would be useful to see where it's getting hung up
Also of interest would be how long subsequent launches take. Meanwhile I can setup Waydroid as fresh on my tablet to see how it goes there on initial start.
Thanks! I'll do something else now, but I'll try to provide another android logcat, play around with it some more and finish the TODOs in the related MR another time (unless somebody else wants to take over; feel free to do so!)
Regarding logcat, I did post one above that I ran right when I noticed it was "hanging". it probably doesn't contain the interesting things on what it has been taking so long though.
On aports linux-lts, we just disabled CONFIG_ANDROID_BINDER_IPC_SELFTEST which is probably causing a very long startup. I noted we still got y on Pinephone, and so probably other devices kernels. That may explain why Waydroid still never show up on PinephonePro (tried today).
Very interesting, @ollieparanoid@Newbyte in case that helps CONFIG_ANDROID_BINDER_IPC_SELFTEST should also be in the kconfig check and disabled, never even thought of it as I've just never enabled it.
With !3975 (closed) merged (and once binary packages are built), this is fixed in edge now. I plan to backport this to stable as part of the next service pack, ETA ~ end of this week (#1999 (closed)). Then we can close this issue.
After that, as stated in the instructions, I had a waydroid icon on my phosh desktop, and so tried to start it.
It did start, immediately also, and allowed me to select the android image to download (vanilla vs gapps).
It did download the images, and that initial process was fine until the in-app log told me the following error: [Errno 2] No such file or directory: 'modprobe'. I assure you, modprobeis in my system, so the error may be misleading: maybe paths related, maybe containers, I don't know.
After that error, it just stayed there, not doing anything else. It gave me a "continue" option, which frankly don't remember what was the result of picking it, but whatever the case I ended up with no app working, so restarted the os just in case some waydroid subsystem needed kernel modules started at boot time or something like that (the modprobe error made me speculate about kernel modules problems).
At next boot, waydroid just doesn't start, at all. By "start" I mean "clicking the icon on the desktop". It's supposed to be starting (the desktop goes to the "app starting" mode), but it doesn't. Not even the image selection ui shows anymore: it does nothing. ps ax shows nothing waydroid related, CPU is at 0% in htop while waydroid is supposed to be starting. I'd say it just crashes, and phosh doesn't realize about that.
I found this thread, with some waydroid related commands. That way I've found some logs. Here's a log for a launch try:
(004070) [12:02:36] % lxc-info -P /var/lib/waydroid/lxc -n waydroid -sHwaydroid doesn't exist(004070) [12:02:36] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(004070) [12:02:36] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log(004070) [12:02:36] Couldn't get LXC status. Assuming STOPPED.(004070) [12:02:36] % modprobe -q ashmem_linux(004070) [12:02:36] ERROR: [Errno 2] No such file or directory: 'modprobe'(004070) [12:02:36] See also: <https://github.com/waydroid>(004070) [12:02:36] Traceback (most recent call last): File "/usr/lib/waydroid/tools/__init__.py", line 85, in main actions.container_manager.start(args) File "/usr/lib/waydroid/tools/actions/container_manager.py", line 111, in start helpers.drivers.probeAshmemDriver(args) File "/usr/lib/waydroid/tools/helpers/drivers.py", line 116, in probeAshmemDriver tools.helpers.run.user(args, command, check=False) File "/usr/lib/waydroid/tools/helpers/run.py", line 58, in user return tools.helpers.run_core.core(args, msg, cmd, working_dir, output, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/helpers/run_core.py", line 335, in core (code, output_after_run) = foreground_pipe(args, cmd, working_dir, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/helpers/run_core.py", line 147, in foreground_pipe process = subprocess.Popen(cmd, stdout=subprocess.PIPE, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError: [Errno 2] No such file or directory: 'modprobe'(004061) [12:02:36] Introspect error on :1.90:/Initializer: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying(004061) [12:02:36] Executing introspect queue due to error(004061) [12:02:36] Starting waydroid session(004074) [12:02:37] % lxc-info -P /var/lib/waydroid/lxc -n waydroid -sHwaydroid doesn't exist(004074) [12:02:37] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(004074) [12:02:37] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log(004074) [12:02:37] Couldn't get LXC status. Assuming STOPPED.(004074) [12:02:37] % modprobe -q ashmem_linux(004074) [12:02:37] ERROR: [Errno 2] No such file or directory: 'modprobe'(004074) [12:02:37] See also: <https://github.com/waydroid>(004074) [12:02:37] Traceback (most recent call last): File "/usr/lib/waydroid/tools/__init__.py", line 85, in main actions.container_manager.start(args) File "/usr/lib/waydroid/tools/actions/container_manager.py", line 111, in start helpers.drivers.probeAshmemDriver(args) File "/usr/lib/waydroid/tools/helpers/drivers.py", line 116, in probeAshmemDriver tools.helpers.run.user(args, command, check=False) File "/usr/lib/waydroid/tools/helpers/run.py", line 58, in user return tools.helpers.run_core.core(args, msg, cmd, working_dir, output, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/helpers/run_core.py", line 335, in core (code, output_after_run) = foreground_pipe(args, cmd, working_dir, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/helpers/run_core.py", line 147, in foreground_pipe process = subprocess.Popen(cmd, stdout=subprocess.PIPE, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename)FileNotFoundError: [Errno 2] No such file or directory: 'modprobe'(004061) [12:02:37] Introspect error on :1.91:/ContainerManager: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying(004061) [12:02:37] Executing introspect queue due to error(004061) [12:02:37] org.freedesktop.DBus.Error.ServiceUnknown: The name :1.91 was not provided by any .service files(004061) [12:02:37] WayDroid container is not listening
Again the modprobe noise.
Note that I can run modprobe -q ashmem_linux on the pmos console without problem: modprobe is there, and that command doesn't trigger any error.
I don't know if I should do anything else: first attempt to ever run waydroid, so I'm quite ignorant about it and there's quite a lot to read. Whatever the case, given that I run edge, I believe this information is significant to this ticket.
Let me know if I can help somehow to debug this.
Thanks.
Here's the current full error message from /var/lib/waydroid/waydroid.log after a run attempt:
(006119) [13:09:31] Starting waydroid session(005002) [13:09:31] % /usr/lib/waydroid/data/scripts/waydroid-net.sh startvnic is waydroid0Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension MASQUERADE revision 0 not supported, missing kernel module?iptables v1.8.10 (nf_tables): RULE_APPEND failed (No such file or directory): rule in chain POSTROUTINGFailed to setup waydroid-net.Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension tcp revision 0 not supported, missing kernel module?Warning: Extension MASQUERADE revision 0 not supported, missing kernel module?iptables: Bad rule (does a matching rule exist in that chain?).Warning: Extension udp revision 0 not supported, missing kernel module?Warning: Extension CHECKSUM revision 0 not supported, missing kernel module?iptables: Bad rule (does a matching rule exist in that chain?).(005002) [13:09:31] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^(005002) [13:09:31] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log(006119) [13:09:31] org.freedesktop.DBus.Python.RuntimeError: Traceback (most recent call last): File "/usr/lib/python3.11/site-packages/dbus/service.py", line 712, in _message_cb retval = candidate_method(self, *args, **keywords) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/actions/container_manager.py", line 34, in Start do_start(self.args, session) File "/usr/lib/waydroid/tools/actions/container_manager.py", line 138, in do_start tools.helpers.run.user(args, command) File "/usr/lib/waydroid/tools/helpers/run.py", line 58, in user return tools.helpers.run_core.core(args, msg, cmd, working_dir, output, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/waydroid/tools/helpers/run_core.py", line 343, in core check_return_code(args, code, log_message) File "/usr/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code raise RuntimeError("Command failed: " + log_message)RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start(006119) [13:09:31] RuntimeError: Command failed: % /usr/lib/waydroid/data/scripts/waydroid-net.sh start
Looks like some bad iptables config when trying to set up a virtual network device.
This is a fully up-to-date PMOS edge, with also fully up-to-date waydroid (sudo waydroid update), both updated minutes ago.
After taking a look again at the wiki to check this network error, this time there's an actual fix noted there: sudo apk add iptables-legacy
Installing iptables-legacy solved my network error, and so Waydroid finally ran on my device. It showed an android-like desktop, added some icons to PMOS desktop, and I was able to access the default installed waydroid apps. I think this is a case closed for me.
I've been using Waydroid just fine on the PineTab 2 as well. I'll just close this given that it's become a catch-all issue for people having issues starting Waydroid, which isn't actionable. If you still have issues with Waydroid, please open a new issue and include reproduction details and which device you're using.