I recently spent 2 days (don’t judge me) getting a running instance of Android on my Linux Mint desktop. Here is a guide for you to cut this time requirement dramatically.
Please follow me on Medium and click the ‘clap’ button if this helps you or if you’d like to see more articles like this in the future.
Look to the end of this article for troubleshooting tips and tricks.
Don’t use Anbox
There is an older Android emulator out there called Anbox and you don’t want to use it. It isn’t actively being maintained on GitHub and it is slow and doesn’t work well. This is the first thing you’ll find when you look for ways to run Android on Linux but don’t do it.
Use WayDroid
WayDroid is newer and it’s containerized which allows it to run very fast and smoothly. There is some setup involved so let’s get to it.
Installation
Install Instructions Waydroid Docsdocs.waydro.id
You can visit the page above to follow along with the official documentation if you wish. I will share similar info below with tips I found through trial and error.
Open a new terminal window and follow the instructions below.
Install curl certificates
sudo apt install curl ca-certificates -y
This will make sure you have a recent version of curl certificates for safe connections to servers.
Set a persistent variable with the name of our Distro version
export DISTRO="focal"
The version of Linux Mint that I’m running is known as ‘focal’ so here we are using ‘export’ to create a persistent variable that holds our distro name. We will use this in a second.
Send a curl request
sudo curl --proto '=https' --tlsv1.2 -Sf https://repo.waydro.id/waydroid.gpg --output /usr/share/keyrings/waydroid.gpg
Here we are reaching out to download a file on the internet and place it in our specified location in our local file system.
Add the new repository to our list of sources
echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" | sudo tee /etc/apt/sources.list.d/waydroid.list
We then use that file to update our list of source repositories where our system will look when attempting to install software.
Refresh
sudo apt update
Update to refresh our system and make the changes we just made available to be used.
Install WayDroid
Now that our system knows where to look we can install our software.
sudo apt install waydroid -y
Once this process completes you will have WayDroid installed on your system, but you will not be able to use it yet. There is more setup we need to do to get this to work.
Install Weston
Linux Mint by default uses Xorg to render all of the windows that you see, but WayDroid requires Wayland (Way-Droid. Way-land. Get it?) so you need to have a way to run Wayland windows. This is where Weston comes in.
sudo apt install weston
Once the above installation is complete you can start Weston by typing ‘weston’ in the terminal OR you can logout of your current session and on the login screen you can select Weston from the rendering options before you log in.
A new, blank Weston windowI generally just open a terminal and type ‘weston’ which will pop open a new window. If you don’t maximize your window before you start WayDroid the screen area of WayDroid will be limited to the current size of the Weston window, even if you maximize it later. So be sure to maximize your Weston window before starting Waydroid.
Start WayDroid
The first time you start WayDroid you will be prompted to choose which type of Android image you would like to download and install. You can choose a plain ‘Vanilla’ version of Android, or a GAPPS (Google Apps) version which will include the Google Play Store and Google Services.
If you choose the GAPPS version you will likely be met with some notifications upon starting WayDroid that tell you your device needs to be registered with Play Protect services before you can use your Google accounts. Setup for that will be discussed below.
Launch Menu
Now, with your Weston window open, you can start WayDroid by selecting it from your launch menu on your desktop. This should launch WayDroid inside of your Weston window.
Launch WayDroid from the Launch menuCommand Line
You can also launch WayDroid from the command line.
WayDroid requires a container and a session.
sudo waydroid container start
waydroid session start
Once the container and the session are running you can send the following command to start WayDroid.
waydroid show-full-ui
See the end of this article for troubleshooting tips if this doesn’t work.
You Need ARM Support
Now you have WayDroid up and running hopefully, but you still won’t be able to install many of the Apps that you want to use because many Android apps are designed to be run on an ARM architecture, so we’ll need to add support for that.
Thankfully there is a project in this GitHub repo here that someone created to add ARM support to our WayDroid installation.
https://github.com/casualsnek/waydroid_script
You can view the instructions there or follow along here to install everything you’ll need. We’ll need libhoudini to run many of our Android Apps.
Open a new tab in your terminal window to run the following commands.
Install lzip and sqlite
sudo apt install lzip sqlite
lzip and sqlite are required for this to work so we’ll install them first.
Clone the repository
git clone --depth=1 https://github.com/casualsnek/waydroid_script
This will clone the git repository onto our local machine.
Move into the directory you just cloned
cd waydroid_script
You’ll want to use ‘cd’ to change the active directory to the one we just cloned from the git repository.
Install Waydroid Extras required libraries
sudo python3 -m pip install -r requirements.txt
Now we can install all of the libraries and modules that are necessary for this script to run by simply telling pip to read this requirements.txt file and install everything described within.
Get your Google Services Framework Android ID
sudo python3 waydroid_extras.py -i
The above command should give you an ID number that Google needs to register your device for the Play Protect service that was mentioned earlier. To do this you can click on the warnings that are being given inside WayDroid and click ‘Learn More’. Follow the prompts to get to the ID submission page. Here is a direct link:
https://www.google.com/android/uncertified/
You’ll need internet access for that to work so make sure you have that working before you try.
Install arm support
sudo python3 waydroid_extras.py -l
This should automagically install ARM support. One last thing.
Restart WayDroid
sudo systemctl start waydroid-container.service
The above command will restart the WayDroid container which is necessary for the changes we made to take effect.
Now you should be able to install and run all of the Android apps you want right from your Linux Mint desktop.
Troubleshooting
Restarting WayDroid
To restart WayDroid I close out of all open windows and terminals do the following in a new terminal.
sudo systemctl start waydroid-container.service
This should restart WayDroid. Then start Weston, and in a new terminal do the following:
waydroid show-full-ui
“I get a perpetual loading screen”
Restart WayDroid using the instructions above.
If that doesn’t work then rebooting your computer will.
“I don’t have internet inside WayDroid”
This happens to me and seems to be related to my VPN. If I disconnect my VPN before I start WayDroid it fixes the issue. Disabling my VPN isn’t the ideal solution, but I don’t know enough to know what else to try.
“Google won’t register me”
This can take some time. For me the registration didn’t work until I used the waydroid_extras library mentioned above. I don’t know if it was a coincidence but as soon as I ran the commands to install ARM support the Google registration went through. That was roughly a day after I sent the registration request. I have seen accounts online from people who said they waited up to 15 days.
For everything else I recommend checking out the docs or posting a question on the GitHub page after checking the open issues section.
Docs
Install Instructions WayDroid Docsdocs.waydro.id
GitHub
WayDroid Waydroid uses a container-based approach to boot a full Android system on a regular GNU/Linux system like Ubuntu…github.com
Other Links
They also have a Matrix group here: https://matrix.to/#/#waydroid:connolly.tech
And a Telegram group here: https://t.me/WayDroid
Hopefully you found this helpful and it saves you from spending two days getting all of this set up like I did. Like and follow to see more helpful posts on various topics in the future. Thanks for reading and have a great day :)