How to disable gvfs?

18 risposte [Ultimo contenuto]
Sunny Day
Offline
Iscritto: 01/05/2023

Could anyone help with this question please?

I want to clean up my system of unused parts that are just using resources and driving me bonkas, specially things like gvfs (rotten fruit conduit, plus more).

Also would like to learn if there is any part of gvfsd that is necessary for operating a local system.

With many pre-thanks :)

Avron

I am a translator!

Offline
Iscritto: 08/18/2020

> I want to clean up my system of unused parts that are just using resources

If you install a window manager (ctwm, fvwm, openbox, dwm, or whatever) and start a graphical session with it, I suspect you will have a much more minimal system running.

I have recently become a big fan of dwm (but I mostly use it in a MATE session). The drawback of using a session only with a window manager is that you have no graphical configuration menu, like for screen resolution, you need to find commands or tools for any setting you need.

To make a system on your own, Parabola could also be a nice distro to try. It is typically documented for that (but you may have to look at Archlinux wiki that is more complete).

> if there is any part of gvfsd that is necessary for operating a local system.

I am not sure but gvfs might be needed to automatically mount USB disks that you insert. However, it is not difficult to mount them with a mount command as root in a terminal. I don't know whether udisksctl will work or not.

Sunny Day
Offline
Iscritto: 01/05/2023

Thank you for the great suggestions and info Avron! Feels good to have options.

Thank you also for mentioning distros that I could make my own, and for listing window managers to try. I never installed a window manager before, so could be a good opportunity to learn. I have questions about this, but will keep that for later.

I saw another interesting solution on a thread from a few years ago and wonder if it would do the job without harming the system. I'll paste it here and would love to hear your thoughts.

Copied from https://unix.stackexchange.com/questions/38109/what-is-gvfs-and-why-should-i-want-it-on-my-system

So I came to this solution: I block the daemons from starting and when I need them a enable them:

systemctl --user stop gvfs* # stop all services with gvfs
sudo kill $(ps -A | grep gvfs | awk '{print $1}') # to be sure GVFS is not running
sudo chmod 0000 /usr/lib/systemd/user/gvfs* # this prevent GVFS from starting
lsof | grep gvfs # but it has many open files anyway...

When I need GVFS again so i run following code and reboot for sure:

sudo chmod 0644 /usr/lib/systemd/user/gvfs* # this enables GVFS again

Sunny Day
Offline
Iscritto: 01/05/2023

Avron, I was re-reading what you wrote about automatically mounting USB, you were right, it doesn't happen after removing gvfs.

I also found a couple of light weight window managers (with Synaptic), but uninstalled them, as I wasn't quite sure what to do with them... it is all a bit cloudy, but very exciting though :)

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Does GVfs actually malfunction on your system, as it does on that of the StackExchange's user? Here, four hours after I started my session, the gvfs* processes have altogether taken fewer than 2.5 seconds of CPU time and 25 MB of RAM. It is nice to have a remote folder (accessed through SSH in my case) opened in one click in the file manager (Nautilus in my case).

EDIT: seven hours after logging in, those numbers have become ~4 seconds and 26 MB.

Sunny Day
Offline
Iscritto: 01/05/2023

Not sure if I can call it malfunction, Magic Banana. There are errors because of blocked connections and disabled services, but that is OK, as intended... the problem for me is the number of unwanted processes that keep on running. It would be great if I could shut up the redundant processes for good and keep only what I need.

I would love to configure my system as completely standalone, have even made a name for it - Trisquelo (for Trisquel Local :)

What do you think about the solution from the StackExchange's user?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

What do you think about the solution from the StackExchange's user?

The second command looks useless, because the first one should have done the job, except that there is apparently no gvfs* service on Trisquel 11. That second command is uselessly complicated too (equivalent to one single killall). More importantly, I would certainly avoid changing the permissions of system files.

I searched the Web a little. As far as I understand, D-Bus starts gvfsd when an application requests it and there is a so-called "ugly hack" (still nicer than changing the permissions of system files!) to avoid that: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=544148#15

Or remove all the gvfs* packages, as prospero proposed.

Sunny Day
Offline
Iscritto: 01/05/2023

Thanks for clarifying the info in the StackExchange thread, Magic Banana!

More importantly, I would certainly avoid changing the permissions of system files

Yes, I understand what you said, the use of permissions made me question that solution. Happy you said it so clearly.

I checked the link you posted and think you are right, Prospero's suggestion of removing gvfs packages looks the best way to go. Could I do a backup before hand and, if there was any problem, put everything back as it was?

There are things that annoy me no end with gvfs, I found system files where the rotten fruit was trying to connect (!?!), as well as others just as repulsive to me. Bare in mind that I never used the fruit cloud, but the hackers of my previous system did it, imagine that!

I blocked, disabled and masked avahi, smb, etc and was relieved when reading about their failures... they failed to connect again and again and again... boy, they tried, so many times that I decided to remove annoying failures and any mention of those corporations from my computer. If I wanted to access a cloud storage, I could do it with Abrowser while keeping them out of my system. Happy to say I used Abrowser to rescue files from Goggle Drive and it worked like a charm.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

Could I do a backup before hand and, if there was any problem, put everything back as it was?

I do not see how removing the gvfs* packages would put the user data at risk, but you want to back them up regularly anyway! Doing a backup of the system is not much useful. If you want, you can copy the list of installed packages, for instance using the Synaptic package Manager, as explained on https://trisquel.info/en/wiki/cloning-system-or-how-make-copy-installed-packages-one-computer-another

In the short term, the logs in /var/log/apt should be enough though, if you change your mind and want to know what packages to reinstall.

Sunny Day
Offline
Iscritto: 01/05/2023

I do not see how removing the gvfs* packages would put the user data at risk

Great!

In the short term, the logs in /var/log/apt should be enough though, if you change your mind and want to know what packages to reinstall.

Always learning from you Magic Banana - THANK YOU!

https://trisquel.info/en/wiki/cloning-system-or-how-make-copy-installed-packages-one-computer-another

And this, which I've put into practice thanks to the guide you wrote!

----
EDIT:
One last question, how about mounting disks after gvfs is gone?

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

One last question, how about mounting disks after gvfs is gone?

I believe local filesystems (including on removable ones such as USB sticks) will still be automatically mounted... but you will tell us. I have never removed GVfs. For remote filesystems, you will need dedicated programs, such as FileZilla that prospero recommended.

Sunny Day
Offline
Iscritto: 01/05/2023

More good news and more thanks to you Magic Banana!

I believe local filesystems (including on removable ones such as USB sticks) will still be automatically mounted... but you will tell us

Hope to find out soon and will let you know for sure!! I'm building confidence to do remove gvfs completely, but feel I am almost there now.

For remote filesystems, you will need dedicated programs, such as FileZilla that prospero recommended.

Yes, that was great to hear and I'll probably be hunting more dedicated programs as the need arises.

thank you all, it feels like I am getting nearer and nearer to a prototype of Trisquelo :)

Sunny Day
Offline
Iscritto: 01/05/2023

Magic Banana, it took a little while to report back, but I'm glad to say it's done :)

I decided not to risk removing gvfs from my main drive and made a clone (or quasi-clone) for the purpose (your guide was really helpful). Things went well and the computer is blissfully quite, but there are a few hiccups:

- First, external drives don't seem to mount (are invisible), but 'Disks' sees them and I used it to power down drives before removing them safely.

- Second, there is no file manager. My files can't be opened in GUI, unless I click on 'Places' (in the panel) which opens the files with kid3... it's odd and funny, but I feel lucky I had kid3 installed, as there is no alternative available (yet).

I found a file manager that seems to do what I am looking for:

SLiM (info from Synaptic):

"desktop-independent graphical login manager for X11

SLiM aims to be light, simple and independent from the various
desktop environments. Although completely configurable through
themes and an option file. It is particularly suitable for machines
that don't require remote logins."

When installing it, a pop up window asks to select the default display manager, SLiM or lightdm. I wasn't sure and ended up uninstalling it.

Do you have any suggestions or comments on this file manager? Or another one, perhaps, that is also light weight? (I am using MATE)

I think that is it so far, but I have just started testing.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

- First, external drives don't seem to mount

I believe you should still be able to mount a device with udisksctl, in a terminal. For instance, to mount /dev/sdb1:
$ udisksctl mount -b /dev/sdb1

For auto-mounting, https://unix.stackexchange.com/a/746305 suggests "GVFS on GNOME and most other GTK+ desktops [or] KIO on KDE" is needed, unless the filesystem is statically known, with an entry in /etc/fstab. For those, systemd's auto-mounts is a possibility.

I searched a little more. There seems to exist a (niche) solution that does not rely on GVfs: SpaceFM with udevil. Both are in Trisquel's repository. At least the description of the spacefm package promises:
(...) device management featureful enough to replace the various udisks-based *kits when used alongside udevil.

SpaceFM and udevil, from the same authors, look abandoned. Their codes were last modified five years and eight years ago, respectively:

Second, there is no file manager. My files can't be opened in GUI, unless I click on 'Places' (in the panel) which opens the files with kid3.

The ID3 tag editor for KDE?! What happens if you execute caja (MATE's file manager) from the command line?

I found a file manager

As the description you posted says, SLiM is a "graphical login manager". It is not a file manager.

Do you have any suggestions or comments on this file manager? Or another one, perhaps, that is also light weight?

As I wrote above, SpaceFM with udevil may be what you are searching for. That said, if most file managers have chosen to rely on GVfs, it is certainly because it is a good solution. If you do not face any problem with GVfs, why rejecting it?

Sunny Day
Offline
Iscritto: 01/05/2023

Thank you Magic Banana! For all!!!!!!

You are right again :)

If you do not face any problem with GVfs, why rejecting it?

I see what you mean, GVfs seems to be the only way to go, and am glad I used a test drive to remove it.

You are right about SLiM too, my bad! I was searching for file manager in Synaptic and my hopeful thinking blinded me.

I did a bit more searching for standalone/local desktop environment alternatives, but it seems there is none. The obligatory parts (external) are always there. I wonder why they are obligatory though.

Now, back on my main drive (with GVfs untouched) I am doing just one more test - I removed caja-share. That was the only change in Caja, so I expect everything will work as usual (and smb will be properly disabled). Please enlighten me if you think this is a bad move, for any reason.

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

I see what you mean, GVfs seems to be the only way to go, and am glad I used a test drive to remove it.

Well, GVfs is not "the only way", since KDE uses KIO instead.

I wonder why they are obligatory though.

Imagine you are developing a file manager. You want it to be able to browse the files on a removable device (without administrative privileges and even if it has never been inserted), those on a remote filesystem (accessed through FTP or SFTP or SMB or...), etc. After all, essentially all the file managers for GNU/Linux have those features! Either you spend years implementing (and then maintaining) them using POSIX calls or you find a free software library that has already achieved that work for you. If there exists such a library that is good (well designed, well documented, supporting many protocols, mature hence with probably few bugs, in particular security bugs, etc.), why wouldn't you include it and focus on the rest your file manager?

Please enlighten me if you think this is a bad move, for any reason.

I believe most Trisquel users are on MATE and could better reply (I am on GNOME). Nevertheless, caja-share is apparently an extension to Caja: removing it should indeed only disable folder sharing. Nothing else.

Sunny Day
Offline
Iscritto: 01/05/2023

You explained it well Magic Banana, thank you very much for taking the time to make it clearer!

Either you spend years implementing (and then maintaining) them using POSIX calls or you find a free software library that has already achieved that work for you.

I think I see what you mean, specially in relation to experienced GNU/Linux users (not sure what POSIX calls are, but seem like a chore :). Also, I guess there aren't many people looking for a standalone system, freedom respecting or otherwise.

Ahhh, I'd still would love to have Trisquelo available in the wild, for the few who might want a simple local system, if only I had the skills to offer it, I would! I think it would be a perfect start and could grow with people as they learn and expand their needs.

Thank you also for reassuring me about the Caja extension. Peace of mind!

Magic Banana

I am a member!

I am a translator!

Offline
Iscritto: 07/24/2010

not sure what POSIX calls are, but seem like a chore :)

They are low-level functions available on any POSIX-compliant systems: https://pubs.opengroup.org/onlinepubs/9699919799/idx/functions.html

Ahhh, I'd still would love to have Trisquelo available in the wild, for the few who might want a simple local system, if only I had the skills to offer it, I would!

GVfs does not force you to have your system connected to a network. Even connected, GVfs should not communicate with any remote machine unless asked to do so. Do you want to disable Linux's networking support too? There is the compilation option CONFIG_NET for that. Nevertheless, "some programs need kernel networking support even when running on a stand-alone machine that isn't connected to any other computer": https://www.kernelconfig.io/CONFIG_NET

Sunny Day
Offline
Iscritto: 01/05/2023

I am happy to say I am using GVfs again and feel comfortable with it! I think I understand how things work a lot better now - thanks to your patience, Magic Banana, as well as Avron's and Prospero's.

There is nothing better than scratching an itch (until it hurts) to get rid of it.

GVfs does not force you to have your system connected to a network. Even connected, GVfs should not communicate with any remote machine unless asked to do so.

Yes, I understand that even better now (and the problems that come with not having it too), but I want to make clear that my concerns were based solely on my previous experience with a hacked system (FruitOS), when uninvited 'users' joined in, took over the computer, broke into my bank, my emails, my documents, my passwords (keychain), personal information and everything else you can think of... that was what I had in my mind + the fact I didn't know they were there until it was too late... I wondered if any of them could find their way in again, after all, they have all my data (mostly old data though, took a lot of effort, but everything that could be changed was changed!)... One of my big aims now is to learn how to fully defend a system against weirdos like that.

Do you want to disable Linux's networking support too?

I think I'm OK now, thank you :)... Also, if "some programs need kernel networking support even when running on a stand-alone machine that isn't connected to any other computer", I prefer to leave things as they are. I've blocked connections and ports from the beginning and that seems not to interfere too much, I hope.

Thank you for all the helpful links as well!