Skip to content
Advertisement

How to grant permissions to VS Code to modify files in Windows Subsystem for Linux [closed]

I connected VS Code to WSL and when I try to save changes in my index.php file the following message shows up.

enter image description here

I tried to change the permissions on var/www/html using chmod but nothing changed.

So how to make VS code modify the file?

Advertisement

Answer

Even I faced the same issue on my linux system, following command solved it:

  • Go to that directory from terminal.
  • Write sudo chown -R <username>:<group> <directory_name>. This command will change ownership (both user and group) of all files and directories inside of directory and directory itself.

To know the username write whoami in terminal.

To know the group write groups in terminal (The first name in the list is your group name) for me both username and groupname was same.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement