9

If you create a file in bash (touch /root/foo.txt) that appears in the hidden directories in AppData\Local\Lxss\ modifying it there does not change it in bash. Worse if you change it again in bash the file you changed thru explorer gets clobbered!

Is there any real mount point on C:\ ?

Where's the real image hiding?? (like is the file system writing back to an image file in reality?)

0:14:29 in this https://channel9.msdn.com/Events/Build/2016/C906 seems to claim you will have full access from explorer. 0:16:30 they show you AppData\Local\Lxss\ but do not once mention that your files will not sync as I described.

  • It's sad there's no linux-binary or thing that can use the sys calls they taught the ntkernel out side of the jail (back to cygwin for that :( ) but they need to at least mount the root filesystem writable on windows C:\ when anniversary goes gold. – sabgenton Apr 10 '16 at 14:31
  • I guess there's always samba :( – sabgenton Apr 10 '16 at 14:34
  • 1
    Apparently it's not meant to be used that way. github.com/Microsoft/BashOnWindows/issues/45 – wbkang Apr 10 '16 at 23:09
  • What a crock. cosmicdan seems to say just what I did near the end of the comments. Mac seems still a nicer setup right now. – sabgenton Apr 11 '16 at 4:45
4

New files that are created via Windows Explorer are possibly not appearing in bash because they are missing special LXSS NTFS attributes.

When LXSS creates files in the LXSS root, it attaches additional information to them via NTFS attributes to store things that cannot be represented by the standard NTFS attributes, such as Linux file permissions. If these are missing, it the files don't show up.

This is supported by the fact that if you make a file in bash, and then make a copy of it with Windows Explorer, it appears in bash. This is presumably because all of the special LXSS attributes were duplicated with the file.

The LXSS filesystem layer also appears to cache the file system, so the directory entries in bash will not reflect the actual state of the file system if files are added or deleted until all bash terminals are stopped (which ends the LXSS session in the LXSS service and hence clears the cache).

3

Ok it seems stuff at AppData\Local\Lxss\ is modifiable and will sync back to the Ubuntu bash session.

You must close bash completely. And you can not create new files.

Strange as Microsoft seems to say you can't.

However other than being annoying this is still not very usable as making new files doesn't seem to work.

I don't know if the bash session puts stuff into ram or what but Microsoft can make this happen it appears.. If they choose.

3

What works for me is copying with bash instead of using Explorer.

The C-drive is at /mnt/c so in order to copy the folder C:\tmp\test1 to /tmp/ in your bash home directory do: cp -r /mnt/c/tmp/test1 ~/tmp.

3

I think you will find this ... incredibly helpful. There is quite a lot of useful information there, but it can be summed up as it applies here in one section:

Interoperability with Windows

While VolFs files are stored in regular files on Windows in the directories mentioned above, interoperability with Windows is not supported. If a new file is added to one of these directories from Windows, it lacks the EAs needed by VolFs, so VolFs doesn’t know what to do with the file and simply ignores it. Many editors will also strip the EAs when saving an existing file, again making the file unusable in WSL.

Additionally, since VFS caches directory entries, any modifications to those directories that are made from Windows while WSL is running may not be accurately reflected.

The article does talk about the specifics of the filesystem and the extended attributes as well. But in summary, modifying WSL files from windows is a no-go.

0

Until they get this worked out, I installed cygwin sshd for visibility to the native NTFS file system and ran the ubuntu sshd for visibility to the lsxx linux files. use apt-get to install sshfs and win-sshfs to do mounts each way. It is a round-about hack but works for me for now.

If you didn't want to mess with the cygwin sshd, you could use cygwin ssh to scp the files back and forth.

Using cygwin sshd helps get around file permissions issues by using a real administrator account in the .ssh/config file. I had some strange access permissions going through the DevFS/NTFS interface.

  • You should only "share" files through /mnt/ in LXSS, not through the root file system. – ZiggyTheHamster Aug 28 '18 at 20:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.