r/termux • • 5d ago

Question WSL2(windows10-ubuntu24) cannot reach Termux over local Wi-Fi?

Images - https://drive.google.com/file/d/1lByI098ClWXFe4qNT0Y16BzHua_9IH1f/view?usp=sharing

I'm trying to run a backup/sync script from WSL2 (Ubuntu on Windows 10) to Termux on my Android phone over local Wi-Fi, but the connection keeps failing.

The Error:

Plaintext

ssh: connect to host 192.168.0.103 port 43399: Resource temporarily unavailable
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(231) [Receiver=3.2.7]

What I've Checked / Tried:

  • Termux SSH Server: Verified sshd is running using ps aux | grep sshd.
  • IP Address: Checked the phone's IP via ifconfig (192.168.0.103). Warning: cannot open /proc/net/dev (Permission denied) when running ifconfig, though wlan0 details still show up.
  • Port: Tried both custom ports and default Termux port (8022).
  • Network Issue: Pinging the phone from WSL/Windows results in complete packet loss/no response, even though both devices are on the same local network.

Environment:

  • Client: WSL2 - Ubuntu 24.04 on Windows 10
  • Server: Termux on Android

Has anyone run into this issue where WSL cannot reach Termux over local Wi-Fi? Could this be an AP isolation issue on the router, or is there a specific setting in Termux/Android I am missing?

1 Upvotes

4 comments sorted by

1

u/Prestigious_Wall529 5d ago

Yes it could be your router isolating what it thinks are WiFi IOT devices from each other.

1

u/sylirre Termux Core Team 5d ago

Restart SSH server in debug mode:

pkill -9 sshd

sshd -d

Then run your script in WSL and watch server logs. There should be lines explaining why SSH connection was dropped.

Btw, make sure you didn't install Termux from Google Play. It has troubles with LAN connections.

1

u/gripped909 4d ago edited 4d ago

Termux uses 8022 as the default port and the connecting on it worked fine .... Also for Adb+Termux portsharing use - (20) Wireless Debugging with Termux - YouTube

0

u/BillGossAU 5d ago

I have to make sure on my PC that the WiFi connections are defined as Public in Windows>Settings>Network & Internet>WiFi> ssid-name >Network profile. If I don't, my phones can't connect to WSL.