microsoft / WSL

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

ISCSI shares can't be mounted using wsl --mount \\.\PHYSICALDRIVE* #6064

Closed wanfuse123 closed 3 years ago

wanfuse123 commented 4 years ago

Environment

Windows build number: [run `[Environment]::OSVersion` for powershell, or `ver` for cmd]
Your Distribution version: [On Debian or Ubuntu run `lsb_release -r` in WSL]
Whether the issue is on WSL 2 and/or WSL 1: [run `cat /proc/version` in WSL]

Steps to reproduce

WSL logs:

Expected behavior

Actual behavior

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows

PS C:\WINDOWS\system32> wmic diskdrive list brief Caption DeviceID Model Partitions Size
FreeNAS iSCSI Disk SCSI Disk Device \.\PHYSICALDRIVE4 FreeNAS iSCSI Disk SCSI Disk Device 2 21467980800 Covecube Virtual Disk \.\PHYSICALDRIVE5 Covecube Virtual Disk 1 2199020382720 FreeNAS iSCSI Disk SCSI Disk Device \.\PHYSICALDRIVE3 FreeNAS iSCSI Disk SCSI Disk Device 2 21467980800 ST1000DM 003-1ER162 SCSI Disk Device \.\PHYSICALDRIVE2 ST1000DM 003-1ER162 SCSI Disk Device 3 1000202273280 WDC WDS200T2B0A-00SM50 \.\PHYSICALDRIVE1 WDC WDS200T2B0A-00SM50 3 2000396321280 SATA SSD \.\PHYSICALDRIVE0 SATA SSD 3 480101368320

PS C:\WINDOWS\system32> wsl --mount \.\PHYSICALDRIVE4 --partition 2 --type ext4 The system cannot find the file specified. PS C:\WINDOWS\system32> wsl --mount \.\PHYSICALDRIVE4 The system cannot find the file specified. PS C:\WINDOWS\system32>

wanfuse123 commented 4 years ago

winver Version 2004 (OS Build 20226.1000

wanfuse123 commented 4 years ago

tried setting Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer to the following value (adding MSiSCSI)

SamSS Srv2 MSiSCSI

OneBlue commented 4 years ago

Thanks for reporting this @wanfuse123. I suspect that this might be an issue with iscsi disks.

Can you please reproduce the issue and share a trace with us ?

wanfuse123 commented 4 years ago

I can not provide an STRACE, this is purely on the windows side. I have mounted ISCSI shares on the windows side and was planning on accessing them from /mnt/h (whatever drive letter) assigned in windows rather than run the iscsi initiator in the Ubuntu 18.04 guest

Not sure how to run the debugger (windebug) on the wsl.exe process. When I run it it shows the following (but I think its my method thats wrong)

0:003> wsl --mount \\PHYSICALDRIVE3 --partition 2 ^ Syntax error in 'wsl --mount \\PHYSICALDRIVE3 --partition 2

wanfuse123 commented 4 years ago

Note I would like to try October 13th 2020 update, but its not available yet

OneBlue commented 4 years ago

When I wrote 'traces', I didn't mean an strace but a trace of the Windows part of WSL (look at Collect WSL logs).

We need those traces to understand where the error is coming from.

wanfuse123 commented 4 years ago

I submitted a bug report under my account, It says it saved a local copy of the report but I do not know where it saves a copy of the report so I can attach it here. I attached both windows and linux logs. Let me know if you need anything else. I am axious to get a resolution to this issue.

wanfuse123 commented 4 years ago

If there is logs somewhere else I will be glad to get them, just let me know where they are located! I greatly appreciate your help!

Regards,

Steven

OneBlue commented 4 years ago

Thank you. Can you please follow the last step in Collect WSL logs and share a link to your feedback item ?

wanfuse123 commented 4 years ago

https://aka.ms/AA9y9jl

wanfuse123 commented 4 years ago

I noticed on the feedback that I do not see the attached video, 10 or so logs, or images. I assume I just cant see them that they are actually still attached. Please let me know if they are not. It would be nice to be able to see everything submitted, perhaps I am overlooking something.

wanfuse123 commented 4 years ago

Notice the similar problem mentioned (where from the linux side you are unable to do a directory listing from linux "ls" on the ext4 file systems mounted by windows through wsl on the linux file system. This is patched in the NOT SO RIGHT WAY using this hack mentioned here:

https://github.com/dokan-dev/dokany/issues/932

and cheatengine software listed here

https://github.com/cheat-engine/cheat-engine/releases/tag/7.1

Can microsoft implement a legit version of this patch please? This will take care of ISCSI from the Ubuntu WSL2 side of things and fixing the other issue mentioned above will take care of it from the Windows side of WSL2

Thanks a lot for all the help!!!

mrnerdhair commented 4 years ago

That's tracked in issue #6063. As far as this issue goes, can you confirm that applying the patch fixes this iSCSI issue? And are there any other problems with the filesystem after it's mounted? Specifically:

wanfuse123 commented 4 years ago

reidrankin, how do I apply this patch without turning my Windows system into a hacked copy? I would rather not install a 3rd party tool that hacks my copy of windows. Perhaps I miss understand the nature of this hacking software?

Also its possible the https://github.com/cheat-engine/cheat-engine/releases/tag/7.1 cheetengine is actually produced by a legit 3rd party?

Can you please explain further?

wanfuse123 commented 4 years ago

https://www.youtube.com/watch?v=gW1t0kQEFSs&feature=youtu.be

patch fails....

wanfuse123 commented 4 years ago

oh upgraded windows 10 last night to version 2004 OS build 20231. 1000

wanfuse123 commented 4 years ago

Seems to have same problem on all EXT4 file systems, I have "paragon software" file system for windows for rw access to ext 4/3/2 partitions installed. This could be the problem too.

Same problem though on the ISCSI shared ext4 file system drives too , same exact error...

does not happen with /mnt/wsl , I assume this is ext4 as well?

mrnerdhair commented 4 years ago

Cheat Engine is completely legit, and the patch is actually safe and stable -- at least in my environment. It's also only applied in RAM, and only on the particular dllhost.exe instance that services the WSL2 utility VM -- meaning that if something goes wrong, wsl --shutdown (or, for that matter, a reboot of the host system) will completely undo everything the patch does.

That said, it will fail to apply if you don't have exactly the same version of vp9fs.dll that it was developed for -- which is the one with a SHA256 hash of ae2f87e4d3c0769b4f89ccf97f53d5b6885fb4465abce4003055474c3a7074ef.

But, honestly, I wasn't expecting it to work at all in this situation. I was just surprised that you'd brought it up, and was trying to confirm that you'd done so because you'd applied it already and seen that it fixed the issue. I'm not sure why else you'd consider this and #6063 related -- that's for problems after mounting, while this seems to be for problems getting things mounted in the first place.

As far as accessing ext4 partitions in WSL2, you can actually do that now: see this MS blog post. You can expose physical disks to Linux -- or connect to them using an iSCSI initiator inside Linux -- and then mount them with Linux's native ext4 driver. Then you can use the \\wsl$ share to access the mounted drives from within Windows -- no third-party FS needed.

wanfuse123 commented 4 years ago

As I understand it Microsoft's driver is for read only access. I need read / write access.

I have 2 opposing issues that occur one if mounted from windows side and shared to linux. the other if I mount in linux through openiscsi initiator , either way I can not do an "ls" on the mounted drives...

wanfuse123 commented 4 years ago

Perhaps Microsoft might be able to provide me a zip file with the correct dll version mentioned in this thread above with the appropriate hash to try and replace from a live cd? I believe I can regenerate the certificates for the file system on boot using the following method #1:Rebuild Boot Manager: outlined here (that way it becomes semi perminent):

https://ugetfix.com/ask/how-to-fix-the-digital-signature-for-this-file-couldnt-be-verified-error-on-windows-10/

mrnerdhair commented 4 years ago

The DLL I mentioned is signed. You wouldn't get that error, and even if you did, rebuilding the BCD would definitely not fix it:

Neither wsl --mount nor the use of a Linux-based iSCSI initiator involves vp9fs.dll, drvfs, or Plan 9 at all. Therefore:

You said I have mounted ISCSI shares on the windows side and was planning on accessing them from /mnt/h (whatever drive letter) assigned in windows:

OneBlue commented 4 years ago

@wanfuse123 : I indeed don't see traces inside the feedback item you shared.

Can you please try again and make sure that you follow the Recreate your problem in the 'Additional Details' section block ?

This should ensure that traces are part of the feedback item.

wanfuse123 commented 4 years ago

I would be more than happy to send you a trace but the Feeback hub app refuses to start a recording session even after a purge of the feeback hub app , a reboot and a reinstall..

wanfuse123 commented 4 years ago

Also, now that I have reinstalled the app, It appears I no longer have access to the feedback hub session so that I can just update it rather than start all over again.

OneBlue commented 4 years ago

Well that sucks :(.

If you don't mind, creating a new feedback hub entry is probably the simplest path to share traces with us.

wanfuse123 commented 4 years ago

ErrorForBugFile1 ErrorForBugFile2 ErrorForBugFile3 ErrorForBugFile4 ErrorForBugFile5 ErrorForBugFile6

wanfuse123 commented 4 years ago

Any idea how to get around this problem. I have a couple other problems I would like to report, but the inability to create a trace is preventing me! Thanks in advance!

wanfuse123 commented 4 years ago

OK so here is an idea, I can generate trace logs using logman.exe, I was looking at:

https://github.com/microsoft/WSL/blob/2cb110aba644d0bb3ff8d6445448d4e08e11df78/CONTRIBUTING.md#8-detailed-logs

https://docs.microsoft.com/en-us/dynamics-nav/how-to--use-logman-to-collect-event-trace-data

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/logman-create-trace

when I create the log from step 8 from: https://github.com/microsoft/WSL/blob/2cb110aba644d0bb3ff8d6445448d4e08e11df78/CONTRIBUTING.md#8-detailed-logs

it only logs one ERROR event : error 15003

15003 %Windir%\System32\Logfiles\HTTPERR exists and contains about 30 lines of logs (500 GB of free space) contains this error HTTP/1.1 POST /f7e52801-2c6a-4db9-a105-5ac112d8877c - - 503 - N/A - TCP 2020-10-17 10:08:41 10.0.0.1 50436 10.0.0.146 2869 HTTP/1.1 NOTIFY /upnp/eventing/rfpqdjlvrh - - - - Connection_Abandoned_By_ReqQueue - TCP <<< ths is whats in the %Windir%\System32\Logfiles\HTTPERR log

but I dont think its related (think its from a piece of maleware that is long gone, but could be wrong

My question is to create an all inclusive log of wsl --mount on the windows side or wsl --export what logman parameters do I use?

(this way I can post the logs here since the record feature on feedback hub is not working)

also does wsl executed on windows side run in a linux container rather than on the windows side? this would explain why logs contain nothing!

Thanks in advance for the help! I am getting desperate to try and find the source of the issues I am having and have like 6 bug reports I am trying to properly file but can't.

OneBlue commented 4 years ago

Ok, so if feedback hub doesn't work for you let's capture the traces manually as you suggested.

For wsl --mount, we would need lxcore_user and lxcore_service.

So what you'd need to do is: (as administrator)

logman.exe create trace lxcore_user -p "{D90B9468-67F0-5B3B-42CC-82AC81FFD960}" -ft 1:00 -rt -o .\lxcore_user.etl -ets
logman.exe create trace lxcore_service -p "{B99CDB5A-039C-5046-E672-1A0DE0A40211}" -ft 1:00 -rt -o .\lxcore_service.etl -ets

[Reproduce the issue]

logman.exe stop lxcore_user -ets
logman.exe stop lxcore_service -ets

And share lxcore_user.etl & lxcore_service.etl on this issue

ghost commented 3 years ago

This issue has been automatically closed since it has not had any author activity for the past 7 days. If you're still experiencing this issue please re-open it.

Thank you!