microsoft / microsoft/WSL

Windows/WSL AF_UNIX Interop doesn't work in WSL2

Open
#5,961 9 comments 39 reactions 0 assignees View on GitHub

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

  1. Launch Ubuntu 18.04 in WSL2.
  2. Run python3 -c "import socket; sock = socket.socket(socket.AF_UNIX); sock.bind('/mnt/d/test.sock')"

python_unix_socket.strace.txt

WSL logs:
https://aka.ms/AA9q0yn

Expected behavior

As In WSL1, I expect no error and the D:\test.sock file created:

image

Actual behavior

Error and no file created:

image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.