microsoft / microsoft/WSL

Cannot install custom modern WSL2 distro that is hosted remotetly

Open
#12,752 12 comments 0 reactions 1 assignee View on GitHub

@OneBlue is already working on this.

Since Mar 28, 2025.

feature question
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

Hi all,

I am going to register a modern WSL2 distribution with respect to following [guide](https://learn.microsoft.com/en-us/windows/wsl/build-custom-distro#adding-your-distro-to-wsl---install-for-your-enterprise-or-group):

The local use case where the Url parameter will be resolved as a local path works fine:
`Url = "file://$TarPath"`

However, I want to set the `Url` parameter to a URL that points to the remote location of the TAR-archive. The download of the distribution fails (in my case due to 401):
```powershell
PS C:\Users\MyUser> wsl -l -o
Below is a list of valid distributions that can be installed.
Run the installation using the command wsl.exe --install .

NAME FRIENDLY NAME
MyDistro-v1 MyDistro-24.04 (v1)
PS C:\Users\MyUser> wsl --install MyDistro-v1
Downloading: MyDistro-24.04 (v1)
Not authorized (401).
Error code: Wsl/InstallDistro/0x80190191
```

My question:
**How can I configure wsl.exe to download the TAR-archive with existing credentials? Or do it need to provide some kind of environment variables**

Best Valentin

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.