how to move workspace(a simple project) from windows file system (/mnt/) to linux (~/home)

Viewed 6495

I am developing a Django project (nothing) and trying to use using WSL2.

so if I use the Ubuntu Terminal from Windows to create a project and try running it in VScode, I got this little message,

enter image description here

I just don't know how to do that at all,

it's the first time I tried to use WSL2 (which is awesome), if someone could help, thank you very much.

1 Answers

If you have your project in some mounted folder -> linux path starting with /mnt/ e.g. /mnt/c/Users/rasto/Desktop/some_folder/my_project/

When you open VS Code in this directory (via running command code . or opening the VS Code from windows) you get the warning:

This workspace is on the Windows file system (/mnt/). For best performance, we recommend moving the workspace to the Linux file system (~/home).

The solution is easy -> move/copy the project folder to ~/my_project/ directory:

In WSL terminal:

Recursively copy all files from source-path to destination-path and if the folder ~/my_project/ does not exists, it will be created

 cp -R /mnt/c/Users/rasto/Desktop/some_folder/my_project/ ~/my_project

Move to the directory in your terminal

cd ~/my_project

And open VS Code from console with

code .

Note: To open VS Code from terminal you must have installe extension Remote Development extension pack

Note2: To access the linux folder from windows file explorer just right click in VS Code explorer and Reveal in explorer or with the path like: \\wsl$\Ubuntu-18.04\home\rasto\my_projects

Related