🔍 See Original Answer on Ask Ubuntu 🔗
Ubuntu 20.04 on WSL2: Folder owner & group are being reset after each start
November 21, 2021
Edited: November 21, 2021
November 24, 2022
Copy to clipboard: false
From Stack Overflow:
To enable changing file owners & permissions, you need to edit
/etc/wsl.confand insert the below config options:
[automount] options = "metadata"
This may require restarting WSL (such as with
wsl --shutdown) or the
host machine to take effect. This has been possible since 2018.
Please visit the link above for the full answer plus the two other answers which you may prefer.
Also consider new method announced by Microsoft in 2018. This method goes into even more depth and involves the