Zend certified PHP/Magento developer

What’s the best way to access my networked Linux home directory inside WSL?

I have a lot of Linux infrastructure running in my homelab. User home directories live on a dedicated NAS VM that exports them over NFS and SMB. I’d like to share that same home directory with my WSL, but all of the options seem to suck a little in one way or another.

WSL 1:

WSL 1 apparently does not have CIFS or NFS in its custom kernel, so they can’t be used at all. I’ve done a lot of searching, and as far as I can tell, there’s no solution for this aside from “switch to WSL 2”. You can use drvfs, however, to mount a shared folder from Windows into a WSL distro. Unfortunately, when you do that for your home directory horrible problems ensue. I’ve tried both mapping the network drive and just using the share directly. There’s also annoying permission issues like all files being set to 0744 which means ssh won’t use my keys.

WSL 2:

WSL 2 has a real Linux kernel! Yay! Except it runs as a (managed) VM. Boo! Ok it’s not really that bad, except that the VM is ephemeral and gets destroyed/recreated on reboots. This really only matters because the virtual NIC gets a random IP address in a random range, rather than using the host IP. You can change it, but then you have to do it on every boot. I did find a Powershell script that I could run on startup to potentially address this, though.

Am I missing anything? Are there any easier ways to deal with this? I use WSL/Windows Terminal pretty much daily to ssh into my Linux infrastructure and to play around with various git repos (I open the files via mapped network drive in Windows then debug/run in WSL).