bradwilson,
@bradwilson@mastodon.social avatar

Found my first issue with using a Dev Drive, and wanting to have access to it from WSL: apparently the way Dev Drives mount in Windows is not compatible with the WSL auto-mounting.

Why does this matter? Docker Desktop (in WSL 2 mode) can't mount a Dev Drive folder.

Do I dump WSL 2 mode for Docker? Or do I dump Dev Drive? Tough choice, but I suspect I dump the Dev Drive.

In WSL 2, /mnt/c/Dev gets an I/O error because "cannot read symbolic link".
Trying to mount C:\Dev on Docker in Windows (running in WSL 2 mode) claims it can't create /run/desktop/mnt/host/c/Dev because the file exists (but in reality, the error is that it can't read that folder from WSL).

jakecarpenter,
@jakecarpenter@hachyderm.io avatar

@bradwilson wish WSL wasn’t still full of trade offs. I don’t regret switching to macOS for development.

bradwilson,
@bradwilson@mastodon.social avatar

@jakecarpenter No full Visual Studio == no Brad

(Don't bother recommending alternatives; there aren't any for someone who needs to build and test Visual Studio extensions.)

heaths,
@heaths@fosstodon.org avatar

@bradwilson Both are underpinned by dynamic VHDX files last I checked, so the impact of storage should make little difference. In fact, WSL2 runs in containers by default. Probably a wash, then.

bradwilson,
@bradwilson@mastodon.social avatar

@heaths I don't understand what you're saying.

At the end of the day, I'm trying to run Docker mounting a folder under my C:\Dev folder (which is a mounted Dev Drive). What does VHDX or containers have to do with that?

heaths,
@heaths@fosstodon.org avatar

@bradwilson I was pointing out that the performance of one over the other should be negligible i.e., there's no practical cost to switching, it would seem...assuming you don't need access to nearly all hardware resource WSL2 can see. Vanilla Docker can see most anyway.

bradwilson,
@bradwilson@mastodon.social avatar

@heaths The build times with Dev Drives is definitely faster, but not so much faster that it actually matters. The easiest path seems to be to just dump Dev Drive.

bradwilson,
@bradwilson@mastodon.social avatar

I can verify that if your Dev Drive is mounted as a drive instead of as a sub-folder, then Docker can do its thing just fine.

bradwilson,
@bradwilson@mastodon.social avatar

Okay, final piece of the puzzle.

If I use a Dev Drive mounted as a drive letter, then use MKLINK /J to make a junction point from my desired local location to the Dev Drive, that's something WSL 2 does understand, and transparently translates that to a symbolic link in Linux terms. So it's really just using Disk Manager to mount it directly into the file system that's the problem.

So I can keep my Dev Drive and get Docker to volume mount things for me again! 🎉

Screen shot showing C:\Dev is now a junction rather than a raw filesystem mount, and Docker in WSL 2 mode does not have any problem mounting it now.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • windows
  • tester
  • DreamBathrooms
  • khanakhh
  • ngwrru68w68
  • Youngstown
  • magazineikmin
  • mdbf
  • slotface
  • thenastyranch
  • rosin
  • kavyap
  • tacticalgear
  • GTA5RPClips
  • osvaldo12
  • JUstTest
  • cubers
  • ethstaker
  • everett
  • Durango
  • InstantRegret
  • normalnudes
  • Leos
  • modclub
  • anitta
  • cisconetworking
  • megavids
  • provamag3
  • lostlight
  • All magazines