Understanding WSA Data Storage
All your Android apps, app data, settings, and files are stored in a single virtual hard disk file: Location:%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx
Full path example:
.vhdx file contains:
- All installed Android apps
- App data and settings
- Your Google account login session
- Downloaded files and media
- Android system settings
Backing Up Your Data
Turn off WSA
- Open Windows Subsystem For Android Settings
- Click “Turn off”
- Wait for WSA to completely shut down
Restoring Your Backup
Restoring requires modifying the installation script to prevent auto-launch of Android apps during the restore process.Modify Install.ps1
Open
Save the file after removing the appropriate lines.
Install.ps1 in your WSA folder with a text editor (Notepad, VS Code, etc.)Remove the following lines based on your WSA build type. The lines to remove vary by build:Android Settings
Android Settings
Official Magisk
Official Magisk
Magisk Delta
Magisk Delta
Magisk Alpha
Magisk Alpha
Google Play Store
Google Play Store
Amazon Appstore
Amazon Appstore
Run the modified installer
- Navigate to your WSA folder
- Run
Run.bat - Wait for the installation to complete
Restore userdata.vhdx (CRITICAL TIMING)
While the dialogue boxes are open:
-
Press
Win+Rand navigate to: -
If the
MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCachefolders don’t exist, create them manually -
Copy your backed-up
userdata.vhdxfile into theLocalCachefolder - Replace the existing file if prompted
Why Remove Start-Process Lines?
TheStart-Process commands in Install.ps1 automatically launch Android apps (Magisk, Play Store, etc.) after installation:
Alternative: Backup Before Uninstall
When switching between official WSA and MagiskOnWSA (or vice versa):Uninstall current WSA
Follow the uninstall guide
What Gets Backed Up
Theuserdata.vhdx file includes:
- All installed Android apps
- App data, settings, and cache
- App login sessions
- Downloaded files in Android storage
- Android system settings
- Magisk modules and settings (if applicable)
- Google account login state
What Does NOT Get Backed Up
Backup Best Practices
Troubleshooting
”File is in use” when copying userdata.vhdx
Restored data doesn’t appear
- Verify
userdata.vhdxis in the correct location: - Check file size - should be at least 100MB
- Ensure WSA has been launched at least once after restore
- Try restarting WSA from Settings
Apps crash after restore
This can happen when restoring to a significantly different Android version:- Try clearing app cache in Android Settings
- Uninstall and reinstall problematic apps
- Some apps may need to be set up again
Backup file is very large
Theuserdata.vhdx file grows as you use WSA:
- Fresh install: ~100MB - 500MB
- With apps: 2GB - 10GB+
- Heavy use: 20GB+
Next Steps
Uninstall WSA
Remove WSA safely with or without preserving data
Update WSA
Update to newer builds (preserves data automatically)
