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

WSL 2 alternative to SFTP Net Drive using SSHFS #91

Open
aryarm opened this issue Jan 20, 2020 · 1 comment · May be fixed by #92
Open

WSL 2 alternative to SFTP Net Drive using SSHFS #91

aryarm opened this issue Jan 20, 2020 · 1 comment · May be fixed by #92
Assignees

Comments

@aryarm
Copy link
Collaborator

aryarm commented Jan 20, 2020

WSL 2 ships with FUSE support! Thus, in theory, it should be possible to use SSHFS on WSL 2 to mount a remote, ssh-accessible directory as a drive in Windows. This could serve as a replacement to SFTP Net Drive on Windows.

Unfortunately, there is a specific set of options that must be passed to sshfs when mounting a directory. In addition, users of sshfs will need to execute a couple cleanup commands to ensure the directory is correctly detached upon exit.
It would be great if we could create a function/alias that would do all of this for us automatically...

@aryarm
Copy link
Collaborator Author

aryarm commented Jan 20, 2020

Ok, I made a first attempt. The code is in commit 781d0f3

Still to do:

  • warn the user that they have to enable the user_allow_other config option in /etc/fuse.conf
  • handle cases where that directory already exists
    You could create an argument for the dir name
  • test it with hostnames that aren't already present in the user's ssh config (or handle that case somehow)
  • handle sshfs (or ssh?) not being installed
  • consider merging the sshopen command with the regular open command? (related to wsl open cmd overrides default open cmd #90)
    • Actually, on second thought, I think it would be better to keep them separate, so that we can replace or remove the regular open command in the future
  • test the sshfs options and make sure they're how you want them
    • namely, there seem to be some problems with how often things are synced with the remote server. So we should make that happen more frequently
  • document somewhere that after executing the command, users will need to open the mounted directory in windows file manager themselves
  • consider changing the arguments so that sshopen becomes more of a wrapper around sshfs, exposing all of its functionality to the user
    • update 8/21: I'm thinking that this will require too many changes to the code at this point; so let's just leave it as it is for now
  • perform everything within a subshell, so that we can tear things down when the subshell exits instead of the terminal's exit
    • update 8/21: actually, I've kinda liked the idea of exiting with the terminal, tbh - and it's gonna be a lot easier than trying to create a subshell
  • don't automatically cd into the mount

@aryarm aryarm self-assigned this Jan 21, 2020
@aryarm aryarm linked a pull request Oct 27, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant