Watch the video:
The issue
Hosting programs under wsl only allows access on your local computer. In order to allow access from outside your local network or computer, you need to port forward WSL from within your computer.
How to pull forward Ubuntu WSL?
The step should be the same for most Debian based operating systems under wsl. All you need to do is run this command under Windows and change out the ports when necessary.
Open Powershell or command prompt as administrator and run the following swapping out 2000 for whenever port you’d like to use.
|
|
In order to remove this port-forward forward later on, you can use the following command to delete it once again swapped to 2000 for whatever port.
|
|
If you’d like to note ports that you currently have for ones you can run the following command in Windows Edge should tell you what is currently forwarded.
|
|
What is 0.0.0.0?
4x 0’s allows any network interface to access this service on your computer. Using 127.0.0.1 means that only other services running on your computer should be able to access whatever you’re trying to port forward.
This is a super simplified way of explaining it, but having it set is 4 zeros is probably what you’re looking for.
Forwarding different ports
If for some reason you’re already using port 2000 you can change the listen port in the first command, and it’ll change what your computer listens for. The connect port is the one towards WSL.
Why?
This is the great option if you’d like to run this stable diffusion or other language models, etc, under WSL. This is the great way to get around it.