I am a novice Linux user. I have a Raspberry Pi 4 and have used Raspbian on it and have had no problems accessing my Windows 10 files shares. I wanted to try Ubuntu to see how it compares. I tried the Kbuntu version and had no luck so I switched to Ubuntu Server 20.04 and then installed Ubuntu Mate on it. Everything seemed fine. I then wanted to try the file sharing part of things and so my first step was to install Samba which seemed to go fine. However, I still cannot get to my Windows 10 file shares. I have SMB installed on the Windows machine. I keep getting the error that it "cannot retrieve file shares: connect connect to server". I have looked everywhere for a good, comprehensive set of instructions on the pieces that need to be installed, how to configure them, etc. I find bits and pieces but nothing that seems to give me the whole picture on both ends. Any help will be gratefully appreciated.
2 Answers
You have a bit of work to do if you expect to "discover" then "connect" to a Windows 10 machine from Ubuntu 20.04.
In Win10 you have to have SMB 1.0/CIFS Server
enabled.
In Ubuntu 20.04 you have to enable SMB1 on the client side. You do that by editing /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:
client min protocol = NT1
( Samba calls smb1 NT1 just to confuse people )
You could restart smbd: sudo service smbd restart
But the best thing to do is just reboot.
Reason: The version of Samba in Ubuntu 20.04 disables SMB1 on both the client and server side just like Win10 does. Without SMB1 there is no NetBIOS discovery or name resolution.
The alternative is to leave Ubuntu and Win10 alone and access the Win10 machine and it's share directly using mDNS ... or by ip addresss:
In the Location bar of caja enter the mDNS network path to your Win10 machine and it's share - don't forget the .local at the end.
smb://win10-host-name.local/share-name
mDNS in Linux is called Avahi and Ubuntu server doesn't install it by default. I don't know if installing MATE over the server brings it in so just to be sure install it manually:
sudo apt install avahi-daemon

- 7,761
-
-
-
Thanks for the help. Here is where I am now. I have installed samba and suggested pieces using "sudo apt install samba". I modified the smb.conf file as suggested. I have the SMB/CIFS 1 Server enabled on Win10. I have rebooted the Ubuntu machine and Win10 box. The share on the Win10 machine is setup so that my admin account has Full Control and Everyone has Read/Write. I cannot get to it by browsing thru Caja. It sees the computer but still get the same error. I then checked and avahi-daemon was installed. I tried the smb://MACHINENAME.local/sharename . No luck. Help/ – JohnW May 26 '20 at 14:59
-
When you enter smb://MACGINENAME.local/sharename in caja you should be asked for credentials to access the Win10 share. What happens after you supply those credentials? Error message? – Morbius1 May 26 '20 at 15:51
-
Guess what? when I went to reproduce the problem it is now giving me access!!! Woo hoo!!! Thanks so much. I used the smb://.... approach again and it all seems fine. – JohnW May 26 '20 at 16:31
I've tried a lot of available guides online, and only the guide provided here has worked in my situation. The crucial step for me was to open TCP ports 139 and 445 and UDP ports 137 and 138, because smbd and nmbd programs used by samba listen on these ports. The command to open ports
sudo ufw allow samba

- 1
-
Samba ist the file server, as far as I understood you want to access files from another machine (Windows). For that you need to install 'apt install smbclient'. Go for mount cifs share in Google. – Thomas Aichinger Dec 07 '20 at 20:14
cifs
: https://askubuntu.com/a/1313854/1157519 – Levente Oct 01 '22 at 20:27