I am unable make file or directory in Visual Studio Code in Win Subsystem for Linux

Viewed 23492

I use this guide. When I take the step "Add a source code file", I am shown this report:

Unable to write file 'vscode-remote://wsl+ubuntu-20.04/home/alex/TEST/helloworld/helloworld' (NoPermissions (FileSystemError): Error: EACCES: permission denied, open '/home/alex/TEST/helloworld/helloworld')

I don't know what to do, can some one help me?

2 Answers

The VScode needs permissions thus

Try this command on your WSL terminal

sudo chown -R username /path/to/working/directory

Replace :

'username' with your username and the path of your directory

So I had the same problem and changing ownership via sudo chown -R username <path> did not work for me.

Simple solution! My issue: Downloaded files for coursera project in zip. Copied files to ubuntu home/taylor/projects folder. and then tried accessing in vscode with code . I received the read error.

Solution:

  1. go to your linux terminal.
  2. Access the folder containing the files you are trying to work on. For Example: app.py forms.py models.py in the projects folder. got to projects folder.
  3. ~/projects ls app.py forms.py moodels.py routes.py #they should be white meaning know permissions granted.
  1. grant permissions

a. sudo chmod 777 app.py forms.py models.py routes.py or
b. sudo chmod +rwx app.py forms.py models.py routes.py #r=read w=write x=execute

Related