简体   繁体   中英

Laravel Sail on WSL2 - Wrong Permissions

I'm trying to run Laravel Jetstream with Sail on WSL2 (Ubuntu 20.04) and Docker.
So far I could use composer to install Laravel.

When I enter CLI mode to use "php artisan" commands this works fine.
As soon as I try to edit the files in Visual Studio Code with "code."in the Project folder in the WSL2 Terminal, I got user and permission errors. User is set to "root" and file permissions to 644

Temporary fix is using:

sudo chown -R marek:marek *  
sudo chmod -R 655 * 

in the WSL2 Terminal to set the user-owner and edit the permissions to be able to use Visual Studio Code on my files. I would need to do it every time on every new file or files created my the docker cli and php artisan commands.

I also tried to create wsl.conf in /etc with:

[automount]
enabled = true
options = "metadata"
mountFsTab = false
default=marek  

Any solutions to this problem?

your wsl.conf is wrong, I guess. Try this:

[automount]
enabled = true
options = "metadata"
mountFsTab = false

[user]
default=marek  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM