When I plug a USB stick or a mobile phone into my laptop, I don't want the operating system to automatically mount the device.
In Ubuntu 14.04 I could run the below command and this would disable automounting of block devices, e.g.

gsettings set org.gnome.desktop.media-handling automount false

In 16.04 this command now seems to have no effect, what is the equivalent command in 16.04?

  • Have you tried it with dconf-editor? May 13, 2016 at 6:48
  • @garethTheRed thanks for the comment, per your suggestion, I have now installed dconf-edittor . If I try the gsettings ... command - dconf-editor recognises the change. I'm not sure if the settings are taking effect at the OS level , testing now... May 13, 2016 at 7:14
  • Same for me on 16.04 running XFCE. gsettings get org.gnome.desktop.media-handling automount returned true. After your command it returns false but automount still happens. :-( Aug 8, 2016 at 8:35
  • On Xubuntu 16.04 (xfce) the equivalent command is xfconf-query -c thunar-volman -n -p "/automount-drives/enabled" -t string -s false ; xfconf-query -c thunar-volman -n -p "/automount-media/enabled" -t string -s false . This is what xfce4-settings-manager does in the "Removal drives and media" section. Aug 8, 2016 at 9:14
  • @don_crissti that sounds right. IIRC in the time since asking this question I think I discivered the problem was with the environment vars not being set - so the command is likely fine after all. good point checking for mount-ness with lsblk too. Sep 28, 2016 at 9:19

2 Answers 2


and for mate desktop its slightly different

gsettings set org.mate.media-handling automount false

its also important to keep in mind that this is a per user setting.
So it is valid only for the current desktop user....

check with:

gsettings list-recursively  org.mate.media-handling


gsettings list-recursively  org.gnome.desktop.media-handling 

Due to the mixed nature of the mate desktop (there are always some gnome apps I use) there seem to be some gnome settings leaking into the desktop configuration.
So I always set both parts to make sure.....

  • You saved my day! This solution also works on FreeBSD. I was looking for some daemon that would be automounting my devices, but it was the mate desktop! +1
    – Giorgio
    Aug 25, 2018 at 7:11

After further investigation, which is backed up by several comments on this post, it seems the command

 gsettings set org.gnome.desktop.media-handling automount false

does work as it had previously.
The reason it failed on this occasion seemed to be caused by the lack of environment variables being set, notably $DBUS_SESSION_BUS_ADDRESS.
To re-iterate, the command does work for Ubuntu 16.04 as it had done on 14.04.

  • On my Lubuntu 18.04.4, this doesn't work, and echo $DBUS_SESSION_BUS_ADDRESS #=> unix:path=/run/user/1000/bus . Any tips for setting the vars to make it work? May 23, 2020 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .