Generate summary with AI

So you’ve just finished testing how your new application runs on Linux servers from your Windows PC, or perhaps you’ve just gotten your RHCSA certification. Now what do you do with the WSL distro you don’t need anymore? You could just leave it on your PC or disable it, but that’s wasted storage space that potentially opens you up to security vulnerabilities and third party conflicts. In fact, some hackers are specifically using WSL systems to run their malware and hide it from detection, according to Bleeping Computer news.

Before you freak out, uninstalling a WSL distro from your PC is pretty simple in Windows 11. Here’s everything you need to know.

» Worried something already happened? Here’s how you can check Activity History in Windows and run a PC diagnostics report

What to check before removing a WSL distro

Only users with local administrator rights can remove a WSL (Windows Subsystem for Linux) distro as you’ll need permission to run PowerShell or Command Prompt with elevated privileges, access certain Windows features, and modify appx packages.

Here’s how to verify you have admin rights:

  1. Press Windows + I
  2. Navigate to Accounts
  3. Check under your name to see if you are an administrator
Check admin status in Windows 11

Before removing a WSL distro, IT teams should identify dependencies tied to the environment to prevent workflow disruption. Key considerations include:

  • Active development projects: Verify whether codebases, build scripts, or runtime dependencies rely on the distro.
  • Data and configurations: Check for local databases, logs, environment variables, and custom configs stored inside WSL
  • Toolchains and integrations: Identify CI/CD pipelines, Docker containers, or automation scripts linked to the distro.
  • User access and workflows: Confirm if multiple developers share the same setup.

» Can’t find files you know are there? Here’s how to show hidden files in Windows 11

Back up WSL data before removal

Before removing any WSL distro, backing up your data is essential. Even if you think you’ve migrated everything, critical configurations or scripts often hide in unexpected places.

Windows provides a built-in command that creates a complete snapshot of your WSL distro. Follow these steps:

  1. Open PowerShell as an admin through the Windows Search box
  2. Paste the PowerShell command: <wsl –list –verbose> to double check what your actual distro name is
  3. The backup command is: <wsl –export Ubuntu C:\Backups\Ubuntu.tar>
  4. Make sure you choose your backup location carefully and have enough disk space since these archives can easily be 10 to 50+ GB.
Open PowerShell as admin
Check distro name in PowerShell
Export WSL data in PowerShell

This command packages your entire Linux filesystem into a single .tar archive. Every installed package, every configuration file, every script gets preserved in one portable file.

If something goes wrong during uninstallation, or if you later realize you need something from that environment, you can restore it completely with the following command: <wsl –import Ubuntu-Restored C:\WSL\Ubuntu-Restored C:\Backups\Ubuntu.tar>

Restore WSL data through PowerShell

Just be sure to edit the following parameters:

  • Replace “Ubuntu-Restored” with the name you want the restored distro to be
  • “C:\WSL\Ubuntu-Restored” determines where you want it installed to

Decide if you want to uninstall or just disable WSL distro

Deciding between uninstalling, disabling, or resetting a WSL distro depends on technical and business indicators:

  • Uninstall: Best when the distro is obsolete, no longer supported, or poses security risks (e.g., unused Ubuntu 18.04 with no patches). Also suitable when storage must be reclaimed or IT policies mandate removal.
  • Disable: Appropriate if WSL is temporarily unused but might be needed later. Disabling via Windows Features preserves data and avoids breaking dependencies, useful in regulated environments where rollback might be required.

» Still using Linux commands? This command sends messages to network interface

Methods for uninstalling WSL distros in Windows 11

Method 1: Windows Settings GUI (slow but user friendly)

For users who prefer graphical interfaces over command-line tools, such as simple Home users without technical knowledge, Windows Settings provides a familiar uninstall experience. It also removes both the app package and all its data, which means you’ll have to download it again if you want to reinstall it.

This method is best when when fully decommissioning a distro, such as a corporate cleanup, switching to a different distro entirely, or policy compliance requiring complete removal.

Follow these steps:

  1. Open Settings by pressing Win + I or clicking Start > Settings
  2. Navigate to Apps > Installed apps (or Apps > Apps & features on some Windows 11 versions)
  3. Search for your distro name (e.g., “Ubuntu”) in the app list
  4. Click the three-dot menu next to the distro and select Uninstall
  5. Confirm the uninstallation when prompted
Installed apps on Windows Settings
Uninstall WSL distro in Windows Settings

Method 2: Command line tools (faster but more shallow)

Using PowerShell or Command Prompt is the preferred method for IT administrators who need speed, precision, and the ability to script removal across multiple systems. It’s fast and removes user data, configurations, and installed packages, but keeps the Microsoft Store app package intact, meaning you can reinstall the tool quickly without having to redownload it.

This method is best for resetting a broken environment or freeing disk space while planning to reuse the same distro later. You’re essentially getting a fresh start without losing the convenience of having the app package ready.

Follow these steps:

  1. Open PowerShell or Command Prompt as administrator through the Windows Search box
  2. List your installed distros to confirm the exact name with this command: <wsl –list –verbose>
  3. This shows all WSL distros with their running state and WSL version. Note the exact name because capitalization matters.
  4. Unregister the target distro with this command: <wsl –unregister Ubuntu>
  5. Replace “Ubuntu” with your distro’s name from step 2
Open PowerShell as admin
Check distro name in PowerShell
a screenshot of a black screen with a red box highlighted

Method 3: Automation via Group Policy (for large IT environments)

Microsoft Intune and Group Policy allow IT administrators to deploy PowerShell scripts across managed endpoints, executing the <wsl –unregister> command remotely or removing Microsoft Store packages using <Get-AppxPackage | Remove-AppxPackage>.

The process is more complex but allows you to automate the process across unlimited endpoints in a network. Here’s how:

Step 1: Create a PowerShell script to handle the removal logic

For this step, you’ll need to first open a text app such as Notepad or similar, then use it to create an executable PowerShell script such as:

The Script:

Atera does not guarantee the integrity, availability, security, virus-free, safety, lawfulness, non-infringement, rights’ status, or functionality of the scripts. The use of the shared scripts is at your own risk. Scripts are provided “AS IS”. *

# Remove-WSLDistro.ps1
$DistroName = “Ubuntu” $LogPath = "C:\IT\Logs\WSL-Removal.log" # Create log directory if it doesn't exist
New-Item -Path "C:\IT\Logs" -ItemType Directory -Force | Out-Null Check if distro exists
$distroList = wsl --list --quiet if ($distroList -contains $DistroName) { try { # Unregister the distro
 wsl --unregister $distroName $timestamp = Get-Date -format “yyy-MM-dd HH:mm:ss” “$timestamp - successfully removed $DistroName on $env:COMPUTERNAME” | Out-File -FilePath $LogPath -Append } catch { $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" “$timestamp - Failed to remove $DistroName on $env:COMPUTERNAME - Error: $_” | Out-File -FilePath $LogPath -Append } } else { $timestamp + Get-Date -Format "yyyy-MM-dd HH:mm:ss" "$timestamp - $DistroName not found on $env:COMPUTERNAME | Out-File -FilePath $LogPath -Append } 
Script copied to clipboard

To do this, follow these steps:

  1. Open Notepad and copy/paste the PowerShell script above, or generate your own
  2. Name the file “Remove-WSLDistro.ps1” (the .ps1 is important!)
  3. Save it to a shared network folder that all PCs on the network have read access to
Save PowerShell script to a network

Step 2: Open Group Policy Management

On your domain controller or administrative workstation, follow these steps:

  1. Open Group Policy Management Console by pressing Windows key + R, then typing “gpmc.msc” and pressing Enter
  2. In the console tree, expand your domain
  3. You’ll see your Active Directory structure including Organizational Units (OUs). Navigate to the OU that contains the computers where you want to remove WSL distros. This might be something like Domain > Computers > Workstations or Domain > IT Department > Developer Machines
  4. Right-click the target OU and select “Create a GPO in this domain”, and “Link it here
  5. Name the GPO something descriptive like “Remove WSL Ubuntu”
  6. Click OK

» Learn more about group policy management with Atera

Step 3: Configure the startup script

  1. Right-click your newly created GPO and select Edit
  2. Navigate to Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown)
  3. Double-click Startup
  4. Click PowerShell Scripts tab
  5. Click Add and browse to your network script location
  6. In the Script Name field, enter the file path of the PowerShell script you created in notepad
  7. Click OK to save

Pro tip: If you want a more comprehensive removal, you can follow the same steps for creating a PowerShell script but use the <Get-AppxPackage Ubuntu | Remove-AppxPackage> command to uninstall the WSL distro from endpoints instead.

» Here’s a simpler way to remotely remove applications with Atera

Troubleshooting common uninstallation issues

Even straightforward WSL distro removals can hit unexpected snags. Here are the most common ones and what you can do to fix them.

“Access denied” or other permission errors

This happens when you’re trying to run <wsl –unregister> without administrator privileges. Windows treats WSL distro removal as a system-level modification, so it requires elevated permissions.

The fix: Close your current PowerShell or Command Prompt window. Right-click the Start button, select “Windows Terminal (Admin)” or “PowerShell (Admin)”, and run the unregister command again. You should see a User Account Control (UAC) prompt; click “Yes” to proceed.

Distro is still running

If you try to unregister a distro while it’s actively running processes, the <wsl –unregister> command fails with an error message about the distro being in use.

The fix: Terminate the distro before attempting removal. Run <wsl –terminate Ubuntu> (replace with your distro name), which forcefully stops all running processes in that distro. Alternatively, run <wsl –shutdown> to stop all WSL distros at once. Wait 5 to 10 seconds, then retry the unregister command.

Dependency conflicts with Docker Desktop or other applications

Some applications create dedicated WSL distros for their own use. Docker Desktop, for example, uses docker-desktop and docker-desktop-data. Removing these breaks Docker completely.

The fix: Before removing any distro, verify it’s not being used by third-party applications. Check Docker Desktop settings (Settings > Resources > WSL Integration), Visual Studio Code’s Remote-WSL settings, or any Kubernetes tools you’ve installed. If an application depends on the distro, migrate your workloads first or reconfigure the application to use a different distro.

Simplify Windows management across your organization

Uninstalling WSL distros in Windows 11 ranges from simple one-click removals to complex enterprise IT deployments requiring automation and dependency management. Whether you’re performing quick local removals or deploying scripts across hundreds of endpoints, don’t forget to back up critical data, verify dependencies, and choose the right method for your scale.

For IT teams managing Windows environments at scale, the challenge isn’t just knowing how to run the commands; it’s maintaining visibility across all endpoints, deploying standardized configurations, and responding quickly when developers need support. Atera’s RMM platform gives IT professionals centralized control over Windows devices, remote PowerShell execution for script deployment, and automated patch management that keeps development environments secure.

While WSL management requires manual intervention, Atera handles the broader IT management foundation (monitoring, alerting, remote access, and ticketing) that makes supporting development teams efficient and scalable. When IT teams can remotely execute scripts, monitor device health, and resolve issues without desk-side visits, tasks like WSL distro standardization become manageable rather than overwhelming.

» Ready to get started? Try Atera for free!

Was this helpful?

* Scripts are provided for your benefit. You understand and acknowledge that when downloading and/or copying and/or using the Scripts: (i) you may be exposed to Scripts from a variety of sources, (ii) Atera is not responsible and takes no liability for the accuracy, usefulness, integrity, lawfulness, title or infringement, security, functionality or Intellectual Property Rights of, or relating to, such Scripts; and (iii) the Scripts are provided “AS IS” and “AS AVAILABLE”, and may have errors, and may not be malware-free, and that your interactions with, and use of, the Scripts is at your sole risk and free will. You hereby agree to waive, and hereby do waive, any legal or equitable rights or remedies you may have against Atera with respect to the Scripts.

Related Articles

What is IT Management

Read now

What is infrastructure monitoring?

Read now

CapEx vs. OpEx

Read now

How to restart a remote computer using Windows

Read now

Endless IT possibilities

Boost your productivity with Atera’s intuitive, centralized all-in-one platform