Mapping Remote SSH to a Virtual Windows Drive Like gvfs on Linux

Booglejr | 10/07/2020
Mapping Remote SSH to a Virtual Windows Drive Like gvfs on Linux

If you've ever used gvfs on Linux and wished Windows enabled a similar ability by providing a virtual file system over SSH then you have come to the right place. This is an instruction guide demonstrating how to map to a remote drive over SSH in Windows.

NOTE: Before we begin I would like to make it clear that I wrote this guide to help people, but follow my instructions at your own risk.

What you need

  • Windows 10 (tested) or 8 (maybe?)
  • winfsp (link)
  • sshfs-win (link)
  • sshfs-win-manager (link)

Make sure to download stable versions of the software linked.

Getting Started

The following pieces of software should be installed in the following order: winfsp, sshfs-win, sshfs-win-manager. These should not take too long to install and you also should not have to reboot to begin using this software.

NOTE: Windows 10 will flag sshfs-win-manager as untrusted. Click 'more info' then click 'Run anyway'

Opening a Connection

So now you have the software installed. Let's make our first connection. Open up SSHFS-Win Manager. As you probably deduced we need to add a connection.

Open SSHFS-Win-Manager
Opening SSHFS

A window should pop up containing seetings for this new connection. If you have experience with SSH you should be able to fill this out pretty easily. That said, I have a picture for you anyway!

SSHFS Connection Properties
SSHFS Connection Properties

So I filled this thing out with some dummy values which I will replace when we get to the next step because ssh.dummyserver.com probably does not exist. After you have filled out your connection just click save. NOTE: Passwords are stored in plain-text. If dealing with a sensitive connection choose another Auth method such as 'ask at connection.'

Your connection should now be saved. And be visible but we still must see if it works. Click on the connection icon. Don't worry I still have images. :)

Click the connection icon.
Click the connection icon.

If everything works properly the icon will turn green and show a connected icon instead. A folder icon will pop up beside the first icon. Click the folder icon. Here's the image:

Click the folder icon.
Click the folder icon.

The folder icon should load the windows file explorer up showing the new mounted drive. Of course once the drive has been mounted there is no reason other than convenience to click the folder button. To put it simply, it is the fastest way after creating a new connection. But because the drive has was mounted upon connection you could have instead gone into the file explorer and clicked the drive labeled e.g. Z: and doing that would accomplish the same task. Here's my last photo showing you the file explorer in all of its glory.

The drive
The drive.

If you made it this far, then you are awesome and you should most definitely share this and leave comments or questions. And finally, you should star the repos for the software I linked, because the developers who made all this possible are also awesome. Have fun using native file system SSH on Windows. Until next time!

 

---

Update: Mounting in WSL

A reader attempted to follow my guide on his computer using WSL and while they were initially met with failure they found a workaround. I have included their instructions. After mounting the drive as shown above you will need to open WSL and run the follwing commands as root. Here we will assume we are mounting Z:

#This /mnt/z may or may not exist so we will create it.
mkdir /mnt/z
#And now we will simply mount the networked drive.
mount -t Z: /mnt/z

And that's it. Thanks to @uglyluigi for this helpful tip.

 

1 Comments

avatar




captcha

avatar

Grand Master Haa

said on 10-12-2020:

Sweet dizzle