Skip to main content

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:
C:\Users\YourName\AppData\Local\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx
This .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

1

Turn off WSA

  1. Open Windows Subsystem For Android Settings
  2. Click “Turn off”
  3. Wait for WSA to completely shut down
WSA must be completely off before backing up. The file is locked while WSA is running.
2

Navigate to the userdata location

Press Win+R and paste this path:
%LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache
Press Enter to open the folder.
3

Copy userdata.vhdx

Copy the userdata.vhdx file to a safe backup location:
  • External hard drive
  • Cloud storage (OneDrive, Google Drive)
  • Separate partition or drive
The file size can be several GB depending on your installed apps and data.

Restoring Your Backup

Restoring requires modifying the installation script to prevent auto-launch of Android apps during the restore process.
Before restoring:
  1. Remove WSA if currently installed (see Uninstall guide)
  2. Make sure you have your backup userdata.vhdx file ready
  3. Have your WSA installation folder accessible
1

Modify Install.ps1

Open 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:
Start-Process "wsa://com.android.settings"
Start-Process "wsa://com.topjohnwu.magisk"
Start-Process "wsa://io.github.huskydg.magisk"
Start-Process "wsa://io.github.vvb2060.magisk"
Start-Process "wsa://com.android.vending"
Start-Process "wsa://com.amazon.venezia"
Look for these lines in the Finish function near the beginning of Install.ps1 (around lines 54-58). You may have multiple lines to remove depending on your build.
Save the file after removing the appropriate lines.
2

Run the modified installer

  1. Navigate to your WSA folder
  2. Run Run.bat
  3. Wait for the installation to complete
When the PowerShell window displays “Press any key to quit”, multiple dialogue boxes will open.
3

Restore userdata.vhdx (CRITICAL TIMING)

DO NOT click anything or close the dialogue boxes yet!
While the dialogue boxes are open:
  1. Press Win+R and navigate to:
    %LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\
    
  2. If the MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache folders don’t exist, create them manually
  3. Copy your backed-up userdata.vhdx file into the LocalCache folder
  4. Replace the existing file if prompted
4

Complete the installation

  1. Close the dialogue boxes that appeared earlier
  2. Launch Windows Subsystem For Android Settings
  3. Your apps and data should be restored

Why Remove Start-Process Lines?

The Start-Process commands in Install.ps1 automatically launch Android apps (Magisk, Play Store, etc.) after installation:
Start-Process "wsa://com.topjohnwu.magisk"
Start-Process "wsa://com.android.vending"
These commands trigger WSA to start immediately, which locks the userdata.vhdx file before you can replace it. By removing these lines, WSA doesn’t auto-start, giving you time to copy your backup file.

Alternative: Backup Before Uninstall

When switching between official WSA and MagiskOnWSA (or vice versa):
1

Backup first

Before uninstalling, copy userdata.vhdx to a safe location
2

Uninstall current WSA

Follow the uninstall guide
3

Install new WSA build

Follow the restore steps above to restore your data during installation

What Gets Backed Up

The userdata.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

The following are NOT in userdata.vhdx:
  • WSA system files
  • WSA Settings app configuration
  • Windows-side WSA settings
  • The Android kernel
  • Magisk/GApps binaries (these are reinstalled)

Backup Best Practices

Regular backups:
  • Before major WSA updates
  • Before installing potentially problematic apps
  • After setting up important apps
  • Monthly for peace of mind
Storage recommendations:
  • Keep at least 2 backup copies
  • Store one backup on external media
  • Label backups with the date
  • Test restore process occasionally

Troubleshooting

”File is in use” when copying userdata.vhdx

WSA is still running. Follow these steps:
  1. Open WSA Settings → Turn off
  2. Wait 30 seconds
  3. Open Task Manager (Ctrl+Shift+Esc)
  4. End these processes:
    • WsaClient.exe
    • vmmem
    • vmmemWSA
  5. Try copying again
If still locked, restart your PC and copy before launching WSA.

Restored data doesn’t appear

  1. Verify userdata.vhdx is in the correct location:
    %LOCALAPPDATA%\Packages\MicrosoftCorporationII.WindowsSubsystemForAndroid_8wekyb3d8bbwe\LocalCache\userdata.vhdx
    
  2. Check file size - should be at least 100MB
  3. Ensure WSA has been launched at least once after restore
  4. Try restarting WSA from Settings

Apps crash after restore

This can happen when restoring to a significantly different Android version:
  1. Try clearing app cache in Android Settings
  2. Uninstall and reinstall problematic apps
  3. Some apps may need to be set up again

Backup file is very large

The userdata.vhdx file grows as you use WSA:
  • Fresh install: ~100MB - 500MB
  • With apps: 2GB - 10GB+
  • Heavy use: 20GB+
To reduce size, uninstall unused apps and clear cache before backing up:Android Settings → Apps → Select app → Storage → Clear cache

Next Steps

Uninstall WSA

Remove WSA safely with or without preserving data

Update WSA

Update to newer builds (preserves data automatically)

Build docs developers (and LLMs) love