Waydroid not working

I am not able to start a waydroid session with “waydroid session start”.
I followed the Nix wiki for waydroid and got problem when a i try to start a session with error “[17:02:34] RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start”.

There is errors on “waydroid log” :

waydroid-net isn't running
(003882) [17:02:19] % systemctl is-enabled -q nfcd
(023782) [17:02:26] % lxc-info -P /var/lib/waydroid/lxc -n waydroid -sH
STOPPED
(023782) [17:02:26] % modprobe -q ashmem_linux
(023782) [17:02:26] % chmod 666 -R /dev/binder
(023782) [17:02:26] % chmod 666 -R /dev/vndbinder
(023782) [17:02:26] % chmod 666 -R /dev/hwbinder
(023782) [17:02:34] % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Failed to setup waydroid-net.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
(023782) [17:02:34] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(023782) [17:02:34] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(023818) [17:02:34] org.freedesktop.DBus.Python.RuntimeError: Traceback (most recent call last):
  File "/nix/store/fbx0x4icf27za3n1xmg9xspqs9kxg161-python3.12-dbus-python-1.4.0/lib/python3.12/site-packages/dbus/service.py", line 712, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/actions/container_manager.py", line 31, in Start
    do_start(self.args, session)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/actions/container_manager.py", line 138, in do_start
    tools.helpers.run.user(args, command)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run.py", line 58, in user
    return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start

(023818) [17:02:34] RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start
(023939) [17:03:21] % tail -n 60 -F /var/lib/waydroid/waydroid.log
(023939) [17:03:21] *** output passed to waydroid stdout, not to this log ***

I am running on zen kernel and nixpkgs 25.05 .
Cpu: amd 5 5600
Gpu: amd rx6700
This is my personal flake :
Nixos

It seems waydroid wants to set up a IPv4 NAT (even for IPv6, but that’s even more broken) with iptables but fails, probably because you have nftables enabled.

If you can, set networking.nftables.enable = false and try again.

It’s a known issue, by the way:

Thanks for your reply .
Unfortunately setting networking.nftables.enable = false didn’t seem to solve it .
waydroid log output is :

  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start

(004677) [21:30:33] RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start
(000966) [21:32:12] % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start
vnic is waydroid0
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Failed to setup waydroid-net.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
modprobe: FATAL: Module ip_tables not found in directory /run/booted-system/kernel-modules/lib/modules/6.17.1-zen1
iptables v1.8.11 (legacy): can't initialize iptables table `mangle': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
(000966) [21:32:12] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(000966) [21:32:12] NOTE: The failed command's output is above the ^^^ line in the log file: /var/lib/waydroid/waydroid.log
(022004) [21:32:12] org.freedesktop.DBus.Python.RuntimeError: Traceback (most recent call last):
  File "/nix/store/fbx0x4icf27za3n1xmg9xspqs9kxg161-python3.12-dbus-python-1.4.0/lib/python3.12/site-packages/dbus/service.py", line 712, in _message_cb
    retval = candidate_method(self, *args, **keywords)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/actions/container_manager.py", line 31, in Start
    do_start(self.args, session)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/actions/container_manager.py", line 138, in do_start
    tools.helpers.run.user(args, command)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run.py", line 58, in user
    return tools.helpers.run_core.core(args, msg, cmd, working_dir, output,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 343, in core
    check_return_code(args, code, log_message)
  File "/nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/tools/helpers/run_core.py", line 219, in check_return_code
    raise RuntimeError("Command failed: " + log_message)
RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start

(022004) [21:32:12] RuntimeError: Command failed: % /nix/store/f7cw7adljs96kghr0gyqpcxqrhblp13p-waydroid-1.5.4/lib/waydroid/data/scripts/waydroid-net.sh start
(022556) [21:35:39] % tail -n 60 -F /var/lib/waydroid/waydroid.log
(022556) [21:35:39] *** output passed to waydroid stdout, not to this log ***

And for the option LXC_USE_NFT="false" that was discussed in the github issue can you please tell me how to set it to false ?

1 Like

Unfortunately setting networking.nftables.enable = false didn’t seem to solve it .

Uh, if you’re not using nftables it must be another issue. I’m not sure, maybe it has to do with your kernel. Have you tried with the mainline one?

Also, can you run the following?

nixos-option networking.nftables.enable
nixos-option boot.kernelPackages.kernel.version

Actually, I think this issue is unrelated. I’ve used nftables only and I can definitely start waydroid. The reported issue is something to do with docker.

Well, there’s actually another issue about nftables without any Docker mentions:

The reporter is also using NixOS and zen, so maybe it really is about zen not being built with the legacy iptables module.

Okay I have a better idea now. Based on After disabling NFT, ip_tables module is being demanded · Issue #178 · waydroid/waydroid · GitHub, nftables support was disabled by default in upstream, because some distros didn’t package waydroid properly. Re-enabling it resolves the issue:

1 Like