Automount in Wheezy

Recently I installed Wheezy to serve as a simple file and video server with Openbox as window manager and no display manager. I have installed the usual helper programs, gvfs, thunar-volman, in order that Thunar can automount. External USB drives can be mounted by just clicking on the appropriate item in the side panel, but internal drives received a curt "You are not authorized" or some such message.

Googling about I found that I needed policykit, and that consolekit is no longer needed. Upon checking I found that I already have policykit-1, policykit-1-gnome, and udisks. It could be that I had installed these as well or more probably they were pulled in as dependencies.

Anyway, to cut a long story short, I needed to add a policykit rule:

[Storage Permissions]
Identity=unix-group:storage
Action=org.freedesktop.udisks.filesystem-mount;org.freedesktop.udisks.drive-eject;org.freedesktop.udisks.drive-detach;org.freedesktop.udisks.luks-unlock;org.freedesktop.udisks.inhibit-polling;org.freedesktop.udisks.drive-set-spindown;org.freedesktop.udisks.filesystem-mount-system-internal
ResultAny=yes
ResultActive=yes
ResultInactive=yes
stored in /etc/polkit-1/localauthority/50-local.d/50-mount.pkla.

Then in my .xinitrc I needed to launch an authenticating agent, in my case policykit-1-gnome. Thus:

# dbus
 if which dbus-launch >/dev/null && test -z "$DBUS_SESSION_BUS_ADDRESS"; then
       eval "$(dbus-launch --sh-syntax --exit-with-session)"
 fi
# policykit authenticating agent
 /usr/lib/policykit-1-gnome &
# launch window manager
 exec openbox-session

That's it. Everything works. Just to be clear, these are instructions I found googling.

Comments

Popular Posts