microsoft / microsoft/WSL

Support Samba server in WSL2

Open
#10,254 0 comments 26 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

Is your feature request related to a problem? Please describe.
Sometimes I want to run server software in WSL2 and make its files accessible on my network. The best way to do this is via samba/SMB.

However, the problem is that in WSL2 it's not easily possible to set this up to work. I seem to have it working well accessible from the host windows system, but this is useless because there is already plan9 file share automatically set up.

It does not work from other machines on the LAN, because of NTLM auth breaking as it's not compatible with the WSL2 NAT. Even with firewall rules and port forwards for TCP 445 and 139, as I understand it, the host Windows takes over the auth, rejecting it, and prevents the connection from being made to the WSL2 smbd. I'm able to see connection rejections under Security in the Event Viewer on the host Windows.

Describe the solution you'd like
I don't know what the solution would look like but being able to make a samba share to the WSL2 virtual disk would be very useful. I am still hopeful that there is a way to make the host windows refrain from interfering with the protocol.

Describe alternatives you've considered
I guess something like SSHFS should work since I was able to get ssh working with no problems.

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 investigating WSL2 networking and NAT behavior around SMB ports 445 and 139, including the host Windows authentication failures described in the issue. Done would be a supported way for Samba shares in the WSL2 virtual disk to be accessed from other machines on the LAN.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
networking, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.