Creating or changing Linux files from Windows

If we dig a bit deeper into this subject and find why this phenomenon occurs in the first place, we’ll have our questions answered. Every Operating System has its file metadata, which differs from one OS to another. As a result, Windows file metadata is different from Linux file metadata and not recognized by Windows. As a natural consequence, any effort to add or update Linux file metadata using Windows files would impose an unnecessary overhead on most Windows users who will not run WSL. If you are not aware, WSL or Windows Subsystem for Linux (WSL) is a compatibility layer for running Linux binary executables natively on Windows 10. So, It’s the sole responsibility of WSL to write/update Linux file metadata for all the files under your Linux filesystem root (i.e.,/), storing the Linux metadata in each file’s NTFS extended attributes. In addition to the above, WSL also synthesizes pseudo metadata for most of the files in your Windows filesystem. The problem occurs when a user uses a Windows app/tool to open, create or modify a file under your distro root (Linux filesystem containing Linux files or any of the files and folders under %localappdata%\lxss). Since Windows application/program was used to create the file, it won’t have any Linux file metadata (e.g., permissions, owner, access/update timestamps, etc.). Therefore, for a Linux system configured only to receive Linux file metadata, the file may have some metadata but will appear as empty, corrupting contents in the file. To avoid such instances of misfortune, follow these two rules to avoid losing files or corrupting your data, For more information, visit MSDN Blog.

Does Windows support Linux?

You can use WSL or Windows Subsystem for Linux to install any of the Linux Distro and then access Windows files as well. The Windows Subsystem for Linux lets developers run a GNU/Linux environment — including most command-line tools, utilities, and almost everything Linux can run.

Is WSL better than VM?

VMs are an excellent choice if you plan to use them in isolated or networked environments. The WSL command-line tool allows you to use Linux commands on your Windows system (to modify Windows files) easily.