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:
- Press Windows + I
- Navigate to Accounts
- Check under your name to see if you are an administrator

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:
- Open PowerShell as an admin through the Windows Search box
- Paste the PowerShell command: <wsl –list –verbose> to double check what your actual distro name is
- The backup command is: <wsl –export Ubuntu C:\Backups\Ubuntu.tar>
- Make sure you choose your backup location carefully and have enough disk space since these archives can easily be 10 to 50+ GB.



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>

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


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:
- Open PowerShell or Command Prompt as administrator through the Windows Search box
- List your installed distros to confirm the exact name with this command: <wsl –list –verbose>
- This shows all WSL distros with their running state and WSL version. Note the exact name because capitalization matters.
- Unregister the target distro with this command: <wsl –unregister Ubuntu>
- Replace “Ubuntu” with your distro’s name from step 2



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 } To do this, follow these steps:
- Open Notepad and copy/paste the PowerShell script above, or generate your own
- Name the file “Remove-WSLDistro.ps1” (the .ps1 is important!)
- Save it to a shared network folder that all PCs on the network have read access to

Step 2: Open Group Policy Management
On your domain controller or administrative workstation, follow these steps:
- Open Group Policy Management Console by pressing Windows key + R, then typing “gpmc.msc” and pressing Enter
- In the console tree, expand your domain
- 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
- Right-click the target OU and select “Create a GPO in this domain”, and “Link it here”
- Name the GPO something descriptive like “Remove WSL Ubuntu”
- Click OK
» Learn more about group policy management with Atera
Step 3: Configure the startup script
- Right-click your newly created GPO and select Edit
- Navigate to Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown)
- Double-click Startup
- Click PowerShell Scripts tab
- Click Add and browse to your network script location
- In the Script Name field, enter the file path of the PowerShell script you created in notepad
- 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!
Related Articles
What is IT Management
IT downtime costs thousands of dollars per minute, yet most companies don't realize they have a management problem until systems fail. Without structured IT management, you face productivity hemorrhage, security breaches from unpatched vulnerabilities, and technical debt that consumes IT budgets. Technology should be a business enabler, not a constant crisis.
Read nowWhat is infrastructure monitoring?
The difference between proactive IT and midnight firefighting comes down to visibility: seeing CPU saturation before it crashes services, catching disk failures before they lose data, and detecting anomalies hours before they become disasters. Effective infrastructure monitoring is the path that gets you there.
Read nowCapEx vs. OpEx
Misclassifying IT spending as CapEx or OpEx inflates profits short-term but distorts financial reporting, tax liability, and strategic decisions. Bad enough, this could be extremely costly and time-consuming to fix. Getting it right determines whether your IT investments align with cash flow, growth trajectory, and compliance requirements.
Read nowHow to restart a remote computer using Windows
Remote Windows restarts fail when network connectivity drops, permissions aren't configured correctly, or firewall rules block critical services. This guide covers every method (from Command Prompt and PowerShell to enterprise tools like Intune and SCCM) plus backup strategies for when systems freeze or disconnect from the domain.
Read nowEndless IT possibilities
Boost your productivity with Atera’s intuitive, centralized all-in-one platform







