Copy files from Windows to your WSL instance

Let’s say you want to copy or move files from a Windows drive into your WSL instance. You could use /mnt/c/path/to/file from within WSL, e.g.:

cd $HOME
mv /mnt/c/Users/youruser/Documents/project/myproject .

Another way is to access the WSL instance’s drive from the outside.

  • Navigate to \\wsl$\Ubuntu-20.04\home\your_username and drop the files there

Please note that WSL prohibits access to any root-owned files or directories through the \\wsl$\<distro> share.

  • Create a directory under root / and chown to your user:
      sudo mkdir /project
      sudo chown $USER:$USER /project
    

    You should be able to drop into that folder as well.