Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Uninstall Kali Linux from WSL on Windows 11

· 4 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

This guide walks you through completely removing Kali Linux from Windows Subsystem for Linux (WSL) on Windows 11. Whether you're freeing up disk space, switching to a different distro, or just cleaning house, these steps will unregister the distro and delete its files. This does not remove the WSL feature itself — only the Kali distribution. You'll need administrative access to Windows and a few minutes of time.

What You'll Need

  • Windows 11 with WSL installed (any version).
  • Administrator rights on your Windows account.
  • Optional: a backup of any files you want to keep from inside Kali (because this deletes everything in that distro).

Step-by-Step

  1. Close any open Kali terminal windows. Make sure no WSL sessions are running to avoid file locks.
  2. Open PowerShell or Command Prompt as Administrator. Right-click the Start button and select "Terminal (Admin)" or "Windows PowerShell (Admin)".
  3. List all installed WSL distros. Type wsl --list --verbose or wsl -l -v and press Enter. Note the exact name of the Kali distribution (usually "kali-linux").
  4. Terminate any running WSL instances. Run wsl --shutdown to stop all WSL processes.
  5. Unregister the Kali distro. Run wsl --unregister kali-linux (replace kali-linux with the exact name from step 3). This deletes the virtual hard disk and all files inside it.
  6. Confirm removal. Run wsl --list --verbose again — Kali should no longer appear.
  7. Optional: clean up Start menu shortcuts. If a Kali shortcut remains, right-click it and choose "Unpin from Start" or delete it from the Start menu folder.

Common Mistakes

  • Running the wrong command: Using wsl --uninstall instead of wsl --unregister. The former is not a valid WSL command; the latter is what actually removes the distro.
  • Not shutting down WSL first: If a distro is running, unregistering may fail or leave a stale process. Always run wsl --shutdown first.
  • Typing the wrong distro name: If you have multiple distros, you might accidentally unregister the wrong one. Double-check the exact name from the list.
  • Forgetting to back up: Unregistering deletes all files in that distro permanently. There's no recycle bin.

Tips

  • Back up important files: Copy anything you need from Kali (e.g., in /home) to Windows before unregistering. You can use cp or scp from inside Kali, or simply copy via the \wsl$ path in File Explorer.
  • Check disk space after removal: The virtual hard disk file (ext4.vhdx) is deleted automatically, but you can verify with wsl --list --verbose and by checking your C: drive free space.
  • If you plan to reinstall later: Use wsl --install -d kali-linux to get a fresh copy.
  • Remove leftover WSL feature (optional): If you want to remove WSL entirely, go to "Windows Features" and uncheck "Windows Subsystem for Linux" (plus the Virtual Machine Platform if you used it). But that's beyond this guide.

Troubleshooting

  • "The specified distribution is not installed" error: This means the name you typed doesn't match. Run wsl --list --verbose to see the exact name. It might be "kali-linux" or something else like "Kali" — use what's shown.
  • "Access is denied" or "Permission denied": Make sure you're running PowerShell or Command Prompt as Administrator. Right-click and select "Run as administrator".
  • Unregister command hangs: Close all WSL windows and try wsl --shutdown again. If it still hangs, restart Windows and retry.
  • Kali still appears in the Start menu: The shortcut is just a link; it's safe to delete manually. Right-click and choose "Unpin from Start" or browse to %AppData%\Microsoft\Windows\Start Menu\Programs and delete the shortcut.
  • Disk space not freed: Sometimes the .vhdx file is not immediately removed due to a delay. Wait a few minutes, or run Optimize-VHD if you're using Hyper-V (advanced). Usually a restart clears it.

Frequently Asked Questions

  • Does unregistering Kali delete all my files inside it? Yes. The entire virtual disk is removed, including all files, settings, and installed packages. Back up anything you need first.
  • Will this remove WSL itself? No. It only removes the Kali distribution. WSL remains installed and functional for other distros.
  • Can I undo the uninstall? No, it's permanent. You can reinstall Kali from the Microsoft Store or via wsl --install -d kali-linux, but you'll get a fresh system.
  • How do I know if I have multiple distros? Run wsl --list --verbose. It shows all installed distros and their state.
  • What if I only want to reset Kali without removing it? You can use wsl --unregister kali-linux and then reinstall it — that's a clean reset. Alternatively, use wsl --terminate kali-linux to stop it, but that doesn't delete files.
  • Is there a way to uninstall Kali from the Microsoft Store? Yes, you can also go to Settings > Apps > Installed apps, find "Kali Linux", and click Uninstall. That does the same as unregistering.