Samba shares not accessible

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
palladio
Level 1
Level 1
Posts: 8
Joined: Sat Jan 19, 2013 7:43 pm

Samba shares not accessible

Post by palladio »

Linux Mint 20, Windows Network in the file explorer gives error dialogs, and smbtree reports "smbc_opendir: No such file or directory', despite this being a pristine new install. Simply put, Samba does not work.

I read dozens of posts on various fourms about how to go about fixing this, but nothing works, and the consensus seems to be that this is an issue with Samba not supporting SMB1 and bugs in gvfs on Mint and more.

I'd expect this basic sharing function to work out of the box in a current Mint. So, is this really broken, can it be fixed, and are there plans to address this in upcoming Mint updates? For now I have had to move over to Debian 11 where it just works straightaway, so that shows that in part this is certainly a Mint issue and not a problem with my network.

I'd offer to help fix it if I could, but it is outside my software development areas of expertise.

Linux Mint 20.3 Cinnamon, running under Virtualbox.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
ThaCrip
Level 5
Level 5
Posts: 988
Joined: Sat Dec 07, 2019 12:13 pm

Re: Samba shares not accessible

Post by ThaCrip »

I don't know your precise setup (like as far as Samba between Windows and Mint shares as this might complicate things a bit), but I can say Samba does work on Mint to Mint machines as the last I knew it was a bit easier to setup in Cinnamon than say Xfce. but on my machines running Mint v20.3-Xfce, here is basically what I did to get it working for example...

---On the machine you want to setup a shared folder, do the following five steps...

1)sudo apt install samba

2)sudo xed /etc/samba/smb.conf ; then for example you make it look similar to the following added to the end of the file (although obviously adjusted to your particular setup) and SAVE the file...

Code: Select all

[sambashare]
   comment = Samba
   path = /media/2TB_HDD/SharedFolder
   read only = no
   browsable = yes
NOTE: the "[sambashare]" you can tweak the name of this as this is what it will show up as from another machine! ; the 'read only' part basically tells you whether you got write access or not as if it's 'yes' you can only read data from there (i.e. you cannot delete/create folders/files etc). but if you want to create a folder or transfer a file to the computer that's sharing the folder you would have to change the 'yes' to 'no' and then, from another computer not running the samba server, you would then be able to create a folder or transfer a file to it etc.

3)sudo service smbd restart

4)sudo ufw allow samba (this step is ONLY needed if you enabled the firewall in Linux Mint, which I did)

5)sudo smbpasswd -a $USER
NOTE: it will ask you to set your password after this. so make sure you remember this and get it right.

then to gain access to that share from another machine on your local network... I typically go to the file manager, then... 'Network > Browse Network' and you can pretty much guess the general rest of this for the most part (as mine shows up as the name I named the PC I setup the share on (and it seems by default it shows 'Windows Network' to but I DONT use this one in my particular case)) as when you click on the main share you want to access it will have a 'Connect As' screen where you select 'Anonymous' or 'Registered User'. you want to select 'Registered User' and then basically enter the username/password (the password is what you setup in 'step 5' and 'username' should be the name setup on the machine that's running the samba server) to the machines share you want to access and then it should work as it does for me on my Mint v20.3-Xfce machines.

NOTE: if the firewall is on for both Mint machines I think you got to run "sudo ufw allow samba" on both machines. but by default the firewall in Mint is off. so if you did not enable the firewall in Mint, you can ignore 'step 4'.

p.s. but a easier alternative for basic file transfers from Mint to Mint machines is... Warpinator. this is almost certainly easier as that just tends to work (although if you enabled the firewall on Mint you will have to tweak Warpinator's options so it allows it past the firewall... 'Preferences > Connection > Update firewall rules'). on a side note... I mainly have Samba setup for use with Clonezilla (so I can save a image of a hard drive from my backup computer(s) to my primary PC through the Samba network share) etc. supposedly there is a unofficial windows version of 'Warpinator' to which you could look into if your mostly just concerned with basic file transfers between a windows machine and Mint machine.

on a bit of a side note... in regards to VirtualBox, off the top of my head(I could be wrong here), I think you need the 'guest additions' to get file transfers working... https://download.virtualbox.org/virtualbox/ ; assuming your using the newest one currently, go to '6.1.34' folder and get the 'VBoxGuestAdditions_6.1.34.iso' which I run on the Windows side of things if I recall correctly, although I generally run Windows in the VirtualBox program on my Mint system (so if your using Windows and running Mint inside of the VirtualBox machine things might play out a bit differently etc). but it's been a while since I played around with VirtualBox, so I kind of forgot a fair amount of stuff off the top of my head which is why I usually keep a log of anything I find to be important (which is how I remember how I setup Samba on my Mint systems with my '5 steps' above). or maybe something like the following might get you in the ball park... viewtopic.php?f=90&t=161782
Last edited by ThaCrip on Sun May 29, 2022 7:53 pm, edited 1 time in total.
MainPC: i5-3550 (undervolted by -0.120v (CPU runs 12c cooler) /w stock i3-2120 hs/fan) | 1050 Ti 4GB | 16GB (2x 8GB) DDR3 1600Mhz RAM | Backups: AMD E-300 CPU (8GB RAM) / Athlon X2 3600+ CPU (@2.3GHz@1.35v) (4GB RAM) | All /w Mint 21.x-Xfce
palladio
Level 1
Level 1
Posts: 8
Joined: Sat Jan 19, 2013 7:43 pm

Re: Samba shares not accessible

Post by palladio »

Thanks for such a detailed reply. But it's not what I was asking. In the file explorer on Mint you cant see anything under Windows Network, yet this works fine on Fedora and others,

I should change the title to Windows Network not visible. Sorry!
altair4
Level 20
Level 20
Posts: 11419
Joined: Tue Feb 03, 2009 10:27 am

Re: Samba shares not accessible

Post by altair4 »

palladio wrote: Sun May 29, 2022 6:31 am I should change the title to Windows Network not visible. Sorry!
That is a good idea since in all likelihood you can access the samba share you just can't discover ( see ) it. Those are two different things.
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
ThaCrip
Level 5
Level 5
Posts: 988
Joined: Sat Dec 07, 2019 12:13 pm

Re: Samba shares not accessible

Post by ThaCrip »

palladio wrote: Sun May 29, 2022 6:31 am Thanks for such a detailed reply. But it's not what I was asking. In the file explorer on Mint you cant see anything under Windows Network, yet this works fine on Fedora and others,

I should change the title to Windows Network not visible. Sorry!
I see. so basically if I understand you correctly you want to use the Mint system to access the share on Windows? ; if so, while I have not directly tested the following in that exact situation, I have played with it a little on a Mint to Mint system in which case even if it's not discoverable the following should work. I basically did the following to temporarily mount a samba share to a specific folder on your Mint system...

basically create a folder on your Mint system called 'share' for example in the home directory, then from terminal do the following...

Code: Select all

sudo mount -t cifs -o username=YourSambaUserNameHere //192.168.1.100/SharedFolderNameHere /home/USER/share
when you press ENTER it will basically ask for your usual password as you enter that, then you should see another thing asking for a password with something like "Password for user@192.168.1.100/SharedFolderNameHere:" at which point you enter the password you setup for Samba share.

NOTE: you run that from the Mint system since it's going to access the Windows share. but like I say I never directly tested Mint to Windows and I only did this on Mint to Mint.

but basically what that command does is mount your shared folder on the network to your 'share' folder you created in your Home directory on the Mint system. so when you access the 'share' folder on your Mint's home directory it should list all of the stuff in the shared folder from your network share. I just tested this again a moment ago and works fine, at least on Mint to Mint systems.

but to state the obvious you got to tweak the above command slightly to your particular setup accordingly. like the 'USER' in "/home/USER/share" needs to be changed to whatever yours is set as etc and you need to know the precise IP address of the computer running the samba server and change that "192.168.1.100" accordingly to your particular setup.
MainPC: i5-3550 (undervolted by -0.120v (CPU runs 12c cooler) /w stock i3-2120 hs/fan) | 1050 Ti 4GB | 16GB (2x 8GB) DDR3 1600Mhz RAM | Backups: AMD E-300 CPU (8GB RAM) / Athlon X2 3600+ CPU (@2.3GHz@1.35v) (4GB RAM) | All /w Mint 21.x-Xfce
Locked

Return to “Software & Applications”