Windows Linux Subsystem - Accessing Files outside of Ubuntu

Dave Hamilton

Why, when I create a file from within Windows for example, 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 Windows Explorer. 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 I have had to use Cygwin to show file permissions, I have also altered the permissions to see if the folder would appear. (The two command windows at the bottom)

Screenshot showing folder, bash.exe and Cygwin permissions:

enter image description here

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?

scottt732

I'm not sure if I'm misunderstanding your question, but your ubuntu bash (top right window) should have access to your Windows-based disks under /mnt. For example, 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, I don't think you can 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.

Make sure you update your Windows builds periodically as they seem to be fixing a lot of issues with each build, especially around sym-links and crossing FS boundaries between Linux/Windows.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Can I drag and drop files to an .sh script using Bash on Ubuntu on Windows or Windows Subsystem for Linux (WSL)?

From Dev

Show matplotlib plots in Ubuntu (Windows subsystem for Linux)

From Dev

Update Linux Subsystem on Windows (Ubuntu) to 16.04

From Dev

FATAL -> Failed to fork on Windows subsystem for Linux with Ubuntu

From Dev

Ubuntu using Linux Subsystem for Windows .sh problem

From Dev

Getting Ubuntu subsystem on Windows

From Dev

OpenZFS on Windows Subsystem for Linux

From Dev

Linux Subsystem for Windows

From Dev

GUI for Windows Subsystem for Linux

From Dev

Run 32-bit application on Ubuntu on Windows subsystem for Linux

From Dev

Upgrade of Linux Subsystem for Windows 10 (WSL) to Ubuntu 16.04 not working

From Dev

Open URL with VIM in Ubuntu WSL (Windows Subsystem for Linux)

From Dev

"set -eo pipefail" not working in Windows Subsystem for Linux (Ubuntu 16.04)

From Dev

Ubuntu installed but windows subsystem for linux has no installed distributions

From Dev

Is it possible to install IBM java on Windows Subsystem for Linux (WSL) - Ubuntu?

From Dev

accessing ubuntu files(installed in virtualbox) from windows

From Dev

Accessing external HDD ext3 (Ubuntu/Linux) files from Windows 10

From Dev

Java: Accessing Windows files from Linux machine

From Dev

I broke the Windows Linux Subsystem (Bash on Ubuntu on Windows 10). Linux Help?

From Dev

Installing Apache on Windows Subsystem for Linux

From Dev

Using Jupyter with Windows Subsystem for Linux

From Dev

Cygwin/X and Windows Subsystem for Linux

From Dev

Windows Subsystem Linux VSCode path

From Dev

SSH linux subsystem windows 10

From Dev

vpython not working on windows subsystem for linux

From Dev

What are the limitations of the Windows Subsystem for Linux?

From Dev

How to install Linux subsystem for Windows

From Dev

apt-get command does not work on Ubuntu-On-Windows / Windows Subsystem for Linux

From Dev

Windows Subsystem for Linux (WSL): what can't I do with the Ubuntu application for Microsoft Windows?

Related Related

  1. 1

    Can I drag and drop files to an .sh script using Bash on Ubuntu on Windows or Windows Subsystem for Linux (WSL)?

  2. 2

    Show matplotlib plots in Ubuntu (Windows subsystem for Linux)

  3. 3

    Update Linux Subsystem on Windows (Ubuntu) to 16.04

  4. 4

    FATAL -> Failed to fork on Windows subsystem for Linux with Ubuntu

  5. 5

    Ubuntu using Linux Subsystem for Windows .sh problem

  6. 6

    Getting Ubuntu subsystem on Windows

  7. 7

    OpenZFS on Windows Subsystem for Linux

  8. 8

    Linux Subsystem for Windows

  9. 9

    GUI for Windows Subsystem for Linux

  10. 10

    Run 32-bit application on Ubuntu on Windows subsystem for Linux

  11. 11

    Upgrade of Linux Subsystem for Windows 10 (WSL) to Ubuntu 16.04 not working

  12. 12

    Open URL with VIM in Ubuntu WSL (Windows Subsystem for Linux)

  13. 13

    "set -eo pipefail" not working in Windows Subsystem for Linux (Ubuntu 16.04)

  14. 14

    Ubuntu installed but windows subsystem for linux has no installed distributions

  15. 15

    Is it possible to install IBM java on Windows Subsystem for Linux (WSL) - Ubuntu?

  16. 16

    accessing ubuntu files(installed in virtualbox) from windows

  17. 17

    Accessing external HDD ext3 (Ubuntu/Linux) files from Windows 10

  18. 18

    Java: Accessing Windows files from Linux machine

  19. 19

    I broke the Windows Linux Subsystem (Bash on Ubuntu on Windows 10). Linux Help?

  20. 20

    Installing Apache on Windows Subsystem for Linux

  21. 21

    Using Jupyter with Windows Subsystem for Linux

  22. 22

    Cygwin/X and Windows Subsystem for Linux

  23. 23

    Windows Subsystem Linux VSCode path

  24. 24

    SSH linux subsystem windows 10

  25. 25

    vpython not working on windows subsystem for linux

  26. 26

    What are the limitations of the Windows Subsystem for Linux?

  27. 27

    How to install Linux subsystem for Windows

  28. 28

    apt-get command does not work on Ubuntu-On-Windows / Windows Subsystem for Linux

  29. 29

    Windows Subsystem for Linux (WSL): what can't I do with the Ubuntu application for Microsoft Windows?

HotTag

Archive