- Introduction
- System Requirements
- Installation
- Usage
- Additional Configuration
- Automation
- Uninstallation
- Troubleshooting
- References
This guide details the process of installing and using Waydroid on an X11-based Linux system. Waydroid allows you to run a complete Android system in a container, seamlessly integrated into your desktop environment. This guide covers the setup, basic usage, and customization options to enhance your Waydroid experience.
Before proceeding with the installation, ensure that your system meets the following requirements:
- Running an X11 environment.
- Administrative privileges (sudo access).
- curl and ca-certificates packages installed.
Install these dependencies by executing the command:
sudo apt install curl ca-certificates -y
Weston is the Wayland compositor required for rendering the Waydroid environment. To install it, run:
sudo apt install weston -y
Follow the steps below to install Waydroid.
Add the official Waydroid repository by running the following command:
curl https://repo.waydro.id | sudo bash
Once the repository is added, install Waydroid using:
sudo apt install waydroid -y
Initialization must be performed within a Weston session. Follow these steps to initialize Waydroid:
-
Start Weston:
Open a terminal and run:
weston --socket=mysocket
This will start a Weston session on the specified socket.
-
Initialize Waydroid:
In the Weston terminal, you can initialize Waydroid using one of the following commands:
-
Vanilla Android (No Google Apps):
sudo waydroid init
-
Android with Google Apps (GAPPS):
sudo waydroid init -f -s GAPPS
-
Once initialized, Waydroid is ready for use.
If you encounter an error related to missing binder modules, such as:
[21:15:53] Failed to load binder driver
[21:15:53] ERROR: Binder node "binder" for waydroid not found
Refer to this guide for instructions on resolving the issue.
Once initialized, launch Waydroid within the Weston session:
-
Start Weston:
weston --socket=mysocket
-
Launch Waydroid Interface:
In the Weston terminal, run:
waydroid show-full-ui
This will launch the full Android system in the Wayland environment.
To stop Waydroid, use the following command:
waydroid session stop
This will gracefully terminate the session.
Waydroid apps may appear in your system's application launcher by default. To hide these entries, run the following script:
for a in ~/.local/share/applications/waydroid.*.desktop; do
grep -q NoDisplay $a || sed '/^Icon=/a NoDisplay=true' -i $a
done
This will add a NoDisplay=true
entry to all Waydroid .desktop
files, hiding them from the launcher.
To enable clipboard sharing between Weston and the X11 environment:
-
Install pyclip:
sudo pip install pyclip
-
Install wl-clipboard:
sudo apt install wl-clipboard
This allows for seamless copy-paste functionality between Waydroid and your Linux environment.
To automate Waydroid startup and shutdown, follow the steps below.
Create a ~/.config/weston.ini
file with the following configuration to improve input handling and hide the panel:
[libinput]
enable-tap=true
[shell]
panel-position=none
Save the following script as /usr/bin/waydroid-session.sh
:
#!/bin/bash
# Start Weston
weston --xwayland &
WESTON_PID=$!
export WAYLAND_DISPLAY=wayland-1
sleep 2
# Launch Waydroid
waydroid show-full-ui &
WAYDROID_PID=$!
# Stop Waydroid when Weston exits
trap "waydroid session stop; kill $WESTON_PID; kill $WAYDROID_PID" EXIT
wait $WESTON_PID
Make the script executable:
chmod +x /usr/bin/waydroid-session.sh
Create a desktop entry to launch Waydroid easily. Save the following file as /usr/share/applications/waydroid-session.desktop
:
[Desktop Entry]
Version=1.0
Type=Application
Name=Waydroid Session
Comment=Start Waydroid in a Weston session
Exec=/bin/bash -c "cd /usr/bin && ./waydroid-session.sh"
Icon=waydroid
Terminal=false
Categories=System;Emulator;
Make it executable:
chmod +x /usr/share/applications/waydroid-session.desktop
If you want to completely remove Waydroid and any associated packages from your Ubuntu-based system, you can use the clean-removal.sh
script. Follow the instructions below:
-
Ensure the script
clean-removal.sh
is executable:chmod +x clean-removal.sh
-
Run the script with root permissions:
sudo ./clean-removal.sh
What This Script Does:
- Stops and disables the Waydroid container service.
- Removes Waydroid, Weston, and related packages.
- Cleans up any configuration files and residual files.
This ensures that your system is returned to its state before the installation of Waydroid.
- Weston fails to start: Ensure Weston is correctly installed and that your X11 environment is properly configured.
- Waydroid doesn’t launch: Verify the Weston session is active and Waydroid is installed correctly.
- Performance issues: Consider adjusting your system’s resource allocation for better performance.
For more information, refer to the official Waydroid documentation.
This guide covers both the installation and configuration of Waydroid, including clipboard integration and automated startup for a smoother experience.