microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.48k stars 822 forks source link

rmate not working on WSL 2 but works on WSL 1 #5422

Closed kneelesh48 closed 4 years ago

kneelesh48 commented 4 years ago

Environment

Windows build number: 10.0.19041.0
Your Distribution version: 20.04
Whether the issue is on WSL 2 and/or WSL 1: WSL 2

Steps to reproduce

  1. Install rmate curl -Lo ~/bin/rmate https://raw.githubusercontent.com/textmate/rmate/master/bin/rmate chmod a+x ~/bin/rmate

  2. Configure sublime text to receive on port 52698 (by instaling RemoteSubl package)

  3. Open a file with rmate rmate file.txt

Note: Although rmate is usually used to open text files via ssh, it can be used to open local files as well. And this works perfectly well on WSL 1.

Expected behavior

File open in Sublime Text installed in Windows

Actual behavior

I'm getting this error: /usr/local/bin/rmate: connect: Connection refused /usr/local/bin/rmate: line 410: /dev/tcp/localhost/52698: Connection refused Unable to connect to TextMate on localhost:52698

therealkenc commented 4 years ago

Configure sublime text to receive on port 52698 (by instaling RemoteSubl package)

Those steps aren't on planet repro, but even with a repro this would land /dupe #4619. On WSL2, to communicate in the WSL->Windows direction you need to use the IP address of WSL2's default gateway (colloquially people use the address in /etc/resolv.conf). The receiving end also needs to be listening on the right subnet (0.0.0.0 being a common answer). More here. How to go about configuring sublime and/or rmate is best answered in a forum related to those products.

ghost commented 4 years ago

Hi! We've identified this issue as a duplicate of another one that already exists in this repository. This specific instance is being closed in favor of tracking the concern over on the referenced thread.

Thanks for your report!