microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.25k stars 811 forks source link

Zone.Identifier Files when downloading from Windows to WSL file structure #7456

Open ameya-jain opened 2 years ago

ameya-jain commented 2 years ago

When downloading a file from an online source lets say this image or a zip folder and directly saving it to the WSL file structure using the Microsoft Edge 'save as' option ( I have turned off the default download location so edge asks me every time where I should save something downloaded), when the download is complete I see these Zone Identifier files.

I read about a similar #4609 issue and from what I understand is that these files shouldn't be downloaded or should be removed after download.

image

My Ubuntu specifications : image

My windows : image

YAMLcase commented 2 years ago

Is there a workaround for this?

ameya-jain commented 2 years ago

Is there a workaround for this?

I usually use VS Code and is connected to my WSL. Instead of directly downloading the files from the browser to WSL, I download to windows, open the WSL folder in VS Code and then drag and drop the files from windows to VS Code. This seems to not bring the Zone.Identifier files.

Volper212 commented 2 years ago

I download to windows, open the WSL folder in VS Code and then drag and drop the files from windows to VS Code.

That's another step though, I think deleting the zone identifier file is less work since you only have to delete it at the end of your work, not every time you download. You can technically even keep it and just add it to .gitignore but it would be cool if you could disable generating the file completely, or just not generate it if it's empty anyway

rehanhaider commented 2 years ago

I can confirm this issue still exists on Windows 11, even though it was supposed to be fixed. Steps to reproduce are

  1. Open any webpage and download an image, similar to this sample image
  2. In the "Save As" dialogue, choose "Linux -> Ubuntu" and browse to folder of choice, and save
  3. Creates a file with name <download-file-name>:Zone.Identifier
JacobDB commented 2 years ago

I'm also still seeing this in Windows 11, any time I download a file and copy it over to WSL via File Explorer, along comes a :Zone.Identifier.

Kai-Richardson commented 2 years ago

As the filer of the original issue, I can confirm this is still not fixed for either Windows 10 or Windows 11. Exact same reproduction steps I outlined here still work:

  1. Navigate to an image url.
  2. Right click and Save Image As
  3. Choose location on my Windows NTFS C: Drive, such as C:\Users\zekai\Desktop
  4. Drag (Click and hold) or copy/paste (CTRL+C & CTRL+V) PNG file to a WSL filespace, such as \\wsl$\Ubuntu\home\cassini\github
  5. Nothing appears at first, but click the refresh button on explorer.exe in the top right.
  6. Notice new Zone.Identifier file.
MattDirty commented 2 years ago

Problem arised for me when I went from my Windows 10 Pro N to a clean install of Windows 11 Pro N. I thought the issue was me switching my daily driving wsl distro from Ubuntu to Manjaro but after installing Ubuntu, the problem is also there. So the culprit must be my new Win11 install.

I could spin up my old Win10 to see what were my config (I'm pretty sure Windows Defender was deactivated). I had to activate TPM for Win11, other than that my hardware stayed the same.

Let me know if replugging my Win10 drive to test and gather the config differences is something that could help.

Side note: ZoneIdentifier files are also created when copying from Manjaro to Ubuntu via explorer.exe.

mattwelke commented 2 years ago

Having this problem in Windows 10 Pro. Copied a file from one File Explorer window to another, where the first one was my Downloads directory on the Windows side and the second one was a WSL 2 directory.

I was able to delete the file via VS Code's GUI after I closed all my File Explorer windows (before closing them, it said "this file is in use" etc). I wasn't able to delete the file from the WSL 2 terminal. It was as if the WSL 2 terminal couldn't target the file using the rm command. And rm *Identifier said an error like "not a file".

dtromans commented 2 years ago

It's funny how the original issue was closed as "fixed" when the supposed fix never landed outside of insider/preview builds.

saurav-codes commented 2 years ago

this issue still exists in windows 11. please fix this ASAP image

brunocantuaria commented 2 years ago

Still happens here as well, on Windows 11

ferrouswheel commented 2 years ago

The Zone.Identifier file has host and referer urls, which can contain query string access tokens. While any decent web service should expire tokens, potentially having plaintext credentials lying around in files is... a little dodgy.

Would be nice for this to be resolved.

MatthewMierzwa commented 2 years ago

This issue also happens on my Win 10 build 19042 & WSL 2 running Ubuntu.

minh14496 commented 2 years ago

The issue still persists on Window 11 21H2.

RichIsOnRails commented 2 years ago

Can confirm, happens on:

Edition Windows 11 Pro Version 21H2 OS build 22000.493 Experience Windows Feature Experience Pack 1000.22000.493.0

Downloading a file from Microsoft Edge directly to the WSL location or copying it from Downloads does the same thing for me.

vietaalto commented 2 years ago

Confirm. Happen to me with Windows 10 Pro and WSL2

georgej1144 commented 2 years ago

Can confirm on

Only way I've found to move/copy files to WSL without getting Zone.Identifiers is my moving/copying from within WSL (cp/mv/etc).

soundnotation commented 2 years ago

Can confirm the issue on:

vitsafarik commented 2 years ago

Can confirm the issue on:

Windows 11 Pro Version 21H1 (22000.527)

WSL Ubuntu release: 20.04 cat /proc/version: Linux version 5.10.16.3-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Apr 2 22:23:49 UTC 2021

Jorggyh commented 2 years ago

Well, the same thing happened to me, saved in windows, cut and pasted in a linux folder, and out of curiosity I went to research what it was and ended up here, so.. it still happens

image

Windows 11 Home Single Language Version 21H2 Comp. 22000.556 Ubuntu 20.04

hichemfantar commented 2 years ago

Present in Windows 10 21H1 with WSL2

HakuOTR commented 2 years ago

Can confirm the issue on:

explorer_2022-03-30_21-17-15
AdmiralCode commented 2 years ago

@HakuOTR I would just give it some time. Hopefully they will fix it soon. We ended up going with the (M1 based, this year) Macbook Pro again. I could not even attempt to justify anything else, considering I have to support my developers. WSL is still proving to be far too immature. It is getting close, however. Maybe one day.

Please note that the majority of my folks would love to run Windows with a WSL2 dev environment, but it has to work, right now the list of bugs is long, and the patience is short. We still don't have systemd support, for example, and that isn't even remotely an issue that is a blocker for us. The blockers?

1) No ability to autostart background services unless Windows is involved in some oddball hack. 2) Unexpected filesystem changes that have to be filtered out 3) Enterprise support for WSL? Seems nonexistent? We spend well over 6 figures (like, exponentially, though I won't disclose figures thanks to NDA) with Microsoft, how is it that WSL/WSL2 has no support? Or did our team miss something?

I wish everyone the best of luck.

dospuntocero commented 2 years ago

you can sudo find . -name "*:Zone.Identifier" -type f -delete worst workaround, but works.

JoshuaJarman commented 2 years ago

2022-05-25 Win11 Pro Insiders 25120rs_prerelease.220513-1246

Problem still persists. 😢 such a pita to have to delete 2 files for every 1 file copied.

KristianLake commented 2 years ago

this issue causes files that if are uploaded by accident can cause builds to fail in CI/CD

sebday commented 2 years ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder

Open gpedit.msc

UnknownMasterCoder commented 2 years ago

Problem persists and seriously is disgusting this kind of bugs happening in WSL. Have to create an alias to delete fast those Zone.Identifier when I'm copying assents to my WSL, but its time workflow and most important is unnecesary work.

image

This needs to be fixed

archon810 commented 2 years ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder

Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

I've done this but WSL is still creating the Zone.Identifier files.

image

cagroh commented 2 years ago

Hello! I'd recommend that one of you who is subscribed to the Windows Insider Program to report the bug, either on Win10 or Win11. I'm enrolled to WIP but I don't use WSL.

thenger commented 1 year ago

I've done this but WSL is still creating the Zone.Identifier files.

In a work environment, managed pc don't always have access to these settings. So not really a workaround for me.

pauloreis7 commented 1 year ago

Same problem here 😢

Window 11 / WSL 2

yannicklescure commented 1 year ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder

Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

Original post from MS https://devblogs.microsoft.com/oldnewthing/20140311-00/?p=1543#:~:text=In%20the%20Group%20Policy%20editor,your%20computer%20even%20more%20dangerous.

newzealandpaul commented 1 year ago

I've done this but WSL is still creating the Zone.Identifier files.

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

Original post from MS https://devblogs.microsoft.com/oldnewthing/20140311-00/?p=1543#:~:text=In%20the%20Group%20Policy%20editor,your%20computer%20even%20more%20dangerous.

That seems to work for me. Anyone know how to also prevent extended attribute (.attrs) files from also being created when copying to WSL2?

Pesky01 commented 1 year ago

Exact same issue here still. Any updated workarounds/fixes?

florianajir commented 1 year ago

+1

ilinevgeny commented 1 year ago

+1

tardism commented 1 year ago

It's still hapening on newest win11, when copying files from windows to wsl2 ubuntu, every file in ubuntu have .Identifier.

Lyqed commented 1 year ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

I've done this but WSL is still creating the Zone.Identifier files.

image

Hey, did you find a fix for this by chance? I've enabled it as well and my system still creates these Identifier files.

kaelef commented 1 year ago

Found this thread after running into the same issue when using Windows 10's built-in NFS client support to access NFS shared from a separate Ubuntu box (no WSL involved at all). Interesting that it's been going on for a few years now.

What's needed is an optional Windows policy to prevent any attempt to create alternate data streams on filesystems that don't support them. I won't hold my breath that something like that actually gets added, though... :\

Jones-UI commented 1 year ago

I am still experiencing this bug on Windows 10 Pro.

chrisbanas commented 1 year ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder

Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

I'm running windows 10 pro and this one worked for me.

tholeb commented 1 year ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder Open gpedit.msc

  • Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.
  • Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

I'm running windows 10 pro and this one worked for me.

Sadly, gpedit.msc is not available on Windows Home (11 22H2 build 22621).

Souvlaki42 commented 1 year ago

I still have no idea of why these Zone.Identifier files even exist in the first place but, I found two ways to stop them from get created every time you move something from windows explorer to wsl terminal. I hope this will help.

  1. Move the files using the mv command.
  2. Make them a zip, move the zip the folder you want the files and be and unzip it. (sudo apt-get install zip unzip)
  3. Also in case you need group policy editor in windows home, you can try this very useful tutorial.
gaambo commented 1 year ago

Turning off "preserve zone information in file attachment" seems to have stopped the zone.Identifer files being created when I copy-paste into a WSL folder

Open gpedit.msc

* Open User Configuration>Administratives Templates>Windows Components>Attachment Manager.

* Double-click on "Do not preserve zone information in file attachment" and set it to enabled, then press ok

This didn't prevent the Zone.Identifier files from being created in my case. Win 11 Pro 22621 and WSL 2 ("1.2.0").

Souvlaki42 commented 1 year ago

Then you can try that https://superuser.com/questions/1692240/auto-generated-zone-identity-files-can-should-i-delete

dalvarezquiroga commented 1 year ago

Same issue here Windows 10 + Ubuntu 22.

wsl -v Versión de WSL: 1.2.0.0 Versión de kernel: 5.15.90.1 Versión de WSLg: 1.0.51 Versión de MSRDC: 1.2.3770 Versión de Direct3D: 1.608.2-61064218 Versión DXCore: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp Versión de Windows: 10.0.19044.2846

.rw-r--r-- 1.5k alvardav alvardav 28 Apr 10:24  check-downscaller.sh .rw-r--r-- 1.6k alvardav alvardav 28 Apr 10:24  check-downscaller.sh:Zone.Identifier

shawhu commented 1 year ago

I saw a closed issue which was 3 years old the same as this one, I am curious, is Microsoft a government entity? It surely act like one. The efficiency for a bug fixing is textbook bureaucracy. To actually fix this issue, I'm guessing, will only take one engineer one day of labor and yet they continue to ignore their users. why? because they don't care.

copy a file to wsl file system using windows file explorer will generate a zone identifier file. is this a feature? or a bug? let's be clear about it first. what is the official explanation? I can't find it.

if it is a feature, why? and how to disable it? if it is a bug, why does it still exist? it's not a blocking issue granted, so it's not priority I understand that, but still, 3+ years?

davidruizdiaz commented 1 year ago

I also have the same problem and when trying to delete with the command find . -name "*:Zone.Identifier" -type f -delete it gives me the error find: cannot delete ‘./file:Zone.Identifier’: Read-only file system Does anyone know of another way to delete the file?

cesarvarela commented 1 year ago

It just happened to me after I dragged a few files using the Explorer pane:

image