Skip to content

Instantly share code, notes, and snippets.

View nivranaitsirhc's full-sized avatar
💭
I may be slow to respond.

Christian Arvin nivranaitsirhc

💭
I may be slow to respond.
View GitHub Profile
@nivranaitsirhc
nivranaitsirhc / winhost.md
Last active January 10, 2024 14:39
WSL2 ~ WINHOST (windows localhost from WSL)

Update: September 19, 2023 - A New Experimental Feature was added

A new experimental feature was added by Microsoft that will resolve this issue in the future. You will need to update to Windows Insider Build for Windows 10 or latest Windows 11 and update WSL. More info here.

The WSL2 localhost issue?

On WSL1 we can access windows services running on localhost ports directly, but when WSL2 was introduced things started breaking. One of those issue is access to windows localhost ports [^1]

To understand this issue we need to learn what is WSL2:

  • WSL2 is a Managed Virtual Machine Running on Windows contrary to WSL1.
  • Windows implements a virtual NIC for WSL2 thus the distro's host ip is different from the Windows host ip. [^2]
@nivranaitsirhc
nivranaitsirhc / portable_app_wrapper_caller.cmd
Last active April 4, 2023 06:54
A batch script wrapper for portable apps or applications.
@echo off
REM ---------------------------------------------------------------
REM Batch Script Wrapper Caller for Portable Apps or Scripts (cmd)
REM ---------------------------------------------------------------
REM Author : cacc@greenleaflabworks | Christian Arvin C. Cabo
REM Date : 2023-01-07
REM Paypal : @caccabo
REM GCash : 09276311928
REM This is a wrapper for portable apps that updates to the same directory with a different app name.