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

Not able to browse files with explorer.exe if the directory was mounted with SSHFS #4172

Closed
gabrieldemarmiesse opened this issue Jun 17, 2019 · 16 comments
Assignees
Labels
wsl2 Issue/feature applies to WSL 2

Comments

@gabrieldemarmiesse
Copy link

Please use the following bug reporting template to help produce issues which are actionable and reproducible, including all command-line steps necessary to induce the failure condition. Please fill out all the fields! Issues with missing or incomplete issue templates will be closed.

If you have a feature request, please post to the UserVoice.

If this is a console issue (a problem with layout, rendering, colors, etc.), please post to the console issue tracker.

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to [email protected]. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

Microsoft Windows [Version 10.0.18917.1000]

  • What you're doing and what's happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.)

Mounting a directory with sshfs in WSL2 and browsing it using explorer.exe.

sudo apt-get update
sudo apt-get install -y sshfs
mkdir directory_for_testing_fuse
sudo sshfs -o allow_other [email protected]:/ ./directory_for_testing_fuse
ls directory_for_testing_fuse
cd directory_for_testing_fuse
explorer.exe .

"This folder is empty"

  • What's wrong / what should be happening instead:

I should see the files (root, home, etc, dev...) as they are listed in WSL

  • Strace of the failing command, if applicable: (If some_command is failing, then run strace -o some_command.strace -f some_command some_args, and link the contents of some_command.strace in a gist here).

No command is failing. So no trace available.

See our contributing instructions for assistance.

I wonder if this is a bug report or a feature request. Should we expect this scenario to work with WSL2 ?

@benhillis benhillis self-assigned this Jun 17, 2019
@benhillis benhillis added the wsl2 Issue/feature applies to WSL 2 label Jun 17, 2019
@benhillis
Copy link
Member

Thanks for filing this issue, this is due to how we isolated DrvFs mounts for admin / non admin access via mount namespaces. I have some ideas how to solve this in a future update.

@gabrieldemarmiesse
Copy link
Author

Thanks for the quick response. I'll wait then.

WSL 2 is awesome. You guys rock.

@benhillis
Copy link
Member

image

I have a change in CR right now that makes this work. Stay tuned for an upcoming Insiders build.

@gabrieldemarmiesse
Copy link
Author

Niiiiiice :)

@alexbogun
Copy link

Hi,

I am on 18945.1001 and am trying to get SSHFS to work, but then I type
sudo sshfs -o allow_other [email protected]:/ ./directory_for_testing_fuse

I get an error: fuse: device not found, try 'modprobe fuse' first

and on modprobe fuse I get:
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-18945-Microsoft/modules.dep.bin'
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-18945-Microsoft

What can it be? Thanks in advance!

@onomatopellan
Copy link

onomatopellan commented Aug 9, 2019

@alexbogun You are using WSL1 because it shows the build number 18945.
Fuse should work in WSL2 and if it doesn't at least it would say "modprobe: FATAL: Module fuse not found in directory /lib/modules/4.19.55-microsoft-standard"

@jmstrampe
Copy link

@onomatopellan if I'm getting the "modprobe: FATAL: Module fuse not found in directory /lib/modules/4.19.55-microsoft-standard" error in WSL2, is there a way to fix this?

@onomatopellan
Copy link

onomatopellan commented Sep 11, 2019

@jmstrampe I think WSL2 doesn't support kernel modules. Instead you will need to compile the linux kernel from here with the options you need and then load the custom kernel with .wslconfig file.

@Biswa96
Copy link

Biswa96 commented Sep 11, 2019

I think WSL2 doesn't support kernel modules.

Did you try it? I have not any sshfs system. Throw me any alternative test procedure.

@onomatopellan
Copy link

onomatopellan commented Sep 11, 2019

@Biswa96 Didn't try it either. I mean modprobe won't work in WSL2 because there are no modules that can be loaded. But I can be wrong too.

@adojaan
Copy link

adojaan commented Oct 7, 2019

In my wsl2 (w10 1903 18995.1) sshfs is able to mount remote resource and it works well, I can read and write files (in bash), browse folders (with mc) and so on. But when I try to launch explorer.exe . in my sshfs-mounted folder it displays error message
kristjan@Latirostris:/Xenops$ explorer.exe .
/mnt/c/WINDOWS/explorer.exe: Invalid argument
(Xenops is my sshfs-mounted folder).
In other folders the explorer works. When I launch explorer.exe in another folder and then try to open Xenops it displays error
\wsl$\Ubuntu\home\kristjan\Xenops is not accessible. You might not have permission to use
this network resource. Contact the administrator of this server to find out if you have access
permissions. Attempt to access invalid address.
The rights, displayed in my wsl2 ubuntu are following:
kristjan@Latirostris:
$ getfacl Xenops

file: Xenops

owner: kristjan

group: kristjan

user::rwx
group::r-x
other::r-x
In windows explorer, Properties -> Advanced displays following info for the sshfs-mounted folder.
Unable to display current owner.
Even Administrator's explorer cannot open this folder.

@EwolBash
Copy link

EwolBash commented Nov 25, 2019

I'm glad to have fuse working in WSL 2. Huge thank you to everyone involved for making it a reality.

Just so people know I'm running.

Microsoft Windows [Version 10.0.19030.1]

I can open explorer fine so as far I'm concerned it's fixed (if it was broken)

I will post my mount command for people in case it helps.

sshfs -o allow_other,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3,cache_timeout=3600 [email protected]:/home/user/ /mnt/sshfs/

Thank you @benhillis

EDIT: Forgot to add, you need to use allow_other and to do that you need to edit /etc/fuse.conf and uncomment allow_other there.

@gabrieldemarmiesse
Copy link
Author

I don't have a server to test the fix anymore so if you think the fix has landed @benhilis feel free to close this issue.

Thanks a lot.

@lil-greasy
Copy link

lil-greasy commented Dec 6, 2019

The command described by @EwolBash works for me, but when my computer sleeps and wakes back up again, SSHFS seems to be in a bad state. The mount can’t be read or unmounted and I have to kill the SSHFS process.

By the way, having SFTP capabilities built into Windows is a long-standing dream of mine and, for this and many other reasons, I’m so grateful to @benhillis and the entire WSL project. Thank you so much!

@EwolBash
Copy link

EwolBash commented Dec 6, 2019

How are you trying to unmount it? I'm assuming fusermount -zu /mnt/whatever

@lil-greasy
Copy link

lil-greasy commented Dec 6, 2019

Ah! I was trying to umount. (I’m new to FUSE.) I guess, as far as I can tell so far, everything is working as expected! This is very exciting!

I mean, I guess I still don’t understand why the reconnect option doesn’t keep the connection alive after my computer wakes up again, but maybe I’m just misunderstanding how it’s supposed to work, and I can probably work around that anyhow.

Thanks so much for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wsl2 Issue/feature applies to WSL 2
Projects
None yet
Development

No branches or pull requests

10 participants