Installing Waydroid on Ubuntu: Run Android as Smoothly as a Native App with Containers

Virtualization tutorial - IT technology blog
Virtualization tutorial - IT technology blog

The Problem: When the Android VM Eats All Your RAM at 2 AM

Last night, I was debugging an automation bot running in an Android environment. Out of habit, I fired up Android Studio and launched an AVD (Android Virtual Device). The result? My 16GB RAM laptop started sounding like a tractor. Swap space was spiking constantly, and the latency made me furious.

Emulators like Bluestacks or AVD usually rely on Full Virtualization. They force the CPU to carry a heavy operating system on top of Ubuntu. To work efficiently, I needed a lighter solution that leverages existing system resources directly.

Why Are Traditional Emulators So Slow?

When running an Android VM, Ubuntu must allocate hardware resources to a completely separate Guest OS. These two operating systems have independent Kernels, communicating through a very slow middle layer.

I manage a homelab with Proxmox VE featuring 12 VMs and containers. Experience from that chaos shows: If you want maximum performance, use Containers. Waydroid was created to solve this problem. It runs Android directly inside an LXC container and shares the Linux Kernel. This brings performance to near-native levels.

Comparing Android Solutions on Linux

  • Anbox: Once very popular but now discontinued. Complex installation and frequent kernel module errors.
  • Genymotion: Stable performance but requires a paid license and still relies on VM architecture.
  • Waydroid: The top choice today. Supports Wayland, extremely fast, and completely free.

How to Install Waydroid Properly to Avoid Common Issues

Important note: Waydroid works best on a Wayland environment. If you’re using X11 (common on older Ubuntu versions), you should install weston to support launching, though the experience will be slightly less smooth.

Step 1: Update the System

Never skip this step. Syncing dependencies helps you avoid annoying library conflicts later.

sudo apt update && sudo apt upgrade -y
sudo apt install curl ca-certificates -y

Step 2: Add the Official Repository

Waydroid isn’t available in the default store. You need to add the developer’s repo using the following command:

export DISTRO=$(lsb_release -sc)
curl https://repo.waydroid.net | sudo bash
sudo apt install waydroid -y

Step 3: Initialize the Android Image

After installation, you need to download the Android image. There are two main options:

  • VANILLA: Pure Android, no Google Play Services (ultra-lightweight).
  • GAPPS: Includes Google Play to download apps (suitable for general use).

I recommend the GAPPS version for easy app installation:

sudo waydroid init -s GAPPS

This process downloads about 700MB of data. You might want to grab a cup of coffee while you wait.

Step 4: Enable the Service

Waydroid operates as a background container service. You need to start it before opening the UI:

sudo systemctl start waydroid-container
waydroid show-full-ui

Troubleshooting “Signature” Waydroid Issues

Real-world installations often encounter minor issues. Here’s how I handle them on my personal system.

1. Fixing Internet Connection Issues

If Android can’t access the network, Ubuntu’s firewall is likely blocking the bridge network. Open the path for waydroid0 with these commands:

sudo ufw allow in on waydroid0
sudo ufw allow out on waydroid0
sudo ufw route allow in on waydroid0
sudo ufw route allow out on waydroid0

2. Running ARM Apps on x86 Computers (libhoudini)

Most Android apps are built for ARM chips, while PCs use x86_64. To run TikTok or Shopee, you need a translation layer. I usually use a community script for a quick fix:

git clone https://github.com/casualsnek/waydroid_script
cd waydroid_script
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
sudo python3 main.py install libhoudini

Once this script is installed, “Incompatible architecture” errors will disappear completely.

3. Registering the Device with Google (Device is not certified)

Because it’s running in a container, Google will flag the device as uncertified. You need to get the Android ID for manual registration:

sudo waydroid shell
settings get secure android_id

Copy the returned string, visit Google Device Registration and paste it in.

Conclusion

Waydroid is truly a giant leap for Linux users. Instead of consuming 4-6GB of RAM for an Android Studio VM, Waydroid only uses about 1-2% of CPU while idling. App launch speeds are 3-4 times faster than traditional emulators.

If you need to test apps quickly or want to use Zalo or TikTok directly on your Ubuntu desktop, Waydroid is the most optimal choice available today.

Share: