Windows Linux Subsystem - Accèsing Fichiers outside of Ubuntu

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Windows Linux Subsystem - Accèsing Fichiers outside of Ubuntu

Message par ForumBot »

Why, when I create a file from within Windows par exemple,
can I not see it under the Linux sub system in Windows 10 (bash.exe)

The screenshot should explain.

Folder: OMG was created from within Explorateur Windows.
Folder OMGBash was created from with Linux sub system bash.exe

When a folder OR file is created outside of bash.exe I can never see it, regardless of permissions and ownership.

To show the information J'ai had to use Cygwin to show file permissions, J'ai unlso altered the permissions to see if the folder would appear.
(The two command windows en bas)

Screenshot showing folder, bash.exe and Cygwin permissions:

I am trying to move all my Cygwin scripts over to the Linux subsystem,
**but** I don't fancy recreating every file, then having to copy and past using bash, then reformatting then using Dos2unix (very long winded).

**Found this on GitHub for the Linux subsystem:**

>


copying directly into the Linux subsystem from Windows is not
supported, according to discussion on other tickets. There is a
directory under AppData somewhere (I forget where) that appears to
contain the files for the WSL filesystem. But if you put new files
there, or modify existing files there, your changes are not reflected
correctly inside WSL.



My best guess is that Linux needs to store different metadata (and
more caching information, etc, since its disk-buffering model is also
different) about its files than Windows does, and that this is
currently implemented by storing the master copy of the structure of
the Linux filesystem in a database of some sort, and just using the
Windows filesystem as a convenient BLOB-store for that database.



If you really need to do this, a workaround would be to write a
drag'n'drop .bat script or somesuch that does bash.exe -c "mv %1
/home/$USER/". (You'll have to do some clever work with sed and tr,
probably, to translate %1 to a valid WSL path.)



Alternatively -- could you put your files in a Windows directory and,
within WSL, do "cd ~; ln -s /mnt/c/path/to/my/files" to make them
appear to be in your WSL homedir?
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Re: Windows Linux Subsystem - Accèsing Fichiers outside of Ubuntu

Message par ForumBot »

Je ne suis pas sûr if I'm misunderstanding your question, but your ubuntu bash (top right window) should have access to your Windows-based disks under `/mnt`. Par exemple, on my machine `/mnt/c/Users/Scott/Desktop` is my Windows desktop and I can read/write files there from vi for ex. I don't believe the opposite is true just yet. That is, Je ne pense pas vous pouvez explore into your bash world from Windows explorer.

What I've been doing as a developer is to host projects on my d: and point the linux-based tools to that `/mnt/d/projects/someproject/` folder.

Assurez-vous you update your Windows builds periodically as they seem to be fixing beaucoup de issues with each build, especially around sym-links and crossing FS boundaries between Linux/Windows.
Répondre

Revenir à « Windows 10 »