How to Uninstall WSL on Windows 11: Step-by-Step Guide to Remove Windows Subsystem for Linux

Windows Subsystem for Linux (WSL) allows you to run Linux environments directly on Windows 11 without the need for a virtual machine. However, there might be times when you want to remove WSL from your system, either to free up space or to troubleshoot issues.

This guide will walk you through the process of uninstalling WSL from your Windows 11 machine in simple, easy-to-follow steps. Whether you want to remove just the Linux distributions or uninstall the entire WSL feature, this article covers it all.

By following these instructions carefully, you can ensure a clean removal without affecting other parts of your system. Let’s get started.

Before diving in, it’s important to understand what exactly you want to remove: the Linux distributions installed within WSL or the WSL feature itself. Both are covered below.

Quick Note: Prerequisites and Things to Check

  • Make sure you have administrator rights on your Windows 11 PC, as uninstalling WSL components requires elevated permissions.
  • Back up any important files from your Linux distributions before uninstalling. Removing WSL or its distributions deletes all related files permanently.
  • Check which Linux distributions you have installed by opening the Start menu and typing wsl -l -v in Command Prompt or PowerShell. This helps you decide what to remove.
  • Remember that uninstalling WSL will disable Linux compatibility on your system, so ensure you no longer need this feature before proceeding.

Step 1: Uninstall Linux Distributions

The first step is to remove any Linux distributions you have installed through WSL. This is important because simply disabling WSL won’t delete these distributions, which can take up disk space.

  1. Open the Settings app by pressing Windows + I.
  2. Navigate to Apps > Installed apps.
  3. In the search box, type the name of your installed Linux distribution, such as Ubuntu, Debian, or Kali Linux.
  4. Click the three dots next to the distribution name and select Uninstall.
  5. Confirm the uninstallation when prompted. This will remove the Linux distribution and all associated files.

If you have multiple distributions, repeat the above steps for each one.

Step 2: Disable the WSL Feature

After removing the Linux distributions, you can disable the WSL feature itself from Windows. This step turns off WSL integration system-wide.

  1. Press Windows + R to open the Run dialog box.
  2. Type optionalfeatures and press Enter. This opens the “Windows Features” window.
  3. Scroll down and locate Windows Subsystem for Linux.
  4. Uncheck the box next to it.
  5. Click OK to apply the changes.
  6. Restart your computer when prompted to complete the removal process.

Disabling this feature ensures that WSL is no longer active on your system.

Alternative Method: Using PowerShell to Uninstall WSL

If you prefer using command-line tools, PowerShell offers a quick way to uninstall WSL and its components.

  1. Open PowerShell as administrator by right-clicking the Start button and selecting Windows Terminal (Admin) or PowerShell (Admin).
  2. To list installed Linux distributions, enter:
  3. wsl --list
  4. To unregister (uninstall) a specific distribution, use:
  5. wsl --unregister <DistributionName>

    Replace <DistributionName> with the actual name, such as Ubuntu.

  6. To disable the WSL feature, run this command:
  7. Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
  8. Restart your computer to finalize the changes.

Step 3: Remove the Virtual Machine Platform Feature (Optional)

WSL 2 uses the Virtual Machine Platform feature to run Linux kernels. If you are sure you won’t use WSL or related virtualization features, you can disable this as well.

  1. Open Windows Features by typing optionalfeatures in the Run dialog.
  2. Find Virtual Machine Platform in the list.
  3. Uncheck the box and click OK.
  4. Restart your computer.

This frees up resources and disables virtualization support used by WSL 2.

FAQs

Will uninstalling WSL delete my Linux files?

Yes, uninstalling a Linux distribution or disabling WSL will remove all files stored within those Linux environments. Always back up important data before proceeding.

Can I reinstall WSL later?

Absolutely. You can reinstall WSL by enabling the Windows Subsystem for Linux feature again and installing your preferred Linux distributions from the Microsoft Store.

What if I only want to reset my Linux distribution?

You can reset a Linux distribution without uninstalling it by going to Settings > Apps > Installed apps, selecting the distribution, and choosing Advanced options > Reset. This clears data but keeps the app installed.

Will disabling WSL affect other Windows features?

Disabling WSL only affects Linux subsystem functionality. It does not impact general Windows operations or non-WSL-related applications.

How do I check if WSL is still enabled?

Open PowerShell and type wsl -l -v. If the command returns errors or no distributions, WSL is likely disabled.

When Nothing Works

If you encounter issues during uninstallation or residual files remain, you can try the following:

  • Use the Windows Troubleshooter for apps and features to fix uninstall problems.
  • Run sfc /scannow in an elevated Command Prompt to check for system file corruption.
  • Refer to the official Microsoft documentation on WSL uninstall and reset at Microsoft WSL Documentation.
  • Contact Microsoft Support for advanced help if needed.

Conclusion

Uninstalling WSL on Windows 11 is a straightforward process when done step-by-step. First, remove your Linux distributions to clear space and data. Then, disable the WSL feature to turn off Linux support on your PC. Optionally, remove the Virtual Machine Platform if you don’t need virtualization features.

Using either the Settings app or PowerShell commands provides flexibility depending on your comfort level. Always remember to back up important files and restart your computer after making changes to ensure everything is properly applied.

Following this guide ensures a clean and complete removal of WSL, freeing your system from Linux integration when it’s no longer needed.

Leave a Reply