3

I am trying to copy files from WSL2 Ubuntu 18.04 to Windows v21H1 using path \\wsl$\Ubuntu-18-04 so I can create a boot disk for a Yocto project I am working on, and can see, access, and navigate to the WSL files in Explorer. I can copy files no problem, but when trying to paste them into a Windows directory, I get:

Error 0x80070781: The name of the file cannot be resolved by the system.
  • I have searched a lot, but only found examples of errors going from Windows to WSL
  • I have reinstalled Windows and WSL, but am still the same error
  • I can copy and paste from WSL to Windows directories within WSL using the mnt process, but the files seem to be corrupted
  • I have done a clean install of Windows 10 and also upgraded to Windows 11
  • I have tried exactly the same copy and paste procedure within Windows Explorer and this time got the following error message:
Error 0x80004005: Unspecified error''
  • I have also tried to use mv and cp within WSL and got the following error:
mv: preserving times for '/mnt/c/Users/olive/Documents/b2qt-embedded-qt5-image-imx8mm-var-dart.wic': Operation not permitted
  • I can copy and paste other files from adjacent directories in WSL to Windows with no issue. It seems to be something related to these Yocto image files. THERE MUST BE SOMETHING TO THIS!!!! However, until WSL supports removable USB SD card readers (or USB devices at all) then I need to copy these files to Windows to be able to create an SD boot disc.
  • I have google drive set up on my computer (two set up, one for personal account another for business). Is there any change it could be causing issues? The google drive folder show up as mounted drives.
  • I have checked file permissions and they are all read/write/exe.
  • Have raised this on the WSL git thread https://github.com/microsoft/WSL/issues/7683

Proposed solutions that have been tried (all suggestions greatly appreciated):

  1. The proposed solution to review a previous post is helpful to work out how it should be working (I have already learned how to use Explorer for WSL), however something is preventing me from copying some files to a Windows folder and is not addressed in the suggested post.

  2. I tried to create the WLS.conf file with associated content and this did not solve the issue.

  3. to my knowledge none of the files or folders are junction points.

  4. I cleared everything I could from the temp folder (couldn't delete things that were in use) and again this didn't solve the issue. The temp folder isn't compressed either.

SOLTUION!!!: I haven't solved the issue but I have found a work around. As mention, I was ultimately trying to cerate a boot disk using a USBc external card reader. I tried this on win32 and rufus with no luck. They weren't allowing me to select the file from WSL and as you know I couldn't copy the file to put it in a windows directory. I recently came across Etcher. It worked a treat!!! I still don't know why I couldn't copy and past the files but I have a work around for my desired purpose.

Thank you all for your help.

3 Answers3

0

A few things to try that won't fit in comments:

  • WSL permission errors when dealing with the Windows filesystem are sometimes resolved by adding the metadata option to the mount. To do this, create (via sudo) /etc/wsl.conf with the following:

    [automount]
    options = "metadata,umask=22,fmask=11"
    

    The metadata option allows WSL to set (or at least "pretend" to set) permissions on Windows files. The umask/fmask set the default permissions that WSL will see for files/directories on the Windows filesystem.

  • Per this Github issue, the error can be caused if there is a Windows junction point in play. That particular thread is about an issue installing WSL, where the lxss folder was a junction point. There is also a comment from someone who had this issue with Windows Media Player. So it seems to be a potentially "general" issue.

    Is there any chance that any of the directories in the file path are junction points?

  • Also, some Googling says that the 0x80004005 error that you are seeing after reinstalling on Windows 11 can be caused by %temp% directory issues. Two things that I can think of to try there:

    • Delete all files in your %temp% directory.
    • Make sure your %temp% directory is not compressed or encrypted. This is known to cause issues with WSL networking. While I've never seen it manifest in this particular way, it would be possible since the WSL/Windows file integration is done via pseudo-network share (Plan9 filesystem protocol).
NotTheDr01ds
  • 28,025
0

I used Etcher to create a boot disk that was able to select the file from with WSL. I was super simple to use. I haven't solved the copy and paste issue but I have found a workaround.

0

I encountered the same error codes (Error 0x80070781) when attempting to copy folders and files from WSL-2 directories to local windows directories or USB disks using "rsync -av" (errors such as /{Dirs/{copied files} failed: operation not permitted). After changing permissions using chmod (e.g., chmod -R 777), I had no luck; the issue persisted. However, simply adding sudo as "sudo rsync -av" resolved the errors. I'm sharing this information here for others who may experience similar issues.

7-x
  • 1