Install Waydroid to Run Android OS & Apps in Ubuntu 22.04, 24.04

Last updated: April 30, 2024 — 9 Comments

 

This is beginner’s guide shows how to install and setup Waydroid to run full Android system as well as Android applications in Ubuntu.

I’ve written about this by using Anbox, which is however no longer in active development.

This is a re-write with free and open-source ‘Waydroid’, which is a container-based approach to run a minimal customized Android system image based on LineageOS.

Android OS in my Ubuntu 22.04 desktop

This tutorial is tested and works on Ubuntu 22.04 and Ubuntu 24.04 LTS with default Wayland session (Xorg is NOT supported)! Hardware specs include:

  • CPU: Intel i5-10400.
  • GPU: Intel HD 630.

Step 1: Install Waydroid

Waydroid is easy to install in Ubuntu/Debian based systems, through its official apt repository.

1. First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to install required packages:

sudo apt install curl ca-certificates

sudo command needs password authentication, but with no asterisk feedback. Just type in mind and hit Enter.

2. Then, run command to download the official script, and run it to add Waydroid repository into your system.

curl https://repo.waydro.id | sudo bash

In case the script does not work properly, find out your OS code manually via either lsb_release -sc or cat /etc/os-release command. Then, run command below instead:

curl https://repo.waydro.id | sudo bash -s jammy

Replace jammy depends on your system code-name. So far, it supports focal, jammy, noble, bookworm, bullseye, sid

3. Finally, run command to install Waydroid:

sudo apt install waydroid

Try sudo apt update first to refresh cache if the command output package not found

Once successfully installed the app, you should be able to launch it from start menu, applications menu, or any other app launcher depends on your desktop environment.

Step 2: Initialize

The first launch of the app, will launch the “Initialize Waydroid” dialog.

The default options are usually OK. But, you may have to choose Android type before getting start:

  • VANILLA – as name indicates, it’s vanilla ROM, without Google Services/Apps.
  • GAPPS – come with Google Services/Gapps.

Next, click Download button will automatically download & install ROM and required packages. In my case, it downloaded & installed Android 11.

When done successfully, it will show you something like the screenshot shows you.

Step 3: Start Android system, resize & move window

After clicking “Done” button in last step, start Waydroid again will launch an Android screen on your desktop.

However, it by default starts in full-screen (or may-be called maximized) mode.

To change the Android screen size, open terminal (Ctrl+Alt+T) in the Ubuntu host, and run commands:

waydroid prop set persist.waydroid.width 506
waydroid prop set persist.waydroid.height 1000

The 2 commands will set the screen width and height to 506 x 1000. Change the numbers accordingly, and apply by running command to stop current Android session (then re-launch).

waydroid session stop

The Android window is borderless in my case. To move the window, you may either press & hold Super (Windows logo) key then dragging, or press Alt+F7 and then move mouse cursor without mouse clicking.

Step 4: Install & Remove Android Apps

If you selected ‘VANILLA’ while initializing Waydroid, then there’s no app store in the Android to install applications.

In the case, you may download any APK file from the web, or download & install the free open-source F-Droid in the host (Ubuntu in the case) then use it in Android screen to install apps.

To install APK file from host user’s ‘Downloads’ folder, just run command in terminal (Ctrl+Alt+T):

waydroid app install ~/Downloads/file_name_here.apk

And, verify by listing all installed Android apps:

waydroid app list

Waydroid will create app shortcuts for all installed Android apps, through .desktop files under “.local/share/applications”. Meaning, you can search & launch Android apps directly from host machine (Ubuntu).

Launch ‘F-Droid’ Android app in Ubuntu

And, it supports launching multiple instance of Android apps at the same time out-of-the-box.

To remove an app, either do it in the Android screen, or run command in Ubuntu host:

waydroid app remove packageName

Replace packageName according to waydroid app list output, e.g., org.fdroid.fdroid.

Step 5: Share files between Ubuntu Host and Android

To share files between host and the Android system, simply run single command in Ubuntu host:

sudo mount --bind ~/Documents/vboxshare/ ~/.local/share/waydroid/data/media/0/Documents/share

In the command, you need to replace:

  • ~/Documents/vboxshare/ – ‘vboxshare’ sub-folder in Ubuntu host.
  • ~/.local/share/waydroid/data/media/0/Documents/share – ‘share’ sub-folder of Documents in Android.

You need to first create the share folder if not exist, or it will show mount point does not exist as the screenshot below shows you.

Uninstall Waydroid:

First, stop the session and container, which maybe useful for reloading settings, run commands:

waydroid session stop
sudo waydroid container stop

To remove Waydroid, use command:

sudo apt remove --autoremove waydroid

Then, remove leftovers by running command:

sudo rm -rf /var/lib/waydroid ~/waydroid ~/.share/waydroid ~/.local/share/applications/*aydroid* ~/.local/share/waydroid

If you don’t want to install it back any more, then, also remove the source repository by deleting the sources & key files:

sudo rm /etc/apt/sources.list.d/waydroid.list /usr/share/keyrings/waydroid.gpg

For more about Waydroid, see the official document.

Twitter

I'm a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to let me know if the tutorial is outdated! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: Buymeacoffee | https://ko-fi.com/ubuntuhandbook1 |

9 responses to Install Waydroid to Run Android OS & Apps in Ubuntu 22.04, 24.04

  1. How do you prevent the Android applications appearing in the applications search results?

    Once waydroid is installed there will be 2 calc apps and 2 calender apps etc shoing in the search results. One will be the native Ubuntu app and the other will launch Waydroid and show the Android version of the app.

    It is not obvious which is which, unless you get used to the icons and remember which is which.

    Can this be set to not show the Android apps in the results and just show the native Linux apps?

    • Sadly, Waydroid seems NOT have an option to do the job at the moment of writing.

      As a workaround, you may run the single command below, to add “NoDisplay=true” to all the existing android apps’ shortcut files to hide them.

      for file in $HOME/.local/share/applications/waydroid.*.desktop; do desktop-file-edit --set-key=NoDisplay --set-value=true $file; done

      Skip the terminal error outputs! The .desktop files may NOT pass desktop-file-validate while creation, though they just work!

      To un-hide them, remove the “NoDisplay” key from the shortcut files via command:

      for file in $HOME/.local/share/applications/waydroid.*.desktop; do desktop-file-edit --remove-key=NoDisplay $file; done
      • Brilliant. Thank you for that. It worked great, though for now I am selectively hiding just the ones that clash with Linux native apps using this method, so I can have the best of both worlds.

  2. I followed all the instructions and when I start waydroid for the first time it update itself but when I go to use it, the icon shows up in my taskbar and after a few seconds disappear with no waydroid screen showing.

    • Try starting it from a terminal window by running waydroid app intent android.intent.action.VIEW %u. So, you can see what’s going wrong, and ask help or report issues via the terminal output.

  3. Hi, don’t know why, but I tried the suggested method to share folders between Kubuntu 22.04.03 and latest release of Waydroid without success.
    I used the simplest bind command, also on the waydroid wiki,
    sudo mount –bind ~/Downloads ~/.local/share/waydroid/data/media/0/Download
    and if I use
    sudo ls ~/.local/share/waydroid/data/media/0/
    I see the content of my ~/Downloads folder, nothing from the Waydroid one.
    I tried also to create subfolders and then bind them (like You did in Your examples): no way.
    Also changing the writing rights in the linux folders, just once (why???) made me see a file added from the android side, but no rights were set to read the file (a txt one) and I couldn’t change the access rights nor ownership.
    Any suggestion?
    Thx

  4. Can I somehow run Waydroid using X11? It’s a bit awkward having to log out just to use one program while most other programs require X11. If not, is there a good emulator that is in active development that works in Ubuntu/X11?

    • Andrew Przelucki April 29, 2024 at 8:01 pm

      Install Weston. Then, first run Weston which will show a window, then run waydroid session and waydroid show-full-ui. Weston has it’s own ini file ~/.config/weston.ini. There you can set it up – i.e., how it displays Waydroid. For example, I have renderer=gl. I don’t set the backend=x11-backend.so, because it does that automatically for me – I’m on Kubuntu with X11. I suggest setting shell=kiosk-shell.so so that Waydroid is the only thing occupying the Weston window (by default you get a terminal window and dock). In the [output] section I set name=X1 for X11 output (you can have LVDS1 (DRM backend, Laptop internal panel), VGA1 (DRM backend, VGA connector), X1 (X11 backend, X window) or WL1 (Wayland backend, Wayland window)) and I set mode=my_display_resolution to have have Weston display the Waydroid session full-screen (Alt-Tab switches the host windows). You will need to tell Waydroid to change its display resolution as well BUT set the dimensions by two pixels less than Weston is displaying (which can be your host display (monitor) resolution), because if you set Waydroid with the same resolution, it will crash (from my experience). There is a [autolaunch] section where you can point to a script to run Waydroid, but I changed my approach and run everything from a script myself via a desktop button. So my script first runs “weston &”, then I set the Waydroid network interface to trusted with “sudo firewall-cmd –zone=trusted –add-interface=waydroid0” and then, normally it runs “waydroid session start &” and “waydroid show-full-ui”. Recently an update did something so that couldn’t run a session that way, and the solution (hopefully temporary) is to run “WAYLAND_DISPLAY=/run/user/1000/wayland-1 waydroid first-launch &”.

  5. the download step always stops at 99%
    tried it more than once, at different times

Leave a Reply

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> 

*