systemd based automount never umounts when idle

This approach worked for me (on Ubuntu):

  1. Clean start: make sure the mount point is not mounted yet.
  2. Have the mount defined in your /etc/fstab
  3. sudo systemctl daemon-reload
  4. sudo systemctl restart remote-fs.target

To check if it works:

At this point if you didn't access the remote filesystem yet, systemctl status home-roaming.mount should report Loaded: loaded and Active: inactive (dead). Next, access the filesystem, with e.g. ls /home/roaming. Rerunning the above status query should now report Active: active (mounted). If the mount point is truly not accessed by the system after the user logs out, it should get umounted after the idle timeout, with corresponding active status. If not, I would try next with a mount point that is not a user homedir to see if it makes a difference.