[WSL - next] provide a way to attach custom disks
Nobody has claimed this yet.
- 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.
Today, it is quite difficult to mount additional disks or iso files in a WSL distro. Underlying Hcs infrastructure allows to attach additional vhds and iso files. Docker-Desktop creates a "docker-desktop-data" distro just to have a separate data disk (that we keep even when we need to update the docker-desktop distro), and we copy iso files to mount them as block devices where we could just attach them to the utility VM (avoiding the extra copy).
Describe the solution you'd like
I see 3 solutions for this:
wsl -d DistroName --attach-[vhd|iso] <path to vhd|iso> /dev/my-disk: an imperative function that would allow to mount things while wsl is running- within a distros
/etc/wsl.conf:
[devices]
/dev/mydisk=<path to vhd|iso>;type=<iso|vhd>[;options=<ro|rw>]
- within windows side
~/.wslconfigsomething similar, applying to all distros
Note: it could also apply to other kind of devices for USB/GPU pass-through etc.
Describe alternatives you've considered
Current alternative for us, is to use extra distros + cross distro mounts to attach vhd. Iso files require us to copy the ISO within the linux file system and mount them as block device (the copy is there to improve filesystem performance)
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
The issue names no implementation files, tests, or entry points. Start by reviewing the WSL/Hcs attachment capabilities and comparing the three proposed CLI and configuration approaches. Done would require a decided scope and an agreed way to attach VHD/ISO devices; the issue does not define acceptance tests.
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
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100