I just had the problem where gvfsd-smb-browse
starts taking up the whole cpu and needs to be killed. Searching the Internet I see this is not uncommon, and there doesn't seem to be a general solution. As I do not use samba I would like to just remove gvfsd-smb-browse
; but it is installed with the larger package gvfsd-backends
that I probably do not want to remove. Is there a way to get rid of it?

- 251
-
Related question with unfortunately only backend-specific answer: https://askubuntu.com/questions/1285637/gvfs-how-to-disable-a-certain-backend – anx Oct 26 '20 at 14:25
3 Answers
I was having the same issue after upgrading to 16.04. What I did was change the permissions on gvfsd-smb-browse so that it can only be executed as sudo or by root. Now gvfsd-smb-browse doesn't run on startup. Below is how you can change the permissions.
sudo chmod 744 /usr/lib/gvfs/gvfsd-smb-browse
Not sure if it is a real solution to the underlying problem. But it does resolve the cpu usage issue by not running gvfsd-smb-browse on startup.

- 201
-
That's an interesting solution. I considered simply deleting it as well. Does it serve a useful purpose that you wanted to keep it around for? Also, what happens when
gvfsd-backends
is upgraded -- do the permissions get reset? – Mike Shulman Apr 26 '16 at 19:06 -
Well it is a virtual file system, and is pretty much used everywhere for mounting devices etc. So it won't be a good idea to remove it. This particular file "gvfsd-smb-browse" is used to browse windows file system, so if you are not mounting windows volumes on startup then there is no need to run it. – Kamran Apr 26 '16 at 22:09
-
What happens when gvfsd-backends is upgraded -- do the permissions get reset? – Mike Shulman Apr 27 '16 at 15:42
Well, The upstream package didn't set up a configuration file or folder. I think these folders are more suitable to be somewhere in /etc
/usr/share/gvfs/mounts/
/usr/share/gvfs/remote-volume-monitors/
Or have at least an override there. Anyway let's make one.
sudo mkdir -p /etc/gvfs/enabled
sudo cp -ar /usr/share/gvfs/mounts /etc/gvfs/enabled
sudo cp -ar /usr/share/gvfs/remote-volume-monitors /etc/gvfs/enabled
echo 'export GVFS_MONITOR_DIR="/etc/gvfs/enabled/remote-volume-monitors/"' | sudo tee /etc/profile.d/gvfs.sh
echo 'export GVFS_MOUNTABLE_DIR="/etc/gvfs/enabled/mounts/"' | sudo tee -a /etc/profile.d/gvfs.sh
sudo chmod +x /etc/profile.d/gvfs.sh
Now, you have full control:
- Disable: remove/rename back-ends & monitors definition files from
/etc/gvfs/enabled/mounts/
&/etc/gvfs/enabled/remote-volume-monitors/
respectively. - Enable: copy back from origin or rename back (
.mount
&.monitor
extension)
I have tested these instructions in Ubuntu 20.10, only with monitors for quick test (ps ax | grep -i gvfs
).
Reference:

- 48,105
There is a similar question where the workaround is to edit your smb.conf
like in Launchpad bug #1409032.
It worked for me reducing CPU usage and really sped things up!
I just put this line under the globals
statement after backing up my /etc/samba/smb.conf
file:
[global]
name resolve order = wins lmhosts bcast
Note: wins is no longer necessary on the majority of systems, especially those after the year 2000.

- 36,264
- 56
- 94
- 147