Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2815

Ubuntu 20.04 on WSL2: Folder owner & group are being reset after each start

$
0
0

Well, I have a WSL2 with Ubuntu 20.04.3 LTS on it. It is intended for web-development purposes, so nginx, php and other related apps are installed there. No GUI.

So when I start it with wsl from Windows PowerShell, I always have to go to the project root and set correct folder permissions:

sudo chown -R $USER:www-data /var/www/html/project_root/all_required_folders

It works fine until I restart WSL, then after boot, permissions are being reset back and I have to set them once again.

I know that I can add these commands to run after boot, but I am curious about the reason, because I did not experienced this before (unless I moved to clean system from HDD to SSD, but I don't think this might be the reason).

Honestly, I don't think this issue comes from nginx, I guess somewhere esle?

Have to note, that not all folder group is being reset, only some of them, somehow. And these are usually /node_modules, /storage and /bootstrap (Yes, I'm running Laravel).

So, why this happens? It does not reset folder permissions - only owner & group.


Viewing all articles
Browse latest Browse all 2815