microsoft / microsoft/WSL

Automount drives to Linux side when connected to host

Open
#9,779 0 comments 0 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.**
Currently, when a fixed disk is connected to the host or a previously attached drive is removed and then later reconnected, WSL will not reflect this change. New drives will not have their drive letter reflected into the /mnt folder and previously connected drives will fail with No Such Device any time a action is attempted

**Describe the solution you'd like**
When a drive is connected, its mountpoint should be automatically picked up and reflected into WSL through its mountpoint. New drives should gain a new mnt folder and old drives should have their mnt folder reconnected to the underlying filesystem

**Describe alternatives you've considered**
Manually shutting down and restarting WSL, but its really annoying, especially if I am in the middle of anything on it. Most people are not intimately familiar with the partition layout of their drives so using wsl mount with a PHYSICALDRIVE mapping is kind of sidestepping the issue imo

**Additional context**
Drive that was previously connected when WSL started up but was since removed and reconnected not getting its connections properly reestablished
![image](https://user-images.githubusercontent.com/1053504/224558119-374824de-6c1d-4365-9c2a-2896fec678ff.png)

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 drive connect, removal, and reconnection behavior described in the issue, then trace the existing WSL automount and mount handling. Done means newly connected drives appear under /mnt and previously connected drives reconnect without requiring a WSL shutdown.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.