Cannot mount Samba share

Status
Not open for further replies.

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
Hi everyone, I'm trying to mount a smb share on a macOS client. I have the following setup:
Screen Shot 2017-06-20 at 21.37.41.png
The storage is simple:
Screen Shot 2017-06-20 at 21.34.41.png
Screen Shot 2017-06-20 at 21.34.58.png
with Windows permission:
Screen Shot 2017-06-20 at 21.40.07.png
I have created a user with the relative groups:
Screen Shot 2017-06-20 at 21.34.21.png
Screen Shot 2017-06-20 at 21.34.30.png
I have configured the share as:
Screen Shot 2017-06-20 at 21.34.58.png
and the samba service as
Screen Shot 2017-06-20 at 21.35.14.png Screen Shot 2017-06-20 at 21.35.22.png

When trying to mount the share I get the following error:
Screen Shot 2017-06-20 at 21.35.38.png

Does anyone have any suggestion of why it doesn't work?
(I also trying using the Finder, but it doesn't work either).
Thanks everyone
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Mac? Not too familiar with OSX CLI. Perhaps try it without 'sudo' and include the workgroup in your command. mount -t smbfs mattia@freenas/Media ~/Desktop/test Alternatively, you can use 'open' open 'smb://mattia:password@freenas/Media'
 

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
Mac? Not too familiar with OSX CLI. Perhaps try it without 'sudo' and include the workgroup in your command. mount -t smbfs mattia@freenas/Media ~/Desktop/test Alternatively, you can use 'open' open 'smb://mattia:password@freenas/Media'
Thanks for your help. Unfortunately I get the same error
Code:
server connection failed: Socket is not connected

:(
 

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
Code:
[root@freenas ~]# testparm																										  
Load smb config files from /usr/local/etc/smb4.conf																				
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)														  
Processing section "[Media]"																										
Loaded services file OK.																											
Server role: ROLE_STANDALONE																										
																																   
Press enter to see a dump of your service definitions
																																   
# Global parameters																												
[global]																															
		dos charset = CP437																										
		server string = FreeNAS Server																							  
		lm announce = Yes																										  
		nsupdate command = /usr/local/bin/samba-nsupdate -g																		
		logging = file																											  
		max log size = 51200																										
		kernel change notify = No																								  
		panic action = /usr/local/libexec/samba/samba-backtrace																	
		pid directory = /var/run/samba																							  
		disable spoolss = Yes																									  
		load printers = No																										  
		printcap name = /dev/null																								  
		time server = Yes																										  
		map to guest = Bad User																									
		obey pam restrictions = Yes																								
		security = USER																											
		server role = standalone server																							
		deadtime = 15																											  
		max open files = 233705																									
		dns proxy = No																											  
		idmap config *: range = 90000001-100000000																				  
		idmap config * : backend = tdb																							  
		store dos attributes = Yes																								  
		strict locking = No																										
		directory name cache size = 0																							  
		dos filemode = Yes																										  
		acl allow execute always = Yes																							  
		ea support = Yes																											
		create mask = 0666																										  
		directory mask = 0777																									  
																																   
																																   
[Media]																															
		path = "/mnt/tank/Media"																									
		veto files = /.snapshot/.windows/.mac/.zfs/																				
		read only = No																											  
		vfs objects = zfs_space zfsacl streams_xattr aio_pthread																	
		zfsacl:acesort = dontcare																								  
		nfs4:chown = true																										  
		nfs4:acedup = merge																										
		nfs4:mode = special 
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Code:
[root@freenas ~]# testparm																										 
Load smb config files from /usr/local/etc/smb4.conf																				
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)														 
Processing section "[Media]"																										
Loaded services file OK.																											
Server role: ROLE_STANDALONE																										
																																  
Press enter to see a dump of your service definitions
																																  
# Global parameters																												
[global]																															
		dos charset = CP437																										
		server string = FreeNAS Server																							 
		lm announce = Yes																										 
		nsupdate command = /usr/local/bin/samba-nsupdate -g																		
		logging = file																											 
		max log size = 51200																										
		kernel change notify = No																								 
		panic action = /usr/local/libexec/samba/samba-backtrace																	
		pid directory = /var/run/samba																							 
		disable spoolss = Yes																									 
		load printers = No																										 
		printcap name = /dev/null																								 
		time server = Yes																										 
		map to guest = Bad User																									
		obey pam restrictions = Yes																								
		security = USER																											
		server role = standalone server																							
		deadtime = 15																											 
		max open files = 233705																									
		dns proxy = No																											 
		idmap config *: range = 90000001-100000000																				 
		idmap config * : backend = tdb																							 
		store dos attributes = Yes																								 
		strict locking = No																										
		directory name cache size = 0																							 
		dos filemode = Yes																										 
		acl allow execute always = Yes																							 
		ea support = Yes																											
		create mask = 0666																										 
		directory mask = 0777																									 
																																  
																																  
[Media]																															
		path = "/mnt/tank/Media"																									
		veto files = /.snapshot/.windows/.mac/.zfs/																				
		read only = No																											 
		vfs objects = zfs_space zfsacl streams_xattr aio_pthread																	
		zfsacl:acesort = dontcare																								 
		nfs4:chown = true																										 
		nfs4:acedup = merge																										
		nfs4:mode = special

Post output of getfacl /mnt/tank/Media. Also try increasing logging level under "services"->"SMB" to "Debug", try to connect, get the socket error, then post the contents of /var/log/samba4/log.smbd here. My hunch is that this is a client (OSX) problem. While you're at it, check for updates to your client OS.
 

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
Post output of getfacl /mnt/tank/Media.
Code:
[root@freenas ~]# getfacl /mnt/tank/Media/																						  
# file: /mnt/tank/Media/																											
# owner: mattia																													
# group: shared																													
			owner@:rwxpDdaARWcCos:fd-----:allow																					
			group@:rwxpDdaARWcCos:fd-----:allow																					
		 everyone@:r-x---a-R-c---:fd-----:allow 

Also try increasing logging level under "services"->"SMB" to "Debug", try to connect, get the socket error, then post the contents of /var/log/samba4/log.smbd here. My hunch is that this is a client (OSX) problem. While you're at it, check for updates to your client OS.
Attached the output of log.smbd. Also I can confirm that using an ubuntu VM on the same client mounts the share correctly. Any hints on how drill down the problem/workaround?
Thank you for your time and help!
 

Attachments

  • log.txt
    606.2 KB · Views: 375

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
It looks like your OSX client is negotiating a supported protocol, then stopping and sitting there. No attempt to authenticate (i.e. no SMB2 SESSION_SETUP messages). After one minute of sitting there, samba decides that the connection is pining for the fjords and kills its process deader with a SIGTERM.

Now the question is, why is OSX doing that? Perhaps it needs you to supply a password in the mount -t smbfs command. The OSX manpage has this example: mount -t smbfs //username:userpass@myserver/PUBLIC /smb/public

You can add the "fruit" VFS object to all of your shares (yes, all of them). This generally improves OSX support by providing support for SMB2 AAPL extensions. I believe the presence of these are determined during SMB2 TREE_CONNECT, which occurs after NEGOTIATE and SESSION_SETUP, and so this won't help your particular problem (but it will help with later problems you discover once you get authentication working). ;)
 
Last edited:

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
It looks like your OSX client is negotiating a supported protocol, then stopping and sitting there. No attempt to authenticate (i.e. no SMB2 SESSION_SETUP messages). After one minute of sitting there, samba decides that the connection is pining for the fjords and kills its process deader with a SIGTERM.

Now the question is, why is OSX doing that? Perhaps it needs you to supply a password in the mount -t smbfs command. The OSX manpage has this example: mount -t smbfs //username:userpass@myserver/PUBLIC /smb/public

You can add the "fruit" VFS object to all of your shares (yes, all of them). This generally improves OSX support by providing support for SMB2 AAPL extensions. I believe the presence of these are determined during SMB2 TREE_CONNECT, which occurs after NEGOTIATE and SESSION_SETUP, and so this won't help your particular problem (but it will help with later problems you discover once you get authentication working). ;)
Added the "fruit" attribute to the share (I have only one for now), restarted smbd and used the mount command with the password. Still no change, the command still returns "mount_smbfs: server connection failed: Socket is not connected".
Attached the new log.
 

Attachments

  • log.txt
    92.2 KB · Views: 337

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Added the "fruit" attribute to the share (I have only one for now), restarted smbd and used the mount command with the password. Still no change, the command still returns "mount_smbfs: server connection failed: Socket is not connected".
Attached the new log.

What version of OSX is this?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
If you go to the networking section in the finder can you see the shares and connect? You can also try the connect to server option under the main menu bar.

Sent from my Nexus 5X using Tapatalk
 

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
If you go to the networking section in the finder can you see the shares and connect? You can also try the connect to server option under the main menu bar.

Sent from my Nexus 5X using Tapatalk
I can see the share from the Finder, but if I try to connect using the "Connect to server" option in Finder, I can insert the credentials but tells me a generic error. I used the command line because at least it gives me an actual error ("mount_smbfs: server connection failed: Socket is not connected").
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I can see the share from the Finder, but if I try to connect using the "Connect to server" option in Finder, I can insert the credentials but tells me a generic error. I used the command line because at least it gives me an actual error ("mount_smbfs: server connection failed: Socket is not connected").
The error you are getting on the command line isn't a good message either. What happens when you connect in the finder? What error and what error when you use connect to server? Is there any AD(time sync issues?) or other things on your network that make this not a normal setup?

EDIT:
can you use the smbutil tool to debug stuff? Maybe try smbutil view //username@<server ip>

EDIT 2: You can also try making a guest access only share to see if that connects. This will rule out any auth problems.
 
Last edited:

mvalzelli

Cadet
Joined
Aug 19, 2015
Messages
9
The error you are getting on the command line isn't a good message either. What happens when you connect in the finder? What error and what error when you use connect to server? Is there any AD(time sync issues?) or other things on your network that make this not a normal setup?

EDIT:
can you use the smbutil tool to debug stuff? Maybe try smbutil view //username@<server ip>

EDIT 2: You can also try making a guest access only share to see if that connects. This will rule out any auth problems.
Even with guest enabled using "smbutil" gets the same error: "smbutil: server connection failed: Socket is not connected"
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Even with guest enabled using "smbutil" gets the same error: "smbutil: server connection failed: Socket is not connected"
Give full details of your network topology. Turn off firewall. Perform a packet trace from the OSX client. You can probably restrict the pcap to only traffic to/from the FreeNAS server by adding "host <ip of freenas>" to the tcpdump command.
 

Warhammer

Cadet
Joined
Aug 22, 2017
Messages
1
Hello all. I have the same problem. SMB share mounts from Win10 but doesn't want from MAC OS X Sierra 10.12.6. QQ to topic starter. Had you resolved your problem?
 
Last edited:
Status
Not open for further replies.
Top