Remote Drive Mapping (SMB Shares) on Windows and Mac

With this tutorial, you can “Map Network Drive” on Windows, or “Connect to server” on Mac, to securely mount a drive that is on a remote computer or server. The Diode Network tunnels your Windows box (or Linux or Mac) directly to the remote shared drive. No static IP address or VPN required.

This is handy if you want to provide multi-user access to the same files - such as in the case of a MS Access database.

If you have any questions, connect with us in our Telegram group!

#The moving pieces

  1. Remote drive - we’ll run this as a Samba share on a Linux box
  2. Local machine - a Windows box that wants filesystem access to a remote drive

#Remote Drive Setup

System: Ubuntu running on a Contabo VM

#Setup Samba

Basically, you can follow the instructions at: https://ubuntu.com/tutorials/install-and-configure-samba#1-overview. But, just to clarify, this is the step-by-step we did from a terminal:

At this point, your Samba share is up and running. If you have a static IP / LAN IP, you can skip down to Local machine setup if you want to sanity-check it and then come back here to continue on.

#Setup Diode

The steps below use diode publish -public. You may want to use diode publish -private to publish your Samba share not just via Diode tunneling, but only via Diode tunneling to specific authorized clients.

Basically, you can follow the instructions here. But, just to clarify, this is the step-by-step we did from a terminal:

At this point, your Samba share is up and running and accessible from anywhere in the world via its Diode Address. Now you can sudo ufw deny samba if you want to disable external IP-address-based access to Samba (recommended).

#Local Machine Setup

#MacOS

OK, super quick - on Mac, Finder allows you to specify a port for your network drives. So it is super easy to mount a network drive on Mac:

#Windows

Windows is not so helpful - it won’t let you specify a port to find a network drive on. And, it won’t allow you to bind port 445 - that is already taken by the selfish lanman. So, we’ll create our own loopback adapter on which no-one is using port 445, then port-map that to a normal localhost ephemeral port, and then bind that port to our remote server.

NOTE: 2024-October: According to https://techcommunity.microsoft.com/t5/storage-at-microsoft/smb-alternative-ports-now-supported-in-windows-insider/ba-p/3974509, it may now be possible to setup an alternative port for SMB and bind to that port!

For the next steps, you can do it via Powershell or via the UI. We’ll do it the Powershell way, although UI is arguably easier (see here for directional UI guidance).

Finally now we can connect to the remote server!

Windows will map your network drive and you can now access your remote drive.