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



In firefox browser you can open the domain url of WSL.


Thank you!!


Comments

Popular posts from this blog

How to enable Google Sheet in Google Cloud project

Finding Your Redis Credentials: Host, Port, and Password

Ways to install your own extension