Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to see mounted files via explorer.exe #7834

Closed
1 of 2 tasks
Ryan-ZHENG opened this issue Dec 14, 2021 · 11 comments
Closed
1 of 2 tasks

Unable to see mounted files via explorer.exe #7834

Ryan-ZHENG opened this issue Dec 14, 2021 · 11 comments

Comments

@Ryan-ZHENG
Copy link

Version

Microsoft Windows [Version 10.0.19044.1387]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.10.60.1

Distro Version

Ubuntu 20.04

Other Software

No response

Repro Steps

  1. In Windows Terminal (wsl env), I used sshfs to mount the home directory of my dev server into wsl:
    sshfs -d -o allow_other ryan@10.x.x.x:/home/ryan /ryan_server/ -o nonempty,reconnect,identityfile=/.ssh/id_rsa

  2. After cmd succeeded, I was able to see the content via bash cmd, like ls -al

  3. But still, I cannot find anything via explorer.exe in Windows;

Expected Behavior

It was okay until this week.
The explorer should show the correct content, instead of the empty directory created before mounting;

Actual Behavior

Nothing shown.

Here is another try that might help to locate the root cause:

  1. I copied a file from windows into the empty directory, it can be found in explorer.exe, but cannot be found in the mounted directory via terminal;
  2. But after un-mounted, the copied file shows up in terminal;

Hence, I suspect that my Windows cannot correctly recognize mount point, but treat them as ordinary directory.

Diagnostic Logs

I used -d option while executing sshfs so that any error can be detected during I enter the directory in explorer.exe.

But unfortunatly, there is nothing output when I double-click the directly and enter...

@Ryan-ZHENG
Copy link
Author

If anything else is required, please let me know.
I used to check content of WSL-mounted files via explorer.exe, till this week.
Not sure if I accidentally modified something, or maybe our IT admin changed any global policy on my laptop?

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 14, 2021

Thanks for reporting this @Ryan-ZHENG.

The issue here is probably that the sshfs mountpoint is created in a different mount namespace than the one the explorer uses.

More details here

Does mounting this folder from a non-elevated context help ?

@Ryan-ZHENG
Copy link
Author

Thanks @OneBlue , I succeeded to view the contents after mounting the sshfs under /mnt/wsl, which, as per the information you posted, available for both two namespaces!

But still, I am wondering why it is a sudden failure, as the way I mount/view is exactly the same as I did last week.

So, would you please guide me on how to determine whether the context is elevated or not?

@ghost ghost removed the needs-author-feedback label Dec 15, 2021
@Ryan-ZHENG
Copy link
Author

Update: I just found the root cause, our IT admin recently pushed a global policy on each Windows startup to disable the UAC, causing all the consoles opened in elevated mode...

This issue can be now closed.

Thanks for your support! @OneBlue

@androiddisk
Copy link

Please tell me how to solve the UAC restriction, which has puzzled me for a long time. thank you

@androiddisk
Copy link

Update: I just found the root cause, our IT admin recently pushed a global policy on each Windows startup to disable the UAC, causing all the consoles opened in elevated mode...

This issue can be now closed.

Thanks for your support! @OneBlue

Please tell me how to solve the UAC restriction, which has puzzled me for a long time. thank you

@Ryan-ZHENG
Copy link
Author

Update: I just found the root cause, our IT admin recently pushed a global policy on each Windows startup to disable the UAC, causing all the consoles opened in elevated mode...
This issue can be now closed.
Thanks for your support! @OneBlue

Please tell me how to solve the UAC restriction, which has puzzled me for a long time. thank you

Sorry to see your question that late... hope this can help:
The core concept is to enable UAC, which was disabled by our IT via group policy update, so the terminal (cmd/powershell/wt...) can run at non-admin userspace;

My solution is as below, hope it can help you a little:

  1. Save below text as a file named "enable_uac.bat" (or whatever):

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

  1. Then execute it as admin.
  2. After reboot your PC, mount again, it will be working then.

@androiddisk
Copy link

thank you !!!
very thank you !!!
thank you !!!

@androiddisk
Copy link

Update: I just found the root cause, our IT admin recently pushed a global policy on each Windows startup to disable the UAC, causing all the consoles opened in elevated mode...
This issue can be now closed.
Thanks for your support! @OneBlue

Please tell me how to solve the UAC restriction, which has puzzled me for a long time. thank you

Sorry to see your question that late... hope this can help: The core concept is to enable UAC, which was disabled by our IT via group policy update, so the terminal (cmd/powershell/wt...) can run at non-admin userspace;

My solution is as below, hope it can help you a little:

  1. Save below text as a file named "enable_uac.bat" (or whatever):

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

  1. Then execute it as admin.
  2. After reboot your PC, mount again, it will be working then.

Hello, good afternoon

After windows11 updates the system, the method is no longer available. Do you know what happened

@androiddisk
Copy link

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

That's it. I don't know why

@owenstake
Copy link

C:\Windows\System32\cmd.exe /k %windir%\System32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

That's it. I don't know why

thx. this solve my problem. i can see the file in wsl mount point dir in windows file explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants