Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADB error - No connection could be made because the target machine actively refused it. (10061) #136

Open
infinitepower18 opened this issue Nov 17, 2022 · 15 comments
Labels
bug Default bug tag for tracking needs-repro Need more details on how to reproduce the issue

Comments

@infinitepower18
Copy link

infinitepower18 commented Nov 17, 2022

Steps to reproduce

  1. Start Windows Subsystem for Android
  2. Make sure developer mode is enabled
  3. Connect using adb to the IP address shown in WSA settings

✔️ Expected Behavior

It should have connected successfully.

❌ Actual Behavior

The subsystem would randomly refuse to connect unless I reboot my PC.

image

Other Software

Android Debug Bridge version 1.0.41

Please specify the version of Windows Subsystem for Android

2210.40000.7.0

@infinitepower18 infinitepower18 added bug Default bug tag for tracking triage-needed For issues raised to be triaged and prioritized by internal Microsoft teams labels Nov 17, 2022
@infinitepower18 infinitepower18 changed the title No connection could be made because the target machine actively refused it. (10061) ADB error - No connection could be made because the target machine actively refused it. (10061) Nov 17, 2022
@hamza-usmani
Copy link
Contributor

@jaholme, @nieubank: I know we've seen this issue in the past connecting to the subsystem. If I recall correctly, this might be an adb/network issue rather than a subsystem bug.

@hamza-usmani hamza-usmani added needs-repro Need more details on how to reproduce the issue and removed triage-needed For issues raised to be triaged and prioritized by internal Microsoft teams labels Nov 21, 2022
@yume-chan
Copy link

It also happened to me. netstat -aon shows no program is listening on port 58526, shutting down and restarting WSA doesn't work. Restating the system resolves the issue.

@soroshsabz
Copy link

ITNOA

How to increase the priority of this issue?

@soroshsabz
Copy link

I restart the system, but my problem does not resolved for me :(

netstat -aon shows no program listening on port 58526

@soroshsabz
Copy link

I use the latest Windows 11 version

Edition	Windows 11 Pro
Version	22H2
Installed on	‎11/‎10/‎2022
OS build	22621.1265
Experience	Windows Feature Experience Pack 1000.22638.1000.0

rm-tools> .\adb.exe connect 127.0.0.1:58526
* daemon not running; starting now at tcp:5037
* daemon started successfully
cannot connect to 127.0.0.1:58526: No connection could be made because the target machine actively refused it. (10061)
PS C:\Users\sooro\AppData\Local\Packages\46954GamenologyMedia.WSASideloader-APKInstaller_cjpp7y4c11e3w\LocalState\platfo

@philnach
Copy link
Member

@soroshsabz, hi, can you post the output of the following command run from an Administrator command prompt:

netsh interface ipv4 show excludedportrange protocol=tcp

@soroshsabz
Copy link

@philnach Hi, I post the output as below

PS C:\Users\sooro> netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
      5357        5357
     27339       27339
     49891       49990
     50000       50059     *
     50060       50159
     50260       50359
     50360       50459
     50864       50963
     50964       51063
     51064       51163
     51164       51263
     51264       51363
     51364       51463
     51464       51563
     51564       51663
     51664       51763
     51764       51863
     51990       52089
     52090       52189
     52290       52389
     52390       52489
     54090       54189
     54190       54289
     54290       54389
     54390       54489
     54490       54589
     54590       54689
     55082       55181
     55182       55281
     55401       55500
     55501       55600
     55601       55700
     55701       55800
     55801       55900
     55901       56000
     56017       56116
     56117       56216
     56217       56316
     56317       56416
     56417       56516
     56517       56616
     56617       56716
     56717       56816
     56817       56916
     56917       57016
     57061       57160
     57264       57363
     57364       57463
     57464       57563
     57564       57663
     57664       57763
     57764       57863
     57864       57963
     57964       58063
     58064       58163
     58465       58564
     58565       58664
     58713       58812
     58813       58912
     58913       59012
     59013       59112
     59113       59212
     59213       59312
     59313       59412
     59413       59512
     59513       59612
     59613       59712
     59813       59912
     60514       60613
     60614       60713
     60814       60913
     60914       61013
     61014       61113
     61312       61411
     61412       61511
     61612       61711
     61712       61811
     61812       61911
     61912       62011
     62012       62111
     62112       62211
     62212       62311
     62312       62411
     62412       62511
     62523       62622
     62623       62722
     62823       62922
     63061       63160
     63161       63260
     63261       63360
     63361       63460
     63561       63660
     63861       63960

* - Administered port exclusions.

@soroshsabz
Copy link

@bennycode
Copy link

@hamza-usmani should it work to connect to 127.0.0.1? I always had to use a local IP address starting with "192.168" to get a connection using adb.

@Darkhost1999
Copy link

The only complaint that I have is the ADB permission screen doesn't force itself to focus or to front.
So this Yes or no box pops up but it doesn't use the same type of priority as launching an application in admin mode type of screen. I have to tab over the icon on the taskbar to see that I'm being asked to grant permission.

Beyond that ADB has never not worked for me.

@viliml
Copy link

viliml commented Dec 4, 2023

This bug just happened to me. Has there been any progress on fixing it?

@bennycode
Copy link

This bug just happened to me. Has there been any progress on fixing it?

This tutorial may help you: https://www.youtube.com/watch?v=XCKNH5ymBN0

@robbely
Copy link

robbely commented Jan 24, 2024

This is a long running intermittent bug, and until it is recognized as a bug and dealt with it isn't going to go away. There are plenty of pages all over the web dealing with this, none have a working solution.

At the moment the only fix is to "keep rebooting till it works".

EDIT: in short WSA sometimes just does not present itself at 58526, and no amount of restarting WSA or changing dev settings will fix it, only a reboot of the PC.

@pstrings
Copy link

This issue is still there in 2024... any updates?

@bennycode
Copy link

This issue is still there in 2024... any updates?

Well... Microsoft will be discontinuing the Windows subsystem for Android from March 5, 2025: https://www.theverge.com/2024/3/5/24091370/microsoft-windows-11-android-apps-end-of-support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Default bug tag for tracking needs-repro Need more details on how to reproduce the issue
Projects
None yet
Development

No branches or pull requests

10 participants