"This site can't be reached" using Windows 10 and WSL2
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request
[ ] Documentation issue or request
[ ] Other: <!-- Please describe: -->
Current behavior
- Create new folder.
- Add new
index.html
- Click “Go live!”
- Chrome opens
http://127.0.0.1:5500/index.html
but I get a This site can’t be reached. 127.0.0.1 refused to connect.
Expected behavior
I expect the site to be loaded correctly.
Environment
Browser:
- [x] Chrome (desktop) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Live Server: 5.6.0
- Platform: Windows 10
- Visual Studio Code: 1.44.2
Others
WSL2 (Windows subsystem for Linux) Ubuntu 18.04 With the official WSL extension for VScode
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Local sites running in WSL2 not accessible in browser #5298
When starting a site/app locally on my computer in WSL 2 ( Ubuntu 20.04 LTS (GNU/Linux 4.19.84-microsoft-standard x86_64)), the browser won't ...
Read more >can't access 127.0.0.1:80 outside of WSL2 / Ubuntu 20.04
I'm running Ubuntu 20.04 on WSL2 / Windows 10 and running my backend(nodejs + koa) on ubuntu (localhost) and make request using postman...
Read more >Troubleshooting Windows Subsystem for Linux | Microsoft Learn
Provides detailed information about common errors and issues people run into while running Linux on the Windows Subsystem for Linux.
Read more >This site can't be reached after installing WSL2 and apache2
After digging another few hours I found the answer, update host file with such a like: 127.0.0.1 test.tld ::1 test.tld.
Read more >How-To Fix “This Site can't be Reached” in Chrome and Edge
1. - Right-click on the start menu or press Windows key + X
- Choose Command Prompt (admin) or PowerShell (admin)
- You will get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Did some more investigation. If I set
"liveServer.settings.useLocalIp": true
it works. I guess this has something to do with WSL2.Any ideas why localIp might work but not else?
I ran powershell as admin and ran “wsl --shutdown” and it worked for me once. But then it stopped working.