question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"This site can't be reached" using Windows 10 and WSL2

See original GitHub issue

I’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

  1. Create new folder.
  2. Add new index.html
  3. Click “Go live!”
  4. 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

14reactions
einarperssoncommented, May 4, 2020

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?

0reactions
uverprocommented, Mar 31, 2021

I ran powershell as admin and ran “wsl --shutdown” and it worked for me once. But then it stopped working.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found