Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install WSL from the command prompt #9314

Closed
1 of 2 tasks
ghost opened this issue Dec 12, 2022 · 33 comments
Closed
1 of 2 tasks

Can't install WSL from the command prompt #9314

ghost opened this issue Dec 12, 2022 · 33 comments

Comments

@ghost
Copy link

ghost commented Dec 12, 2022

Version

Microsoft Windows [Version 10.0.22621.819]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

No response

Distro Version

No response

Other Software

No response

Repro Steps

wsl --list --online

Expected Behavior

it should install list the available distributions.

Actual Behavior

Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established Error code: Wsl/WININET_E_CANNOT_CONNECT

Diagnostic Logs

C:\Users\User\Desktop>qq.bat
"WSL version (Might be help text if store WSL is not installed):"
WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.819
Windows features:

FeatureName

Printing-PrintToPDFServices-Features
Printing-XPSServices-Features
LegacyComponents
DirectPlay
MSRDC-Infrastructure
MicrosoftWindowsPowerShellV2Root
MicrosoftWindowsPowerShellV2
NetFx4-AdvSrvs
NetFx4Extended-ASPNET45
WCF-Services45
WCF-TCP-PortSharing45
NetFx3
MediaPlayback
WindowsMediaPlayer
SearchEngine-Client-Package
WorkFolders-Client
Printing-Foundation-Features
Printing-Foundation-InternetPrinting-Client

HNS objects:
'hnsdiag' is not recognized as an internal or external command,
operable program or batch file.
Routing table:

Interface List
24...d4 5d 64 66 4c a8 ......Realtek PCIe GbE Family Controller #2
7...0a 00 27 00 00 07 ......VirtualBox Host-Only Ethernet Adapter
3...0a 00 27 00 00 03 ......VirtualBox Host-Only Ethernet Adapter #3
9...c8 b2 9b 5d 9e be ......Microsoft Wi-Fi Direct Virtual Adapter #3
17...ca b2 9b 5d 9e bd ......Microsoft Wi-Fi Direct Virtual Adapter #4
22...c8 b2 9b 5d 9e bd ......Intel(R) Wireless-AC 9560 160MHz
1...........................Software Loopback Interface 1

IPv4 Route Table

Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.29.1 192.168.29.254 36
127.0.0.0 255.0.0.0 On-link 127.0.0.1 331
127.0.0.1 255.255.255.255 On-link 127.0.0.1 331
127.255.255.255 255.255.255.255 On-link 127.0.0.1 331
169.254.0.0 255.255.0.0 On-link 169.254.111.98 281
169.254.0.0 255.255.0.0 On-link 169.254.54.106 281
169.254.54.106 255.255.255.255 On-link 169.254.54.106 281
169.254.111.98 255.255.255.255 On-link 169.254.111.98 281
169.254.255.255 255.255.255.255 On-link 169.254.111.98 281
169.254.255.255 255.255.255.255 On-link 169.254.54.106 281
192.168.29.0 255.255.255.0 On-link 192.168.29.254 291
192.168.29.254 255.255.255.255 On-link 192.168.29.254 291
192.168.29.255 255.255.255.255 On-link 192.168.29.254 291
224.0.0.0 240.0.0.0 On-link 127.0.0.1 331
224.0.0.0 240.0.0.0 On-link 169.254.111.98 281
224.0.0.0 240.0.0.0 On-link 169.254.54.106 281
224.0.0.0 240.0.0.0 On-link 192.168.29.254 291
255.255.255.255 255.255.255.255 On-link 127.0.0.1 331
255.255.255.255 255.255.255.255 On-link 169.254.111.98 281
255.255.255.255 255.255.255.255 On-link 169.254.54.106 281
255.255.255.255 255.255.255.255 On-link 192.168.29.254 291

Persistent Routes:
None

IPv6 Route Table

Active Routes:
If Metric Network Destination Gateway
22 51 ::/0 fe80::7297:41ff:fed5:f35e
1 331 ::1/128 On-link
22 51 2405:201:ac09:d079::/64 On-link
22 291 2405:201:ac09:d079:7ce0:f1b5:5d5:4538/128
On-link
22 291 2405:201:ac09:d079:8542:56:858b:e041/128
On-link
7 281 fe80::/64 On-link
3 281 fe80::/64 On-link
22 291 fe80::/64 On-link
22 291 fe80::3ba4:8383:e415:3d9b/128
On-link
3 281 fe80::9a28:d19c:839:c4af/128
On-link
7 281 fe80::cb8f:d634:aa3b:65b2/128
On-link
1 331 ff00::/8 On-link
7 281 ff00::/8 On-link
3 281 ff00::/8 On-link
22 291 ff00::/8 On-link

Persistent Routes:
None
Deleting HNS network
Get-HnsNetwork : The term 'Get-HnsNetwork' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path
is correct and try again.
At line:1 char:1

  • Get-HnsNetwork | Where-Object {$_.Name -eq 'WSL'} | Remove-HnsNetwork
  •   + CategoryInfo          : ObjectNotFound: (Get-HnsNetwork:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

The Windows Subsystem for Linux service is stopping.
The Windows Subsystem for Linux service was stopped successfully.

Name : HnsPacketCapture
CaptureMode : SaveToFile
LocalFilePath : C:\Users\User\Desktop\packets.etl
MaxFileSize : 250 MB
TraceBufferSize : 0 KB
MaxNumberOfBuffers : 0
SessionStatus : NotRunning

Name : Microsoft-Windows-NDIS-PacketCapture
SessionName : HnsPacketCapture
Level : 5
MatchAnyKeyword : 0xFFFFFFFFFFFFFFFF
MatchAllKeyword : 0x0
CaptureType : BothPhysicalAndSwitch
VmCaptureDirection : IngressAndEgress
MultiLayer : False
LinkLayerAddress : {}
EtherType : {}
IpAddresses : {}
IpProtocols : {}
TruncationLength : 128

Windows Subsystem for Linux has no installed distributions.

Use 'wsl.exe --list --online' to list available distributions
and 'wsl.exe --install ' to install.

Distributions can also be installed by visiting the Microsoft Store:
https://aka.ms/wslstore
Error code: Wsl/Service/CreateInstance/GetDefaultDistro/WSL_E_DEFAULT_DISTRO_NOT_FOUND
Press Ctrl+C to cancel the stop operation.
100% [>>>>>>>>>>>>>>>>>>>>>>

]
The trace was successfully saved.

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 13, 2022

Thank you for reporting this @itsdoble. Does this reproduce consistently ? Based on the output it looks like an intermittent connection issue.

@ashish-atidiv
Copy link

I too get this error and tried below steps next. I am on a windows 11 machine.

  • used windows features to enable WSL, restarted
  • tried wsl --status, asked to enable next feature (in point below)
  • used windows features to enable virtual machine platform, restarted
  • tried wsl --status again, it asked to run wsl --update
    After this WSL in installed. But if i run wsl -l -o, I get the same error as below.
    image

@ashish-atidiv
Copy link

Following up on the last post, I can see WSL installed in local machine. If i try to open...it gives me this error
image

@ashish-atidiv
Copy link

As an alternative, I installed Ubuntu app from Windows Store and that worked!

@ghost ghost closed this as completed Dec 20, 2022
@ghost
Copy link

ghost commented Dec 20, 2022

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!

@NO-GAMENOLIFE
Copy link

so what happened did anyone got any solution?

@sivateja1995
Copy link

image
same issue here

@ag011
Copy link

ag011 commented Jan 18, 2023

image

same issue for me also

@NO-GAMENOLIFE
Copy link

i got the solution. change your ip address for wifi or cable to google ip address(dns) and be sure to change ipv4 and ipv6 both. after that reinstall wsl.

@taoliu12
Copy link

I literally had a brief internet connection drop that caused this issue. So check your internet.

@mikerains
Copy link

One Windows 10, I am finding that DNS Servers include 2 that are ipv6 addresses. I can open https://raw.githubusercontent.com in my browser, and I can curl it from wsl command line, but from WIndows Command Prompt, wsl --install Ubuntu fails with "Failed to fetch the list distribution".

I suspect it all has to do with the DNS Name resolinv gto an IPv6 address that curl and the browser can handle but the wsl subsystem cannot?

I just performed wsl --update, so I am on the latest WSL 2.

@W1M0R
Copy link

W1M0R commented Feb 21, 2023

I also get this issue:

image

@Basit-Imam
Copy link

If you're in India and using JIO, change your operator, worked for me.
image

@ViratSrivastava
Copy link

If you're in India and using JIO, change your operator, worked for me. image

I can confirm that. JIO internet seems to be the issue for connection issue

@mheboob-bloch
Copy link

I literally had a brief internet connection drop that caused this issue. So check your internet.

Right Answer

@shortthirdman
Copy link

If you're in India and using JIO, change your operator, worked for me. image

@ViratSrivastava Just change the Preferred DNS and Alternate DNS in your Windows Settings for adapters (Jio) to use Google Public DNS (for both IPv4 and IPv6). Check here Configure your network settings to use Google Public DNS

@keshavsinghmfp
Copy link

Screenshot 2023-06-09 085533

Change your ipv4 and ipv6 addresses to Google DNS and it will work even on Jio

@TST14
Copy link

TST14 commented Jun 23, 2023

nd tried below steps next. I am on a windows

If you're in India and using JIO, change your operator, worked for me. image

True. Not working in Jio. Working in other network

@patelabhilash
Copy link

Can't believe this was the issue. it works!

@gauravjadhav-mjb
Copy link

yup it is issue with jio network :)

@rythmn1111
Copy link

If you're in India and using JIO, change your operator, worked for me. image

bro I literary have JioFiber AHHH what should I do

@patelabhilash
Copy link

If you're in India and using JIO, change your operator, worked for me. image

bro I literary have JioFiber AHHH what should I do

it's a onetime thing. once installed WSL will work with jio. so, take help from any friend with a mobile hotspot. No need to ask such trivial things here. In worst case try proxy.

@dheeraj0000
Copy link

dheeraj0000 commented Sep 29, 2023

Getting error like this what can i do

Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established
Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

@AbhishekAdiga
Copy link

If you're in India and using JIO, change your operator, worked for me. image

@ViratSrivastava Just change the Preferred DNS and Alternate DNS in your Windows Settings for adapters (Jio) to use Google Public DNS (for both IPv4 and IPv6). Check here Configure your network settings to use Google Public DNS

Getting error like this what can i do

Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

CHANGE THE NETWORK AND TRY IT , IT IS NOT WORKING ON JIO NETWORK.

@keshavsinghmfp
Copy link

Getting error like this what can i do

Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

Make sure you've changed ur ipv4 and ipv6 addresses to Google DNS and it will work even on Jio....or else consider using any other network.

@thakrenikhil
Copy link

Try changing the network for me I switched to Airtel from Jio and then enabled Hyper-v and Vm under windows features. Problem was solved

@lipun12ka4
Copy link

lipun12ka4 commented Nov 4, 2023

I had the same problem. I am in Bengaluru and I am using Hathway. turned on my OpenVPN connection, and installed WSL (Ubuntu), and disabled VPN. Everything , like apt from inside ubuntu works just fine, without VPN.

@Oluadepe
Copy link

Oluadepe commented Nov 6, 2023

If you're in India and using JIO, change your operator, worked for me. image

@ViratSrivastava Just change the Preferred DNS and Alternate DNS in your Windows Settings for adapters (Jio) to use Google Public DNS (for both IPv4 and IPv6). Check here Configure your network settings to use Google Public DNS

Getting error like this what can i do
Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

CHANGE THE NETWORK AND TRY IT , IT IS NOT WORKING ON JIO NETWORK.

Its not for Indians alone. If anyone is having issues just follow the instruction on how to change your DNS and it will work. I just did that from Nigerian and it worked

@dhinesh2411
Copy link

Use Any Vpn problem solved
image

@Kishore-MK
Copy link

@DhineshAmbrose I did the same and it worked for me as well.

@rusty3699
Copy link

rusty3699 commented Jan 3, 2024

Potential Solutions to try:

  1. Change DNS Servers - can switch to Google public DNS(8.8.8.8 and 8.8.4.4) for IPv4 and IPv6
  2. Network-Specific Issues: If using Jio, consider switching the network or using a VPN.
  3. Install from Microsoft Store - if CLI fails, install wsl from Microsoft Store: this is Ubuntu 22.04.3 LTS https://www.microsoft.com/store/productId/9PN20MSR04DW?ocid=pdpshare

To Reinstall wsl using CLI:
Reinstall WSL
wsl -l
wsl --unregister
wsl --shutdown
wsl --install
Restart the computer

@pklapperich
Copy link

So this is clearly a bug that lots of people are hitting. What information is required yet?

> nslookup raw.githubusercontent.com
Server:  UnKnown
Address:  127.0.0.2

Non-authoritative answer:
Name:    raw.githubusercontent.com
Addresses:  2606:50c0:8003::154
          2606:50c0:8002::154
          2606:50c0:8000::154
          2606:50c0:8001::154
          185.199.110.133
          185.199.111.133
          185.199.108.133
          185.199.109.133
          
> Invoke-WebRequest https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json


StatusCode        : 200
StatusDescription : OK
Content           : {
                        "Distributions": [
                            {
                                "Name": "Ubuntu",
                                "FriendlyName": "Ubuntu",
                                "StoreAppId": "9PDXGNCFSCZV",
                                "Amd64": true,
                                "Arm64": true,
                     ...
RawContent        : HTTP/1.1 200 OK
                    Connection: keep-alive
                    Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
                    Strict-Transport-Security: max-age=31536000
                    X-Content-Type-Options: nosniff
                    ...
Forms             : {}
Headers           : {[Connection, keep-alive], [Content-Security-Policy, default-src 'none'; style-src 'unsafe-inline'; sandbox], [Strict-Transport-Security, max-age=31536000], [X-Content-Type-Options,
                    nosniff]...}
Images            : {}
InputFields       : {}
Links             : {}
ParsedHtml        : mshtml.HTMLDocumentClass
RawContentLength  : 6271

> (Invoke-WebRequest https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json).Content | jq '.Distributions[] | select(.Name==\"Ubuntu\")'
{
  "Name": "Ubuntu",
  "FriendlyName": "Ubuntu",
  "StoreAppId": "9PDXGNCFSCZV",
  "Amd64": true,
  "Arm64": true,
  "Amd64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu2204-220117.appx",
  "Arm64PackageUrl": "https://wslstorestorage.blob.core.windows.net/wslblob/Ubuntu2204-220117_ARM64.appx",
  "PackageFamilyName": "CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc"
}

> wsl --install -d ubuntu
Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established
Error code: Wsl/InstallDistro/WININET_E_CANNOT_CONNECT

> wsl -l -o
Failed to fetch the list distribution from 'https://raw.githubusercontent.com/microsoft/WSL/master/distributions/DistributionInfo.json'. A connection with the server could not be established
Error code: Wsl/WININET_E_CANNOT_CONNECT

DNS seems to be working. Invoke-Webrequest can fetch the data. Browsers can load the URL. wsl can't. Why is wsl not able to reach it but other things can?

@imjosh
Copy link

imjosh commented Sep 13, 2024

The solution for me was to uncheck IPV6 under my wifi adapter settings. You should re-check once you've done what you need to.
image

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests