PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Written By

Access windows localhost from wsl2

By default wsl2 enables wsl localhost to be accessible from windows but not vice versa. To able to access you need to use windows system IP from wsl2. Running below command gives us Network Interface (WSL) IP.

vim /etc/resolv.conf
nameserver 172.20.144.1

or

grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'

We can use this IP to access windows localhost.

Enabling ports:

Windows firewall may disable some ports by default. You need to enable ports to be able to access them from wsl2.

  1. Launch Windows Defender Firewall with Advanced Security
  2. On the left pane select Incoming Rules.
  3. On the right pane click on New Rule.
  4. For the rule type select Port. Next.
  5. Select TCP and Specific local ports. Insert the port, a comma-separated list of ports, or a port range. Next.
  6. Select Allow connection. Next.
  7. Check only the Public profile. Next.
  8. Enter a name for the rule. e.g. WSL. Done

Comments (1)

loading comments