microsoft / microsoft/WSL

Automount vhdx disk images via [automount] settings .wslconfig , wsl.conf

Open
#11,187 9 comments 48 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

There is a need to easily automount vhdx virtual disk images in WSL2 every time WSL2 is booted.
Now vhdx can be easily mounted in a WSL2 distro, but only after WSL2 has started and it required to be re-mounted every time WSL2 is rebooted.
Various automation scripts and hacks exist to achieve that, but they are not 100% reliable and not elegant.

The proposed solution is to add the ability to mount a vhdx by specifying the image alongside with the mount options in the [automount] section of .wslconfig, wsl.conf every time the WSL2 is booted.

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

No source file or test is named. Start by tracing how the [automount] settings in .wslconfig and wsl.conf are parsed, then compare that with the existing WSL2 VHDX mounting path. Done means a defined, reliable boot-time VHDX mount behavior with mount options represented in those configuration sections.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.