Where are config files located in WSL?
I found my etc
folder in:
C:\Users\USER\AppData\Local\Packages\CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc\LocalState\rootfs\etc
Note: I'm using WSL1 so as to be able to use VMware. WSL2 uses Hyper-V which is incompatible with other virtualization hypervisors. (Edit: This is no longer true.)
However, this is changing now and in the near future. Recently both VirtualBox and VMware have released versions that support Hyper-V and WSL2. You can learn more about it for VirtualBox and VMware. The VMware solution requires the soon to be released Windows 10 Build 20H1, while VirtualBox is possibly usable now.
This next version of Windows is also advertised as allowing greater integration between Windows and WSL, perhaps even solving the problem of concurrent updates of the same files from both subsystems.
Warning: do not edit WSL files on disk from Windows.
The files stored on disk in %LocalAppData%\Packages
use special NTFS features to implement POSIX functionality/metadata (eg Linux permissions). Using standard Windows tools/apps to edit these files will corrupt your Linux environment.
Instead, WSL provides a mount that allows you to safely access and edit files inside your Linux environment. It is available under \\wsl$\
.
See Do Not Change Linux Files Using Windows Apps and Tools