sodcalculator

10 Tech How-To

Fix WSL Error 0x80070057 (Step-by-Step)

Guide 10-36825 · Updated · Step by step

This guide walks you through fixing Windows Subsystem for Linux (WSL) error 0x80070057, which usually appears when installing, starting, or updating a distribution. The error is a generic Windows “invalid argument” code, but in WSL it almost always points to a corrupted installation, a mismatch between WSL versions, or a leftover virtual machine state. The fixes below are ordered from least to most invasive, so you can stop as soon as one works.

What You’ll Need

  • Administrator access to your Windows machine (to run PowerShell or Command Prompt as admin).
  • Internet connection (for downloading the WSL update or re-installing a distribution).
  • Your distribution name (e.g., Ubuntu, Debian) if you plan to reinstall it.

Step-by-Step

  1. Restart your PC. This clears any temporary file locks or stuck WSL services. After rebooting, try running wsl --shutdown in an admin terminal, then start WSL again. If the error is gone, you’re done.
  2. Update WSL to the latest version. Open PowerShell as Administrator and run wsl --update. This downloads the newest WSL kernel and components. If you’re on an older Windows build, you may need to install the WSL feature manually via dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart and then dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart, followed by a restart.
  3. Check your WSL version. Run wsl --status and wsl --version. If you see WSL 1 but your distribution expects WSL 2, set the default with wsl --set-default-version 2. You can also set a specific distro to WSL 2 with wsl --set-version <distro-name> 2.
  4. Terminate all WSL processes. In an admin PowerShell, run wsl --shutdown. Then check for any lingering processes with tasklist | findstr wsl and kill them with taskkill /IM wsl.exe /F if needed.
  5. Reset the WSL network and virtual switch. Sometimes the virtual Ethernet adapter gets corrupted. Run wsl --shutdown, then in an admin Command Prompt: netsh winsock reset and netsh int ip reset. Restart your PC.
  6. Uninstall and reinstall the problematic distribution. If the error appears when launching a specific distro, back up any files inside it first. Then run wsl --unregister <distro-name> (this deletes all data in that distro). Reinstall from the Microsoft Store or with wsl --install -d <distro-name>.
  7. Repair the WSL feature itself. Go to Settings > Apps > Optional features (or Apps & features > Programs and Features), find “Windows Subsystem for Linux,” and choose Modify or Repair. If that’s not available, uninstall the feature and re-enable it via the DISM commands in step 2.
  8. Check for Windows updates. Install all pending updates in Settings > Update & Security > Windows Update, then restart. WSL updates are often bundled with Windows updates.

Common Mistakes

  • Running commands without admin rights. Most WSL fixes require an elevated PowerShell/CMD. Right-click and select “Run as administrator.”
  • Unregistering a distro without backing up. wsl --unregister permanently deletes all files inside that distro. Copy anything important to Windows first.
  • Mixing WSL 1 and WSL 2. If you have both versions installed, a distro set to WSL 1 may throw 0x80070057 when trying to access WSL 2 features. Use wsl --set-version to align them.
  • Skipping the restart. Several steps (like winsock reset) only take effect after a reboot. Don’t skip it.
  • Using the wrong distribution name. Check the exact name with wsl --list --verbose before running unregister or set-version commands.

Tips

  • After updating WSL, run wsl --shutdown once to ensure the new kernel is loaded.
  • Keep your Windows and WSL versions in sync. If you’re on Windows 10, consider upgrading to Windows 11 for better WSL 2 stability.
  • If you have multiple distros, try starting another one. If that works, the issue is specific to the broken distro, not WSL itself.
  • Use wsl --export to back up a distro before making major changes. You can later wsl --import it back.
  • For persistent issues, check the Windows Event Viewer (under Applications and Services Logs > Microsoft > Windows > WSL) for more specific error details.

Troubleshooting

If the error persists after trying all steps above, try these additional checks:

  • Check virtualization is enabled. Open Task Manager > Performance tab. If “Virtualization” shows Disabled, enter your BIOS/UEFI and enable Intel VT-x or AMD-V. This is required for WSL 2.
  • Look for conflicting third-party antivirus or firewall software. Temporarily disable them (or add WSL exclusions) to see if they’re blocking the virtual machine.
  • Try creating a new Windows user account. A corrupted user profile can cause WSL to fail. Test if WSL works under a different admin account.
  • Run the Windows System File Checker. In an admin Command Prompt, run sfc /scannow and then DISM /Online /Cleanup-Image /RestoreHealth. This repairs system files that WSL depends on.
  • If you’re on a corporate or managed PC, check Group Policy. Some policies block WSL or virtual machine features. Contact your IT admin.
  • As a last resort, reset Windows. Choose “Keep my files” in the recovery options. This re-installs Windows but keeps your personal files, and it will re-enable all WSL components.

Frequently Asked Questions

What does error 0x80070057 mean in WSL?

It’s the Windows error code for “The parameter is incorrect.” In WSL, it usually indicates a mismatch between WSL versions, a corrupted installation, or a problem with the virtual machine’s configuration.

Will I lose my files if I run wsl --unregister?

Yes, that command deletes the entire Linux distribution, including all files inside it. Always back up important data with wsl --export before unregistering.

Why does the error happen after a Windows update?

Windows updates can sometimes change WSL settings or leave old kernel files behind. Running wsl --update and restarting usually resolves it.

Can I fix this without reinstalling my distro?

Often yes. Try steps 1–5 first (restart, update, shutdown, reset network). Only if those fail should you consider unregistering and reinstalling the distro.

Is WSL 1 or WSL 2 better for avoiding this error?

WSL 2 is the current standard and receives more updates. The error is not caused by using WSL 2 itself, but by having a mixed environment. Set everything to WSL 2.

Does this error affect all WSL distributions?

It can, but it’s often specific to one distro. If only one distro fails, reinstalling that distro is the most direct fix.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →