Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Access file shares via VPN #46

Open
TheBestPessimist opened this issue Nov 3, 2017 · 9 comments
Open

Access file shares via VPN #46

TheBestPessimist opened this issue Nov 3, 2017 · 9 comments

Comments

@TheBestPessimist
Copy link

Hello,
Need a little help on this one:
I have an openvpn connection to my router (asus rt ac87u), which has connected a hdd via usb.
In solid explorer i can see the smb share, navigate, edit it, etc. with this app i cannot mount it no matter what.
Tried both smb://192.168.87.1/hdd and \\192.168.87.1\hdd and user&password. nothing works.

Is there anything i can to help you find/fix this issue?

Thanks.

@ttanxu ttanxu changed the title Cannot mount share, when connected via openvpn, although share is accessible via solid explorer Access file shares via VPN Jan 9, 2018
@aldasa
Copy link

aldasa commented Jan 10, 2018

Your router is running an old version of samba. You need to change the protocol to SMBv1.

@TheBestPessimist
Copy link
Author

SMB v1 should not be used anymore. Just like WEP, or CVS. (https://blogs.technet.microsoft.com/filecab/2016/09/16/stop-using-smb1/)
I am using smb v3.

@aldasa
Copy link

aldasa commented Jan 10, 2018

Is your router running custom firmware?

My Asus RT-AC51U, is running the latest official firmware and runs samba 3.0.37
Samba 3.6+ Is the first branch to include SMB2 support.

@TheBestPessimist
Copy link
Author

Using asuswrt.

Here: https://asuswrt.lostrealm.ca/features, you can find this:
Updated Samba version (3.6), with SMB2.0 support.

So it seems that i was wrong, and i am using v2, not v3.

@aldasa
Copy link

aldasa commented Jan 10, 2018

Maybe this won't help you, but when I VPN in, I get an IP in the 10.x.x.x range. The asus samba server is configured to accept connections in the 192.168.x.x range only, and will reject the connection. Again this is for the stock firmware.

@ubergeek77
Copy link

ubergeek77 commented Aug 23, 2018

I don't think this issue has anything to do with SMB version or IP address conflicts. I'm trying to do the same thing - use Samba Documents Provider to mount a SMB share through a VPN connection. It only works sometimes, and it doesn't appear to be very consistent. When it fails, it pops up with the mount failure message immediately after pressing the mount button, so it doesn't appear as though a connection is even being attempted. Definitely some weirdness here.

I was only able to get it to mount through a VPN twice out of the ~10 attempts, clearing the app data of this app each time to unmount the share. For whatever reason, this app doesn't like VPN connections. Even when I am able to mount it, disconnecting then reconnecting to the VPN causes the mount to fail permanently, and visiting the share via the system default file manager (accessible through "Storage" in settings) will simply show "No items," followed by "Can't load the content at the moment." Any app that is trying to use the mounted share as storage will crash when this happens, for example Titanium Backup which for some asinine reason does not have native SMB support after years of paid development.

I'm disappointed, because I wanted a way to use a single share at a single mount point, regardless of whether or not I'm on my home Wi-Fi connection, or my VPN. I have my own host redirection that will point to the appropriate IP address for clients on Wi-Fi and the VPN. For instance, samba.share will point to 192.168.1.100 for clients on Wi-Fi, and 172.17.0.21 for clients connected through the VPN, automatically allowing clients to access the share without needing to remember to change the IP.

That's not necessarily related to this issue, as the Samba Documents Provider SMB mount will fail permanently after a single VPN disconnect-reconnect (assuming you could even get it mounted in the first place), even if you manually specify the IP address of the share!

I'd love to fix this myself, but I don't even know what's going on here. Does the app establish a session that it only considers "valid" until the first disconnect? Does it apply some complicated hash to a connection? Is it an issue dealing with latency? No idea.

But I would like a solution (via this app or otherwise) that can give apps without SMB support access to my SMB share at a single mount point, and have it work no matter how many times the VPN is disconnected and reconnected. I can't be the only one wanting a solution like this.

I do have a rooted phone, and I've looked in to manual CIFS mounting, but unfortunately that requires a kernel module that I do not have (cifs.ko). My kernel doesn't have a config.gz file in /proc, so I can't compile one myself either. That would be the best solution for me, though, as I could easily mount and unmount the share via Tasker depending on which network I am connected to.

If anyone has insights on how to patch Samba Documents Provider to be more stable, and solve all these issues, I would personally greatly appreciate it, along with any other alternative solutions.

Edit:

I was looking through the forks of this repository to see if anyone had made any fixes. Interestingly, I found a commit that seemed at least somewhat related, being an address issue:

jmue@300c4f5

And this indeed went unfixed in this official repository, and is still present in the final 1.1 .apk made available online:

+ if (ifa->ifa.ifa_addr = NULL) {

I wonder if this is responsible?

@jmue
Copy link

jmue commented Sep 25, 2018

I just saw your comment. I don't know if my commit is related to your problem. If I remember correctly there were a compiler warning about this line. But did you try to build it with my commit?

@andrew-phi
Copy link

if (ifa->ifa.ifa_addr = NULL) {
WHAT THE HECK is this supposed to do!?! Fix the "=="!

@MaciejMalczyk
Copy link

Have same problems with mounting Samba remote by using ZeroTierOne VPN. The remote mounts fine once, but opening it again in Android DocumentsUi app (default file manager) is impossible.
The remote works fine when i mount it in local network. Have no problems with opening it by using VPN in KDE Dolphin file manager on PC.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants