How to Install WSA with Magisk Root
In this guide, we will walk you through the steps to install Windows Subsystem for Android (WSA) with Magisk root and Google Apps (GApps) on your Windows 11 system. Want to turbocharge your Android setup? With this installation, you’re in control - get ready to max out your device’s potential with effortless Magisk management and revolutionary modules that’ll take your Android experience to the next level.
Whether you are a developer seeking root access to Android on Windows or a power user looking to customize your Android apps environment on Windows Subsystem for Android (WSA), this detailed step-by-step guide will cover everything you need to know.
What You’ll Need Before You Start
To install Magisk on WSA, you will need to prepare a few things:
A Windows 11 machine with virtualization enabled.
Linux or WSL2 environment for building WSA with Magisk.
Python installed (Python 3.7.2 or higher).
A GitHub repository for downloading the MagiskOnWSA script.
The necessary dependencies for Linux distributions (Ubuntu, Debian, openSUSE Tumbleweed, Arch Linux).
Let’s start by setting up everything to get Magisk running smoothly on your Windows Subsystem for Android.
Step 1: Prepare Your System
Enable Virtualization
Ensure virtualization is enabled on your machine. You can check it by going to the Task Manager, selecting the Performance tab, and looking for Virtualization. If it’s not enabled, you’ll need to activate it in your system’s BIOS settings.
Install WSL2
To build WSA with Magisk on your system, you must install Windows Subsystem for Linux (WSL2), which will allow you to run Linux distributions on Windows. Follow these steps to install WSL2:
Open PowerShell as Administrator.
Run the following command to install WSL and set it to version 2:
wsl --install
- After installation, reboot your machine and select a Linux distribution to install, such as Ubuntu or Debian.
Once WSL2 is installed, you’re ready to proceed to the next step.
Step 2: Install Required Dependencies
Depending on your Linux distribution (e.g., Debian, openSUSE, Arch Linux), you will need to install the necessary dependencies. Here’s a list of the required packages for popular distributions:
For Ubuntu/Debian
sudo apt update
sudo apt install python3 aria2 unzip sudo python3-venv python3-pip p7zip-full whiptail
For openSUSE Tumbleweed
sudo zypper install python3 aria2 unzip sudo python3-venv python3-pip p7zip dialog python3-venvctrl
For Arch Linux
sudo pacman -S python aria2 unzip sudo python-pip p7zip libnewt
These dependencies are essential for running the MagiskOnWSA build script. Once they are installed, proceed to the next step.
Step 3: Clone the MagiskOnWSA Repository
Now that your environment is ready, clone the MagiskOnWSA repository from GitHub. This will give you the script required to build WSA with Magisk and GApps.
Run the following command in your Linux terminal or WSL2 environment:
git clone https://github.com/LSPosed/MagiskOnWSALocal.git --depth 1
cd MagiskOnWSALocal
This repository contains the necessary files and scripts to integrate Magisk and Google Apps (GApps) into your WSA installation.
Step 4: Run the Build Script
Inside the MagiskOnWSA folder, you will find the run.sh script that automates the entire process. To build WSA with Magisk, simply run the following command:
./scripts/run.sh
Script Options
The script will present several options to customize your installation:
WSA version and architecture: Select the appropriate WSA version and architecture (x64 for most modern systems).
Magisk version: Choose the version of Magisk you wish to integrate.
GApps brand: Select MindTheGapps, as it’s the only compatible variant for WSA at this moment.
Root Solution: You can either choose to install Magisk for root access or opt for no root.
If this is your first time running the script, it may take some time to complete. After the process finishes, the script will generate two new folders: output and download.
Step 5: Install WSA with Magisk and GApps
Once the run.sh script has finished building the WSA package, navigate to the output folder and locate the WSA-with-magisk-stable-MindTheGapps_x64_Release-Nightly folder or a similarly named compressed file.
For Compressed Files:
If the file is compressed (e.g., .zip
or .7z
), extract the contents.
Run the Installation Script
Within the folder, locate and run the Run.bat file. This will initiate the installation of WSA with Magisk and GApps.
Uninstall Previous Versions
If you have a previous MagiskOnWSA installation, the new installation will automatically uninstall the old version while preserving all your user data.
If you have the official WSA installation from Microsoft, it’s recommended to uninstall it before proceeding.
In some cases, you may need to manually run the installation script (Install.ps1) with administrator privileges:
Open Windows Terminal as Administrator.
Navigate to the folder where you extracted the WSA package:
cd "X:\path\to\your\extracted\folder"
- Run the installation script:
PowerShell.exe -ExecutionPolicy Bypass -File .\Install.ps1
After the script completes, WSA with Magisk and GApps will be installed and ready to use.
Step 6: Post-Installation Setup
Launch Magisk and Play Store
Once the installation is complete, Magisk and the Google Play Store will automatically launch. You can now install and manage Magisk modules, root apps, and any other Android apps from the Google Play Store.
If you wish to install additional Magisk modules, you can use the Magisk Manager app to load modules or push them via ADB.
FAQ and Troubleshooting
How do I update WSA with Magisk?
To update WSA or Magisk:
- Update the build scripts by running:
git pull
Rebuild the package by running the
./scripts/run.sh
script again.Replace the contents of your previous installation and rerun Install.ps1.
Your data will be preserved during the update process.
How do I retrieve logcat from WSA?
To access logcat logs for troubleshooting:
%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalState\diagnostics\logcat
How can I remount the system as read-write?
Unfortunately, remounting the system as read-write is not possible in WSA, as it is mounted as read-only by Hyper-V. However, you can still modify the system by creating a Magisk module or directly editing the system.img.
I cannot connect to WSA via ADB.
Ensure developer mode is enabled in the WSA settings. If ADB still fails to connect, check the IP address of WSA in the settings and attempt to connect via:
adb connect ip:5555
Conclusion
By following this guide, you will be able to install WSA with Magisk root and Google Apps (GApps) on your Windows 11 machine. This powerful combination allows for a fully customizable Android environment on Windows, providing access to root features and Magisk modules.
Developers and power users, rejoice! You can now throw Android apps into a radical, unrestricted sandbox, straight from your Windows desktop.