Maybe I can give some hints - but I am not very experienced, so please consider security issues for yourself:
I also tried to mount an external veracrypt-encrypted drive during startup via /etc/rc.local
. Therefore I put a small bash-script in /usr/local/sbin. It contained only the veracrypt-mount-command, in which I put in the password:
veracrypt --password=XXXX --mount /dev/sda1
(security issue!)
I observed, that this script did not work if called during startup by /etc/rc.local
while it worked without problems when called in TErminal after complete bootup with sudo. In this case the script ran without interaction, did not bring up the GUI and mounted the drive.
In /var/log/syslog
I could see then, that the veracrypt command called by rc.local
behaved different and expected interaction with the user, e.g. wanted the specification of the mountpoint (where to mount), whether hidden-volume-protection was needed etc.
So for my case it works now with the command-line option --non-interactive:
veracrypt --non-interactive --password=XXXX --mount /dev/sda1
or
if I specify all options, that veracrypt asked for as visible in /var/log/syslog
(for this I added one option after the other and restarted...). Example:
veracrypt --fs-options=uid=XX,gid=XX --password=XXXXX --pim=0 -k "" --protect-hidden=no --mount /dev/sdb /PATH/TO/MOUNTPOINT
Besides, duckduckgo found this page for me:
https://wiki.archlinux.org/index.php/TrueCrypt
Maybe - I don't really know - it is possible and better and more convenient to mount veracrypt volumes with cryptsetup...