How to Disable USB Auto-mount I use VirtualBox on my MBP and often need to mount my USB flash drive inside the guest.  The problem I'm running into is that the host OS (OS X Mavericks) immediately mounts the USB flash drive when I insert it.  When I try to unmount it (gracefully, through Finder), OS X complains that the device is in use.  Further research into lsof reveals that Spotlight and AVG are doing their thing with the flash drive.

Rather than fiddling with individual app settings, I'd like to just modify the host OS behavior so that the USB device doesn't auto-mount.  Any suggestions?
OS X has a mechanism, called the Disk Arbitration framework, through which programs can control what happens when disks are inserted or ejected.  It also provides an opportunity to intercept a disk insertion event and prevent the usual automatic mounting behaviour.

To change the behaviour, though, requires a third-party utility, since the Disk Arbitration framework is just a programming interface.  One good utility is Disk Arbitrator, a free (BSD-licensed) tool by Aaron Burghardt.



While Disk Arbitrator is running, you can choose to either veto the mounting of newly inserted disks, mount them read-only, or just let the normal automatic mounting happen.  After Disk Arbitrator exits, the normal mounting behaviour is restored.