Linux to linux file sharing, why is this so difficult??

Maximilian

Lifer
Feb 8, 2004
12,604
15
81
I have mint 17 on a home server, ive set up samba and shared 1 directory. My windows laptop can see it and access it just fine! The other linux desktop cant see anything. :eek:

Help?
 

BrightCandle

Diamond Member
Mar 15, 2007
4,762
0
76
The other Linux desktop also needs samba and presumably a GUI client. Many to choose from approaches, myself I tend to make a mount point but it can be done a lot of ways.
 

Maximilian

Lifer
Feb 8, 2004
12,604
15
81
Well turns out its working fine but its the same issue windows sometimes has where the icon just dosent appear.

I can access the share by manually typing the address into the address bar. Just did that and bookmarked the location, fixed forever :thumbsup:
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Try adding this to all the Linux boxes' smb.conf files:
Code:
name resolve order = bcast host lmhosts wins
The above definitely works when Windows is handling DHCP and DNS.

Inconsistent name resolution has been a long-standing problem with default configs (and worse, most "solutions" are to edit host files).
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Can the same command be used for Windows boxes?
No. They don't run Samba :D. With a Windows or Samba4 DC providing DNS and DHCP, the quoted line will let Linux and Windows boxes resolve that PC's address by name, with it running as a member. I'm not sure if the order is the correct one for a workgroup environment or not.
 

VirtualLarry

No Lifer
Aug 25, 2001
56,587
10,225
126
I have a similar issue with my Linux laptop. It runs Ubuntu 12.04 LTS. When I click on Network in the file browser widget, and then click on "Windows Network", then it always comes up with an error. It doesn't show the browse list. I haven't been able to access my unRAID, QNAP, or Seagate GoFlex Home CIFS/SMB shares.
 

mv2devnull

Golden Member
Apr 13, 2010
1,532
162
106
Can the same command be used for Windows boxes?
That is not a "command". That is a configuration.

When you say that you want to contact machine "Foo", your machine has to figure out who that is. Linux would try DNS or hosts-file. Samba, according to that configuration, will:
1. Broadcast to LAN: "Who is Foo?" (with SMB)
if that fails:
2. Look whether the hosts-file has entry for Foo
if that fails:
3. Look whether the lmhosts-file has entry for Foo
if that fails:
4. Contact WINS (Windows Name Server)
or fail.

In principle the Windows client has similar search rules. Then again, even MS has started to use DNS (I think).

Samba has at least two server processes: one for shares and one for names. They listen to multiple ports. That is not Samba's or Linux's fault.
 

F1shF4t

Golden Member
Oct 18, 2005
1,583
1
71
I have a similar issue with my Linux laptop. It runs Ubuntu 12.04 LTS. When I click on Network in the file browser widget, and then click on "Windows Network", then it always comes up with an error. It doesn't show the browse list. I haven't been able to access my unRAID, QNAP, or Seagate GoFlex Home CIFS/SMB shares.

I use IP addresses of the nas boxes to browse to them and then add the location to favorites. (I use static IPs)

Something like "smb://192.168.XXX.XXX/" or "smb://192.168.XXX.XXX/myshare"
 

Anteaus

Platinum Member
Oct 28, 2010
2,448
4
81
I opened this thread about this exact problem a while back and ended up solving it myself. Only required two small changes to the smb.conf, at least in my case.

http://forums.anandtech.com/showthread.php?t=2382307&highlight=

"I solved it on my own. It appears that security = share only works for Windows clients. I had to change it to security = user for my Linux client to work. Fortunately, that setting works for both. In addition I had to add client lanman auth = Yes."
 
Last edited:

bbhaag

Diamond Member
Jul 2, 2011
7,360
2,989
146
Try adding this to all the Linux boxes' smb.conf files:
Code:
name resolve order = bcast host lmhosts wins
The above definitely works when Windows is handling DHCP and DNS.

Inconsistent name resolution has been a long-standing problem with default configs (and worse, most "solutions" are to edit host files).

Were do I put this in the smb.conf file? I opened the file using the
Code:
gksu gedit /etc/samba/smb.conf
command but no matter where I put it it doesn't seem to make a difference. Is there a special syntax I need to use?
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
Thanks for the advice. This is for a home file server than isn't accessible outside of my intranet so I'm not worried much about it, but I'll make note for the future.

LanMan is also disabled on all recent versions of Windows, so it likely won't help you.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Were do I put this in the smb.conf file? I opened the file using the
Code:
gksu gedit /etc/samba/smb.conf
command but no matter where I put it it doesn't seem to make a difference. Is there a special syntax I need to use?
This is the smb.conf, sans comments, of the latest PC I had to deal with name resolution from other clients on (anonymized):
Code:
[global]
	workgroup = DOMAIN
	passdb backend = tdbsam
	printing = cups
	printcap name = cups
	printcap cache time = 750
	cups options = raw
	map to guest = Bad User
	include = /etc/samba/dhcp.conf
	logon path = \\%L\profiles\.msprofile
	logon home = \\%L\%U\.9xprofile
	logon drive = P:
	usershare allow guests = No
	idmap gid = 10000-20000
	idmap uid = 10000-20000
	kerberos method = secrets and keytab
	realm = DOMAIN.SUFFIX
	security = ADS
	template homedir = /home/%D/%U
	template shell = /bin/bash
	winbind offline logon = yes
	winbind refresh tickets = yes

	netbios name = HOSTNAME

	winbind use default domain = Yes
	winbind enum users = Yes
	winbind enum groups = Yes
	winbind nested groups = Yes
	winbind separator = +
   
	preferred master = no
	dns proxy = no

	name resolve order = bcast host lmhosts wins
Other Windows boxes could not access it by name, and other Linux boxes couldn't access it by name using smb:/ location names, until after adding the name resolve order line.
 

Cerb

Elite Member
Aug 26, 2000
17,484
33
86
Also, check resolv.conf. I just had to deal with a similar problem, and it took changing the auto-generated one to looking like so*:
Code:
search domainname.suffix
domain domainname.suffix
nameserver 192.168.1.1
nameserver 192.168.1.20
Chances are you don't have multiple DNS servers, of course.

Also, if your LAN is a .local domain, you need to stop Avahi, or change the suffix (on a home LAN, I'd change the suffix to .lan, but here at work, Avahi goes bye-bye, instead).

* Actually, it took Scott Alan Miller having the exact keywords I was searching for in a post on the issue that Google happened to have indexed, but that's the end result :).