Windows/WSL AF_UNIX Interop doesn't work in WSL2
Open
Nobody has claimed this yet.
feature
- Dominant language
- C++
- Stars
- 33.7k
- Forks
- 1.8k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 116
Description
Environment
Windows build number: 10.0.19041.508
Your Distribution version: Ubuntu 18.04
Whether the issue is on WSL 2 and/or WSL 1: Regression in WSL2
Steps to reproduce
- Launch Ubuntu 18.04 in WSL2.
- Run
python3 -c "import socket; sock = socket.socket(socket.AF_UNIX); sock.bind('/mnt/d/test.sock')"
WSL logs:
https://aka.ms/AA9q0yn
Expected behavior
As In WSL1, I expect no error and the D:\test.sock file created:

Actual behavior
Error and no file created:

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented python3 AF_UNIX bind command in Ubuntu 18.04 on WSL2, then inspect the linked strace and WSL logs. The issue is done when the bind succeeds without an error and D:\test.sock is created, matching the stated WSL1 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100