You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback #2071
Before creating a new issue, please check the FAQ to see if your question is answered there.
Environment data
debugpy version: 1.8.21
OS and version: Windows 11 build 26200.9106, Ubuntu 24.04 on WSL2
Python version (& distribution if applicable, e.g. Anaconda): CPython 3.14.4, installed/managed by uv
WSL version: 2.7.12.0
Using VS Code or Visual Studio: bash only
Actual behavior
debugpy.listen() consistently fails during its internal adapter bootstrap. The adapter immediately fails when connecting back to debugpy's temporary callback listener:
Sending endpoints info to debug server at localhost:<port>
ConnectionRefusedError: [Errno 111] Connection refused
This occurs before the debuggee starts and without an IDE or debugger client involved.
It occurs deterministically when either networkingMode=VirtioProxy or hostAddressLoopback=true is enabled in %UserProfile%\.wslconfig. Both settings independently trigger the problem.
Adding a time.sleep(0.2) immediately before the following line in debugpy/adapter/__main__.py works around the issue:
sock.connect((localhost, args.for_server))
Expected behavior
debugpy.listen() should start normally under WSL2 with networkingMode=VirtioProxy and/or hostAddressLoopback=true enabled.
Steps to reproduce:
In %UserProfile%\.wslconfig, enable either setting:
Activity
nightcityblade commentedon Oct 1, 2026
Hi, I'd like to work on this. I'll submit a PR shortly.