# FreeBSD 11.3 mount network share



## marcus123 (Mar 26, 2020)

I would like to mount network share folders (Synology NAS, and Windows 10) from my FreeBSD 11.3, is mount_smbfs the only way?

but it seems mount_smbfs still only support SMBv1, any alternative way to mount them in SMBv2 / SMBv3?

would installing samba4 on FreeBSD help?

Thanks


----------



## Zvoni (Mar 26, 2020)

I have a Gluster-Volume running on 2 servers with 4 HD's in total, exported via Samba410 as a network-share.
I mount it with cifs in my fstab (not smbfs). I've seen working mount-examples with fusefs, but that didn't work for me for a reason (permissions)


----------



## SirDice (Mar 26, 2020)

marcus123 said:


> I would like to mount network share folders (Synology NAS, and Windows 10) from my FreeBSD 11.3, is mount_smbfs the only way?


Doesn't the NAS support NFS?


----------



## marcus123 (Mar 26, 2020)

Maybe, I will check it.  If so, is below correct?

Assume 192.168.1.123:/usr/local/downloads  is the share folder I need to mount:

```
echo 'nfs_client_enable="YES"' >> /etc/rc.conf

service nfsclient start

mkdir /mnt/test

mount -v 192.168.1.123:/usr/local/downloads /mnt/test
```


I have seen someone on Internet using below, but not sure whether it is necessary:

```
mount -t nfs -o nfsv3,nolockd 192.168.1.123:/usr/local/downloads /mnt/test
```


----------



## SirDice (Mar 26, 2020)

The first command should be fine, there's rarely a need to force NFSv3.


----------



## Zvoni (Mar 26, 2020)

In a *testrun *using mount -v i'd explicitly set "-o rw" just to make sure there is no issue with read/write


----------



## marcus123 (Mar 26, 2020)

thanks all, btw, how to mount window share? I have tried below but no luck...

192.168.1.123:/share is the share folder on win10, it's set to share to Everyone (i.e. any users)


```
mount -v 192.168.1.123:/share /mnt/test
```

do I need to set something on win10 first?  any hints is welcome


----------



## SirDice (Mar 26, 2020)

On Windows SMBv1 has been turned off completely. You can turn it back on but I really don't recommend doing that because there is malware abusing the issues inherent with SMBv1 (which is why Microsoft turned it off).

And it looks like you're trying to NFS mount an CIFS/SMB share, that's not going to work for obvious reasons.


----------



## Zvoni (Mar 26, 2020)

marcus123 said:


> thanks all, btw, how to mount window share? I have tried below but no luck...
> 
> 192.168.1.123:/share is the share folder on win10, it's set to share to Everyone (i.e. any users)
> 
> ...











						How to set up network file sharing on Windows 10 - Pureinfotech
					

You can share files on Windows 10 in many ways, and here you'll learn to share files and folders using File Explorer, Homegroup and OneDrive.




					pureinfotech.com
				



It's also in the Link: Do you have Password-authentication turned off on your Windows-Machine?


----------



## zirias@ (Mar 26, 2020)

It's unfortunate, but FreeBSD is currently not usable as an SMB client. AFAIK, mount_smbfs is the only option you have, and as SBMv1 is dead in practice, there's no use ...

The only sane option ATM is to use NFS instead. Windows servers support NFS, for other Windows systems, you can install 3rd party NFS services.


----------



## SirDice (Mar 26, 2020)

Zirias said:


> Windows servers support NFS


Workstation versions too but I do believe you need, at least, the professional edition, home doesn't support it.


----------



## Zvoni (Mar 26, 2020)

Here seems to be a workaround using gvfs
_View: https://www.reddit.com/r/freebsd/comments/9z5p2b/mounting_smb_v2v3_shares_gvfs/_


----------



## zirias@ (Mar 27, 2020)

Zvoni said:


> Here seems to be a workaround using gvfs


See this quote from the thread over there:





> So, everything OK? Not quite. The performance of the chain fuse->gvfs->smb is very poor. If you have many small files - like I have with a Maildir - you wait ages for file operations to be finished.
> 
> Now I ended up using sshfs. It is also a fuse based filesystem, but a lot faster than using gvfs (which seems to be the bottleneck in the chain mentioned above).


Doesn't sound like a workaround to me. If even sshfs works faster, this must pe practically unusable.


----------



## Zvoni (Mar 27, 2020)

Agreed.
In that case....ahhh....well...then


----------



## marcus123 (Mar 30, 2020)

Thanks all, I hope FreeBSD would consider to add support for mounting SMBv2 / SMBv3 share


----------



## zirias@ (Mar 30, 2020)

That would be nice ideed! I guess, as always, "somebody has to do it"  For me personally, it was much simpler to provide my shares via NFS as well, so Windows clients use SMB and FreeBSD clients use NFS.


----------



## kpedersen (Mar 30, 2020)

I would enable SMBv1 on your Windows machine but use the firewall to block it (port 139 and 445).

(Actually, on Windows block everything but the programs you need, then you can avoid the telemetry and consumer "updates", creating a much more deterministic and secure install).

Set up a SSH server on your windows machine and allow it through the firewall (port 22 incoming).

Now to connect, first set up a tunnel to your server:
`$ ssh -L1445:localhost:445 <your_ip>`

You can now use mount_smbfs on localhost, like it was on your server.

`# mount_smbfs //<username>@localhost:1445 <mountpoint>`

Remember to use the gpedit.msc firewall instead of the normal one because programs can change the normal one and allow their DRM/telemetry through.

If you set up SSH with passwordless access (priv/pub keys) and you might as well do the same with your SMB server because only local users (or authenticated SSH users) can now access it, you can create a script to mount it at start up.


----------



## aw256 (Jun 7, 2021)

I wanted to add the NFS shares are a no-go for Synology volumes when encrypted. Given that, plus the fact that smb doesn't seem to work in FreeBSD, and every fusefs project that I tried failed silently, we seem to be SOL for mounting synology shared folders on FreeBSD.


----------

