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

Live Server not working in WSL 2 #53

Open
pabloherrero1986 opened this issue Oct 5, 2020 · 5 comments
Open

Live Server not working in WSL 2 #53

pabloherrero1986 opened this issue Oct 5, 2020 · 5 comments

Comments

@pabloherrero1986
Copy link

pabloherrero1986 commented Oct 5, 2020

Live Server does not work in WSL 2. When I click on "Go Live", the browser does not open. If I access through the browser by entering the address http://127.0.0.1:5500/, it doesn't open either.

Under Windows 10 without WSL2, clicking on "Go Live" automatically opens the browser.

Is there a way to fix it?

@Alpaca92
Copy link

I'm going through the same error, did anyone solve it?

@pabloherrero1986
Copy link
Author

No :(

@Noxdor
Copy link

Noxdor commented Jun 6, 2021

It was working for me just find and then today I had the same problem as you guys. So I did what fixes actually most of the problems, I restarted my device. Now it works again, crazy! Maybe you guys are trying it too after having your device in sleep/stand-by for a longer time?

Furthermore, while it didn't work to connect to the live-server through my Windows browser, it did by connecting it through an XServer. I have one installed in Windows and after I started it, the live-server started in VS Code in WSL automatically opened the browser window in the installed browser in my WSL. (Whenever I say WSL I mean WSL2 of course)

Anyhow, after a restart of my device I could connect again without any problems to the live-server through my Windows browser, both with localhost:xxxx and 127.0.0.1:xxxx

Hope I could help and it fixes the problem for you too.

@zaher-aa
Copy link

zaher-aa commented Nov 6, 2021

Live Server does not work in WSL 2. When I click on "Go Live", the browser does not open. If I access through the browser by entering the address http://127.0.0.1:5500/, it doesn't open either.

Under Windows 10 without WSL2, clicking on "Go Live" automatically opens the browser.

Is there a way to fix it?

Same problem bro, but when I copy the address http://127.0.0.1:5500/, it works fine.

@azifnazar
Copy link

This can be achieved using the wslview utility and setting the $BROWSER environment variable to 'BROWSER=wslview'. wslview is a WSL browser emulator that can help you open links in the default Windows browser or open files on Windows from WSL.

The utility is pre-installed by default when using the latest Ubuntu releases on WSL but can also be added/updated on other Linux distros by installing wslu which provides a collection of utilities for Windows 10 Linux Subsystem.

Refer to the Github repository at wslu - A collection of utilities for WSL for the installation instructions applicable to your WSL Linux environment.
checked and working well, source:
https://support.cloud.engineyard.com/hc/en-us/articles/4405614113691-Setting-the-default-browser-when-using-EYK-CLI-on-WSL#:~:text=In%20order%20for%20the%20authentication%20process%20to%20succeed%2C,browser%20or%20open%20files%20on%20Windows%20from%20WSL.

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

No branches or pull requests

5 participants