How to Stop Ubuntu from Automatically Opening Nautilus When a Drive is Inserted

The Intrusive File Manager

Ubuntu (specifically the GNOME desktop environment) is designed to be as user-friendly as possible with external media. Whenever you plug in a USB flash drive, an external hard drive, or insert an SD card, Ubuntu detects the hardware, mounts the file system, and immediately launches a new window of “Files” (the Nautilus file manager) showing the contents of that drive. While this mimics the autorun behavior of other operating systems and provides instant access, it can be highly disruptive. If you are in the middle of typing an email or writing code, having a massive file manager window suddenly explode across your screen simply because you plugged in your phone to charge is incredibly annoying.

Silencing the Auto-Mount Action

To maintain your focus and stop Ubuntu from automatically opening Nautilus when a drive is inserted, you must configure the media handling settings within the system.

Open your main application launcher and search for Settings. In the left-hand navigation sidebar, scroll down and click on Removable Media (in some older versions of Ubuntu, this might be found under “Details” > “Removable Media”). In the right-hand panel, you will see a list of media types (Audio CD, DVD, Software, etc.) and what action Ubuntu should take. To stop the file manager from launching for generic USB drives, look at the very top of this menu for a master toggle switch labelled Never prompt or start programs on media insertion. Click this toggle to turn it On. Alternatively, you can change the dropdown for “Other Media” to “Do Nothing.” Your drives will still mount silently in the background, but Nautilus will stay hidden until you manually open it.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.