title: How to auto-mount veracrypt device-hosted volume with systemd after login on Linux Mint?
body: <p>I created <code>/etc/systemd/system/veracrypt-automount-devices.service</code>:</p>
  
  <pre><code>[Unit]
  Description=VeraCrypt auto-mount device-hosted volumes
  
  [Service]
  Type=forking
  ExecStartPre=/bin/sleep 300
  ExecStart=/usr/bin/veracrypt --auto-mount=devices /media/veracrypt1
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>Then I did:</p>
  
  <pre><code>sudo systemctl daemon-reload
  sudo systemctl enable veracrypt-automount-devices
  sudo systemctl status veracrypt-automount-devices
  
  ● veracrypt-automount-devices.service - VeraCrypt auto-mount device-hosted volumes
     Loaded: loaded (/etc/systemd/system/veracrypt-automount-devices.service; enabled; vendor preset: enabled)
     Active: failed (Result: timeout) since Sat 2020-06-06 17:28:59 CEST; 8min ago
    Process: 967 ExecStartPre=/bin/sleep 300 (code=killed, signal=TERM)
  
  Jun 06 17:27:29 username-computername systemd[1]: Starting VeraCrypt auto-mount device-hosted volumes...
  
  Jun 06 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Start-pre operation timed out. Terminating.
  
  Jun 06 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'timeout'.
  
  Jun 06 17:28:59 username-computername systemd[1]: Failed to start VeraCrypt auto-mount device-hosted volumes.
  </code></pre>
  
  <p>As you can see, it doesn't work.
  If I grep syslog, here is what I find:</p>
  
  <pre><code>Jun  6 16:56:08 username-computername systemd[1]: veracrypt-automount-devices.service: Control process exited, code=exited status=1
  Jun  6 16:56:08 username-computername veracrypt[969]: Enter password:
  Jun  6 16:56:08 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'exit-code'.
  Jun  6 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Start-pre operation timed out. Terminating.
  Jun  6 17:28:59 username-computername systemd[1]: veracrypt-automount-devices.service: Failed with result 'timeout'.
  </code></pre>
  
  <p>Basically, what I want is to be asked for the password to decrypt the device-hosted volume after I logged in with my username and password in Linux Mint.</p>