0

I'm running Ubuntu 14.04. Whenever I'm using the default Unity desktop environment (or using the Gnome Classic session with Metacity), a flash drive with a LUKS-encrypted filesystem is automatically mounted whenever it's plugged in. This happens without any entries in /etc/fstab; I simply save the decryption passphrase for the drive in my keyring. When I use an alternative windows manager in my Gnome session (in my case, xmonad), the USB drive is not automounted when plugged in.

How can I get the encrypted flash drive to automount in Gnome+xmonad?

cqcallaw
  • 1,113

1 Answers1

0

(Thanks to sktsee on the ubuntu-users mailing list for helping me arrive at this solution):

The magic for this is in the GNOME session file. To get encrypted automounting to work, add the line "DesktopName=Unity" to /usr/share/gnome-session/sessions/xmonad.session. The final session file looks like this:

[GNOME Session]
Name=Xmonad/GNOME
RequiredComponents=gnome-settings-daemon;gnome-panel;xmonad
DesktopName=Unity

For people troubleshooting related problems, it was informative to start a GNOME+Metacity session, then run xmonad --replace in a terminal window. In my case, using the xmonad --replace technique confirmed that the automounting behavior was not an issue caused by xmonad itself, but rather a lack of the appropriate running services.

cqcallaw
  • 1,113