How do I stop KDE from automatically mounting my phone?

Any ideas how to convince KDE\systemd\dbus that I really don’t want my phone to get mounted?

I want my qemu virtual machine to capture it, and I can’t while it’s mounted…

Here’s what I’ve tried:

  • I’ve gone to “Removable Storage” → “Removable Devices” in settings, and disabled “automount device” both for login and on attach for all devices (though my phone does not appear on the list).

It did nothing.

  • I’ve masked all gvfs related services

It did nothing.

  • I’ve copied /lib/udev/rules.d/69-libmtp.rules to /etc/udev/rules.d/69-libmtp-rules and added a line to catch my phone by its id and goto the end of the file.

it did something - now instead of automounting once, it automounts repeatedly because it keeps disconnecting and reconnecting!

Any ideas?

You don’t see anything happening on your phone as you plug it in? Like how it will connect, as storage or as, well, something else. Or if there is a setting somewhere, where you can set it to not allow anything but as storage, or what have you.
I always want storage mode, since all I ever do is moving files from it to my computer. Could be different for me, since I use a 12-year-old Nokia N900, with the original battery!
On my old computer with Mint on it, even though the phone was only charging, it could not be disconnected safely after I had copied the files I needed. I always had to unplug it anyway.

Even if you disable the automount - you will still get a message telling the device is available.

To remove these messages navigat to Notifications.

You may want to adapt several settings depending on your preference.

In the Applications → Configure section, Select the Device Notifier and untick shoe popus

The problem is that I have a VM to which I forward my phone, but once my phone reboots, it won’t forward automatically back to the VM, but would rather trigger the notification. I want it to stay routed to the VM.