Experimental repo to provide SSHFS to Mac WITHOUT installing macFUSE and patching the kernel with a custom kext.
Remote filesystem is mounted in container via SSHFS and exposed to Mac via Samba.
Note: It is highly recommended to use OrbStack. Docker Desktop will not work for this without modifying the network routing.
The standard Docker volume mounts won't work for this purpose because they are designed for local file systems and do not natively support SSH-based file system connections. The sshfs-mac-docker solution uses SSHFS to overcome this limitation, allowing remote file systems to be mounted inside Docker containers as if they were local volumes, which is not achievable with Docker's standard volume mounting features.
docker build -t docker-sshfs .
In one terminal shell, run:
docker run --privileged --name docker-sshfs -p 127.0.0.1:139:139 -p 127.0.0.1:445:445 docker-sshfs
Samba is configured to listen on ports 139 and 445 and is accessible only from localhost.
In another terminal:
docker exec -it docker-sshfs bash
You'll be dropped into the container at this point.
Run (replacing user@host:path
with your SSHFS endpoint):
sshfs -o allow_other,uid=1000,gid=1000 user@host:path /samba-share
allow-other is needed to be able to access via mac samba uid=1000,gid=1000 is needed for write-access (otherwise, it will be read-only if omitted)
- Find Docker IP of container (localhost doesn't seem to work for this)
docker inspect --format '{{ .NetworkSettings.IPAddress }}' docker-sshfs
-
Navigate to Finder -> Go -> Connect to Server
-
Enter `smb://ip-of-docker-container``
If all goes well, connect as
Guest
. -
Open
Finder
, navigate toNetwork
tab, find the IP of the Docker container, and you should now have access to remote files
If wanting to unmount the SSHFS endpoint (without stopping the container):
fusermount -u /samba-share
If getting message
fusermount: failed to unmount /samba-share: Device or resource busy
...unmount the drive from Finder (or just stop the container)
Maybe this will work instead: https://github.com/macos-fuse-t/fuse-t