Hey, guys. I just solved this problem on Windows 10 + WSL2. Port redirect solves all problems.
My NAT:
- 192.168.0.5 - device ip
- 192.168.0.6 - windows ip
WSL addresses:
- 172.31.48.1 - WSL address if i type “ipconfig” in Windows
- 172.31.49.226 - WSL address if i type “ifconfig” in WSL
Look, if you don’t see your device into query_rpc_tracker list, it means that the port to which the connection is being made is closed in windows. In example this port is 9190 but i will use 9090. Oke, now open PowerShell and type
netsh interface portproxy add v4tov4 listenport=9090 listenaddress=192.168.0.6 connectport=9090 connectaddress=$($(wsl hostname -I).Trim());
You can see your connection through netsh interface portproxy show v4tov4
. Output:
Address Port Address Port
--------------- ---------- --------------- ----------
192.168.0.6 9090 172.31.49.226 9090
Start rpc_tracker on 0.0.0.0:9090 in WSL, connect your device and check query_rpc_tracker.
Address: 192.168.0.6
Port: 9090
Key: android
Most likely, this step was not necessary for those who use docker, because this port was forwarded when starting docker, if you followed the example. Now what everyone is here for. We see some strange address 172.31.48.1:5001.
Server List
------------------------------
server-address key
------------------------------
172.31.48.1:5001 server:android
------------------------------
Queue Status
-------------------------------
key total free pending
-------------------------------
android 1 1 0
-------------------------------
We learn that the server and the device communicate on port 5001. This could be discovered in other ways, but accept it as a fact. Open PowerShell again
netsh interface portproxy add v4tov4 listenport=5001 listenaddress=172.31.48.1 connectport=5001 connectaddress=192.168.0.5;
Now the redirect looks like this
Address Port Address Port
--------------- ---------- --------------- ----------
192.168.0.6 9090 172.31.49.226 9090
172.31.48.1 5001 192.168.0.5 5001
Do not forget to restart your rpc_tracker. After that, a response will be received from tracker.request
. I’m sure it’s the same in docker, just forward port 5001. Somehow. I might try to do that later. I hope I can help someone in the future, good luck.