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
  • 2
  • 9
  • 21
  • Did you add entries to `/etc/fstab` for the drive? Or created it with any special tools? How is it automatically mounted without entering the passphrase, or do you have to type it in each time it's plugged in? – Xen2050 Jan 25 '15 at 07:38
  • @Xen2050 No `/etc/fstab` entries, and no special tools; I just save the decryption passphrase in my keyring. I've updated the question to include the answer to your question. – cqcallaw Jan 26 '15 at 17:06
  • That's interesting, Unity must have something do that on it's own (I haven't used it except for a few hours when it first came out). Maybe a udisks or pam setup? Here are some arch wiki links that might help, but I didn't see enough for an answer IMO, at least not for "plug & decrypt" [dm-crypt/Specialties](https://wiki.archlinux.org/index.php/Dm-crypt/Specialties) and [dm-crypt/Device Encryption - Unlock at boot](https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption#Unlock_at_boot) – Xen2050 Jan 27 '15 at 04:52
  • I'll check out those links, thanks. I don't think it's specific to Unity, though, because Gnome Classic has the same behavior. – cqcallaw Jan 28 '15 at 04:57
  • Apparently [*"Unity is a graphical shell for the GNOME desktop environment"*](http://en.wikipedia.org/wiki/Unity_%28user_interface%29), so maybe something in org.gnome.desktop.media-handling like this Q http://askubuntu.com/questions/89244/how-to-disable-automount-in-nautiluss-preferences – Xen2050 Jan 28 '15 at 07:37

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
  • 2
  • 9
  • 21