Skip to content

Instantly share code, notes, and snippets.

@onomatopellan
Last active June 3, 2025 10:09
Show Gist options
  • Save onomatopellan/c5220c0efddaff69aaff77cca80b7b8e to your computer and use it in GitHub Desktop.
Save onomatopellan/c5220c0efddaff69aaff77cca80b7b8e to your computer and use it in GitHub Desktop.
Waydroid in WSL2 with sound (Weston on top of Weston approach)
Recommended to install Waydroid in a brand new Ubuntu 25.04 install
Waydroid needs a custom linux kernel. It just needs latest kernel for WSL2
https://github.com/microsoft/WSL2-Linux-Kernel/blob/linux-msft-wsl-6.6.y/arch/x86/configs/config-wsl
With just these changes before compiling:
CONFIG_ANDROID_BINDER_IPC=y
CONFIG_ANDROID_BINDER_DEVICES="binder,hwbinder,vndbinder"
Make sure WSL2 uses the custom kernel modifying .wslconfig
Install Ubuntu 25.04 from https://releases.ubuntu.com/plucky/ubuntu-25.04-wsl-amd64.wsl
Double click on the .wsl file to install
Run Ubuntu 25.04 and make sure is updated
sudo apt update && sudo apt upgrade -y
Install weston
sudo apt install weston
Install waydroid
curl -s https://repo.waydro.id | sudo bash
sudo apt install waydroid
Configure Waydroid to only use software rendering
sudo nano /var/lib/waydroid/waydroid_base.prop
ro.hardware.gralloc=default
ro.hardware.egl=swiftshader
Make weston detect gpu for some acceleration
export GALLIUM_DRIVER=d3d12
Run weston
weston --backend=wayland-backend.so
Inside weston desktop shell open a terminal and run
waydroid session start
When it shows 'Android with user 0 is ready' then open another terminal inside the weston desktop and run
waydroid show-full-ui
tips:
If Waydroid shows some weird dbus errors make sure you shutdown the WSL2 VM (wsl.exe --shutdown) and try again.
For some reason Waydroid only launches if the WSL2 networking mode is not MIRRORED.
Every time the WSL2 kernel changes significantly (from ASHMEM support in 5.15.x to none in 6.6.x) you need to reinstall Waydroid or it wont boot.
sudo apt reinstall waydroid
@onomatopellan
Copy link
Author

You are welcome. And yes, right now Waydroid only works with software rendering. I'm looking at the Lineage image Waydroid uses and their mesa actually is compiled with d3d12 support. That means Waydroid should have gpu acceleration in WSL2 through mesa but it doesn't work. I guess the problem is Waydroid is inside a container so it can't access /lib/wsl/lib and lib/wsl/drivers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment