Today I want to share a feature called Windows Subsystem for Linux (WSL) that is so powerful to run a Linux environment on your Windows machine.
It’s excellent for developers and tech people who need Linux tools without installing a separate computer or creating a VM. But during the setup or usage of WSL, you may come across errors like Failed with error WSL Register Distribution 0x80370102.
This is an error that may stop you from having your Linux distribution installed or running in WSL. While it can be annoying, the error is most often caused by something simple in the configuration.
What Does the Error Mean?
This error happens when WSL attempts to create or register a Linux distribution but fails at it. The direct error code 0x80370102 is predominantly virtualization-related because of the scenario. That indicates the system does not have the virtualization features necessary to run WSL.
- This is typically encountered in below scenarios:
- When creating a new Linux distribution for WSL.
- When you upgrade from WSL 1 to WSL 2.
- When my distribution is already installed I try to start it.
Why Does This Error Happen?
There are several causes of this error:
- Hardware Virtualization Not Available: WSL 2 relies on hardware virtualization (Intel VT-x or AMD-V). If it’s not enabled on your system, then you’ll get the error.
- Hyper-V is not installed: Hyper-V, a Windows feature utilized for virtualization, needs to be installed and enabled for WSL 2 to function properly.
- Old Windows: An outdated version of Windows might not be 100% compatible with WSL 2.
- BIOS Settings: In some systems, virtualization is disabled by default at the BIOS level.
- Conflicts with Third-Party Virtualization Software: Tools like VMware or VirtualBox can conflict with WSL.
Steps to Fix the Error
How to Solve “WSL register distribution failed with error: 0x80370102”? Here’s how to make sure your system is configured correctly for WSL.
Step 1: Virtualization in the BIOS
- To use WSL 2 virtualization must be enabled in your computer’s BIOS settings.
- Restart your PC and boot into the BIOS setup. You typically do this by tapping a function key, F2, F10, Del, or Esc on startup. Use on-screen prompts to enter the BIOS.
- This setting can differ: Virtualization Technology, Intel VT-x, or AMD-V, just search in BIOS.
- Turn on the virtualization option, and then save your changes.
Restart your computer
- The “Enable virtualization” setting is important for WSL 2
- Enable Hyper-V in Windows
- The Windows feature Hyper-V is necessary for virtualization. Without it enabled, WSL 2 will not function.
- Enter Control Panel then: Programs > Programs and Features
Click on Turn Windows features on and off.
Under the features list, tick these options:
- Hyper-V
- Virtual Machine Platform
- Windows Subsystem for Linux
Hit OK, and then restart your PC when you’re prompted.
⦁ This step ensures Windows has all the proper tools in place for WSL 2.
Update Windows to the Latest Version
That means you’ll need Windows 10 version 2004 or above for WSL 2. Update your system if you’re running an older version.
- Go to Update & Security from Settings.
- Next, click Check for updates, and install all the updates, if any.
- If you’re not on the most recent version, consider upgrading to Windows 11 or the latest supported release of Windows 10.
- Updating your system is crucial for WSL 2 compatibility
Set WSL Version to 2
If you already have WSL installed but are on version 1, you’ll need to upgrade to WSL 2.
Check the current WSL version:
wsl --list --verbose
If your distribution is using WSL 1, set it to WSL 2:
wsl --set-version <distribution-name> 2
Replace <distribution-name>
with the name of your Linux distribution, such as Ubuntu
.
Set WSL 2 as the default version for future installations:
wsl --set-default-version 2
This ensures that WSL 2 is used for all distributions.
Reinstall the Linux Distribution
Maybe it is a problem with the Linux distribution itself if the issue continues. Reinstalling the distribution may work.
- Uninstall the distribution:
- Open Settings > Apps.
- Locate your Linux distribution (for example, Ubuntu) and click Uninstall.
Reinstall the distribution:
- Visit the Microsoft Store and look for your favorite Linux distribution.
- Go through setting up the distribution as per on-screen instructions.
- A reinstallation of different distributions will be properly set.
Check for Conflicts with Virtualization Software
Some third-party virtualization software (such as VMware or VirtualBox) can conflict with Hyper-V and WSL. To avoid conflicts:
- Make sure that Hyper-V has been enabled.
- VMware or VirtualBox latest versions, because recent versions are Hyper-V compatible.
- If necessary, temporarily disable or uninstall conflicting software.
Verify the WSL Configuration
Verify that WSL is set up properly using PowerShell.
To do that, open PowerShell as administrator.
Check the WSL installation:
wsl --list --verbose
Set the Linux Distribution to version 2. If not then update it as shown above.
What If the Error Persists?
If you have followed all of the steps and you still hit the error:
- Also, it could be a good idea to reset your Windows installation to make sure that there are no problems in the system core.
- Use the Event Viewer to check the event logs for more information about this error.
- For further assistance, contact Microsoft Support.
Conclusion
The WSL register distribution failed with error 0x80370102 error is usually a collection of virtualization or configuration errors. You can fix Wsl Register Distribution failure with error: 0x80040400 (WSL Issue) by enabling virtualization in the BIOS, installing Hyper-V, updating your Windows, and configuring WSL properly.
By understanding these steps, you can troubleshoot and resolve common WSL issues, enabling you to work in a flexible and powerful development environment. Using the solutions described in this guide, you will be able to get WSL up and running in no time.