New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
changes made in Windows File System - not seen in Bash #51
Comments
Having a difficult time reproing this one. Just tried:
The content looked to show up correctly. Any chance you can give a bit more on the repro steps? Note that we know there are some issues here if you go into your lxss directory and add files to your home dir. In this case it's possible to add directories or files that do not show up in Bash. I'll need to add those cases to the FAQ. |
Just wanted to say "me too" here, my steps were:
|
@okuoku your scenario is a bit different. We do not support modifications to files in the lxss folder outside the WSL environment. |
The basic Cygwin vs. UoW issue turns out to be that when Cygwin "mounts" (internally) any portion in "acl" mode, which is on by default, a file created under Cygwin has an ACE that denies all access to the NULL SID. This apparently makes UoW utterly unable to read it. If you change the Cygwin mounts to "noacl", the problem is fixed for the future, but all files already created in Cygwin remain inaccessible. This has nothing to do with writing to the lxss folder. |
To reset the problematic ACLs to something UoW can handle, cd in Cygwin or command.exe to a directory containing your Cygwin files, and execute "icacls . /reset /t /c /l /q". This is rather slow, but will fix all existing files. To make sure there are no problems in future, edit the final line in the /etc/fstab file in Cygwin to say: none /cygdrive cygdrive binary,noacl,posix=0,user 0 0 Shut down all Cygwin processes; this will take effect when you start them again. For 64-bit Cygwin, change the last line from cygwin to cygwin64. |
does resetting the ACLs also fix the problem I reported?? |
No, because as mentioned above you are trying to do something unsupported: mess around in the lxss directory on the Win32 side. Everything you want to share between UoW and Win32 should be done in /mnt/c space; you can make symlinks on the UoW side to make things look more natural. |
Thanks @johnwcowan, that is correct. Closing this issue out. |
I am still seeing this issue without cygwin being involved. Step 1: Create an empty text file at Certainly this sort of behavior should be properly supported, right? |
@jmenashe -- no, this behavior is explicitly not supported. Access to VolFS (anything underneath Microsoft's stated reason for this is that most Windows applications don't understand Linux-style metadata and so tend to corrupt the state associated with files, as you're seeing here. I personally agree that simple cases like this could be made to work better. But note that WSL does some additional file buffering for performance that it's unclear that Windows would know about (so Windows apps might not see complete file contents); WSL is going to support things like inotify which tracks when Linux files are edited, whose semantics become clouded when systems other than Linux edit files; etc. If you want to share files, you can do so from |
I have the same issue. |
Thanks benhillis. By the way, a quick way around- I created a file xxx.md using bash, then in Atom editor, I copy & pasted from the file (say, yyy.md) I created from Windows. It seems that modification of files (at least .md) are saved using a Windows app (I only tested in Atom- don't know about other apps) properly. I was able to view the file and git push (in bash) the new changes made through Windows Atom. |
As long as you aren't modifying files that are under %localappdata%\lxss you'll be fine. Our guidance is if you will be accessing files from both WSL and Windows processes, to work somewhere out your DrvFs mounts (/mnt/c). |
Editing files in Linux |
I see. Thanks for the explanation. Seems I was lucky that it was modifying in place, not replacing. |
Well that sucks... because I cannot use VSCode from bash to edit things that I checkout using git. |
@kenchris: Cygwin is your friend if that's how you want to do things. UoW is for pure-Linux operations, Cygwin is for hybrid operations. |
@kenchris You can also checkout to a /mnt/ DrvFs location that will allow you to interop with Windows programs |
I somehow got undeleteable file in wsl folder |
There are a couple of reasons why the file appears uneletable. It could be that the file is in use - a reboot might help that. The other is ACL. From the WIndows side, you can try to look at the file's ACL using the GUI, taking ownership if needed and updating the ACL so you can delete it |
From my personal experience, I recommend putting your code folder directly inside WSL. Currently, WSL 2 does not detect windows file updates when a command is running. File watchers like Chokidar do not work in WSL 2. Plus, all operations - git commit, git push, git diff, localhost serving, etc. - are all significantly faster when the files are stored in WSL instead of being mounted from Windows. I hope future WSL releases fix the issues of file system sync. |
this really should be properly fixed. it really is an awful experience as is. |
I created a new folder on an external harddrive called "backup". Q:\backup in WSL2 if i run the command the backup folder is not listed. everything else that is in the q:\ directory is listed though. |
If I create a folder /mnt/c/foo in Bash, I can see that folder in Windows. If I create a file in that folder, say /mnt/c/foo/foo.txt - I can see it in Windows. BUt if I change it, the changes are not seen in Bash. ANd if I create a file c:\foo\foo2.txt - I can't see it in Bash.
The text was updated successfully, but these errors were encountered: