← all posts site ↗

mounting a windows drive on linux over tailscale

my ai agent runs on a linux server. my code lives on a windows desktop. when i asked the agent to read a file on my windows machine, it told me it could not because there was no network path. that is a fixable problem.

the setup is simple in theory. share a folder on windows, mount it on linux over tailscale using smb, and now the agent sees the windows drive as a local path. in practice there is one trap that ate an hour of my time: windows hello pin does not work for smb authentication. smb needs an actual password, and on windows eleven with a microsoft account login, your pin is device-only. the pin authenticates you to the local machine, not to the network. if your microsoft account uses two-factor authentication, you need to create an app password specifically for smb. i did not know this and spent a while trying passwords that the pin manager was never going to accept.

the alternative is even cleaner but requires more setup. install openssh server on windows, which is built into windows eleven as an optional feature, and mount the drive over sshfs instead of smb. ssh keys work where passwords fail and you get encryption for free. the downside is that sshfs is slower than smb for bulk file operations, but for reading source code and transferring apk files it is perfectly fine.

once the mount works, the rest is automation. create a credentials file so the password does not appear in logs or process listings. add an entry to fstab so the mount survives reboots. if you are on tailscale, the mount target is the tailscale ip of the windows machine, which is stable as long as both devices stay on the tailnet. and then write a small translation function so that when you paste a windows path the agent automatically converts it to the mount point. after that it is invisible. the agent just reads the file.