Score:1

How to force Nautilus to use SMB3 on Ubuntu 22.04?

in flag

I have 1Gbs Ethernet but all Ubuntu 22.04 machines on it have speed 40MBs and fallback to SMB2. I verified network has 1Gbs with iperf, also Windows machines have normal 110MBs.

I also have 110MBs on Ubuntu when I mount Samba share manually with:

sudo mount -t cifs //192.168.8.1/crucial1tb-glinet ~/Desktop/smbshare

But when I use mount from Nautilus I have 40MBs. I installed sudo apt install smbclient and added this in /etc/samba/smb.conf but Nautilus ignores it, doesn't use it.

server min protocol = SMB2
server max protocol = SMB3 
client min protocol = SMB2
client max protocol = SMB3

I assume Nautilus uses some other samba client, I can see Nautilus mount only when I run gio mount -l and not when I run smbclient -L 192.168.8.1.

Where is the samba config that Nautilus uses or how to force Nautilus to use config from /etc/samba/smb.conf so I can set it to use SMB3 and have full 110MBs on 1Gbs network instead of current 40MBs?

Morbius1 avatar
es flag
If you have mounted with cifs unmount it. Then connect to the 192.168.8.1 share using only Nautilus. Now go to the 192.168.8.1 machine and run `sudo smbstatus`. The output will tell you which smb dialect you are connecting with. My guess is you are already using SMB3 via nautilus.
marko kraljevic avatar
in flag
`smbstatus` is from server package, I intend to use only client on this machine
Morbius1 avatar
es flag
And from you post 192.168.8.1 is the server. That is the machine you run smbstatus from.
marko kraljevic avatar
in flag
as I wrote above server can provide 110MBs on other clients so why would I then touch it
Score:1
es flag

I also have 110MBs on Ubuntu when I mount Samba share manually with:

sudo mount -t cifs //192.168.8.1/crucial1tb-glinet ~/Desktop/smbshare

ON THE CLIENT

First: Unmount that share:

sudo umount ~/Desktop/smbshare

Then open a terminal and run:

nautilus smb://192.168.8.1/crucial1tb-glinet

ON THE SERVER ( 192.168.8.1 ) run this command:

sudo smbstatus

The output of that command on the server will tell you how your client is accessing your share.

I will give you an example on my own network:

On my client ( vub2204 ) I will access my server ( vxub2204 ) via nautilus by running in a terminal:

nautilus smb://vxub2204.local/public

On my server ( vxub2204 ) I run the smbstatus command to find out how the client is accessing:

tester@vxub2204:~$ sudo smbstatus
[sudo] password for tester: 

    Samba version 4.15.13-Ubuntu
    PID     Username     Group        Machine                                   Protocol Version              
    ---------------------------------------------
    4581    (auth in progress)        192.168.1.154 (ipv4:192.168.1.154:38094)  SMB3_11                              -                    
    4578    nobody       nogroup      vub2204 (ipv4:192.168.1.154:52652)        SMB3_11

You will note that my client is accessing my server using SMB3_11. What I am suggesting is that you will see the same result.

It's not that Nautilus isn't using SMB3 it's the difference in how cifs mounts verses how nautilus mounts.

mount.cifs is controlled by the Linux kernel itself and does not reference the client side smb.conf to find out how.

Nautilus invokes gvfs ( gio ) which in turn invokes a samba client library ( libsmbclient ) which can reference smb.conf. GVFS has a lot of overhead so it's not surprising that a cifs mount is faster than a gvfs mount.

A Possible Workaround:

Add an entry to /etc/fstab to create an on-demand cifs mount of this share. Something like this:

//192.168.8.1/crucial1tb-glinet /home/marko/Desktop/smbshare cifs username=xxxx,password=yyyy,uid=marko,noauto,user 0 0
  • noauto == the share will not be mounted at boot
  • user == allows an ordinary ( non-sudo ) user the ability to mount the share.
  • uid=marko == makes you the owner of the mount.
  • And replace xxxx and yyyy with the true values.

What will happen after you enter that in fstab is a launcher icon will be created on the left side panel of Files that when selected will execute the fstab line and mount the share. This will allow you to mount the share as needed. The same icon can be used to unmount the share when it's no longer needed.

marko kraljevic avatar
in flag
You are right, here is output from my router with samba server. But it's no consolidation, the issue persists I have 40MBs instead of 110MBs, its just not SMB2 fallback as I assumed but file manager is broken by design. I tried Debian Gnome, Kubuntu, Mint, Xubuntu live iso's and they all have 40MBs issue in their file managers. Why is this so broken and how to get full speed? https://i.postimg.cc/0j9YYssJ/image.png
Morbius1 avatar
es flag
I don't know why GVFS has this problem or how to overcome it. All I can do is suggest a different approach. Please see my edit " A Possible Workaround" above.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.