microsoft / WSL

Issues found on WSL

Home Page:https://docs.microsoft.com/windows/wsl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wsl/InstallDistro/WININET_E_CANNOT_CONNECT when installing Ubuntu

viblo-majority opened this issue · comments

Windows Version

Microsoft Windows [Version 10.0.22631.3447]

WSL Version

2.1.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

I have Rancher Desktop installed.
I should also add that I have tried to change my DNS settings to Google DNS, and that I have tried on two different networks (at home and at the office)

Repro Steps

> wsl --install -d Ubuntu-24.04
OR
Installing Ubuntu from the Windows store

Expected Behavior

Ubuntu installed

Actual Behavior

PS C:\code> wsl --install -d Ubuntu-24.04
A connection with the server could not be established
Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

Diagnostic Logs

WslLogs-2024-05-15_08-41-27.zip

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Diagnostic information
.wslconfig found
Detected appx version: 2.1.5.0
Detected user visible error: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT
commented

@viblo-majority: This looks like a connectivity issue, but maybe it's within the store.

Does:

wsl --install -d Ubuntu-24.04 --web-download

Help resolve the issue ?

I tried from two different (wifi) networks with the same result, and I don't have other network issues on any of them. But is there any specific address I can try with for example ping, curl or similar to check outside the wsl tool?

I did try the web-download option. I think it downloaded it, and maybe installed it. However, it can't be started, and now it will not try to install it again.

PS C:\> wsl -l --all
Windows Subsystem for Linux Distributions:
rancher-desktop-data (Default)
rancher-desktop
PS C:\> wsl -d ubuntu-24.04
There is no distribution with the supplied name.
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND
PS C:\> wsl --install -d Ubuntu-24.04
Ubuntu 24.04 LTS is already installed.
Launching Ubuntu 24.04 LTS...
The operation completed successfully.
PS C:\> wsl --install -d Ubuntu-24.04 --web-download
Ubuntu 24.04 LTS is already installed.
Launching Ubuntu 24.04 LTS...
The operation completed successfully.
commented

Does the distribution start if you start it via wsl.exe -d Ubuntu-24.04 ?

No. I had a list of all commands I tried in my previous comment, let me format them again for clarity:
(It doesn't matter the order of these commands, I've tried all of them several times)

  • wsl -l --all
PS C:\> wsl -l --all
Windows Subsystem for Linux Distributions:
rancher-desktop-data (Default)
rancher-desktop
  • wsl -d ubuntu-24.04
PS C:\> wsl -d ubuntu-24.04
There is no distribution with the supplied name.
Error code: Wsl/Service/WSL_E_DISTRO_NOT_FOUND
  • wsl --install -d Ubuntu-24.04
PS C:\> wsl --install -d Ubuntu-24.04
Ubuntu 24.04 LTS is already installed.
Launching Ubuntu 24.04 LTS...
The operation completed successfully.
  • wsl --install -d Ubuntu-24.04 --web-download
PS C:\> wsl --install -d Ubuntu-24.04 --web-download
Ubuntu 24.04 LTS is already installed.
Launching Ubuntu 24.04 LTS...
The operation completed successfully.
commented

Interesting. Do you have the Ubuntu-24.04 app installed now ? What if you start it manually ?

Oh, now it worked. I actually gave up and focused on other things, but seems like something happened that fixed it. (I did restart the computer both now and a 2 weeks ago when tried to troubleshoot this issue from the beginning).
However, some traces of the broken state could still be visible today when I ran the install command (you can see that it printed out that Ubuntu was already installed, but still proceeded to actually install it):

PS C:\code\dump> wsl --install -d Ubuntu-24.04
Ubuntu 24.04 LTS is already installed.
Launching Ubuntu 24.04 LTS...
Installing, this may take a few minutes..
commented

Hmm I wonder if the MSIX package for the ubuntu app was in a weird state, and rebooting maybe fixed the issue.
The Ubuntu 24.04 LTS is already installed logline is expected if the MSIX package for the distribution is already installed.

Closing since the issue is fixed, but please reopen if this reproduces again.