How to access domain url inside WSL
I use WSL (Windows Subsystem for Linux) for my application development.
When I run my application inside WSL, I can access it from the Windows browser using:
http://localhost:4000
This works perfectly without any issues.
However, when I try to open the domain-based URL like:
http://abc.localtest.me:4000
it does not open in the Windows browser.
How I Solved This
To fix this issue, I decided to install and run Firefox directly inside WSL.
Since I’m using Windows 11 with WSLg enabled, GUI applications from WSL can open directly on the Windows desktop without any extra configuration.
Step 1: Install Firefox in WSL
Open your WSL terminal (Ubuntu or any other distro you’re using) and run:
sudo apt update
sudo apt install firefox -y
Step 2: Launch Firefox
After installation, simply run:
firefox
Now you can see the firefox will open with linux icon
Comments
Post a Comment