Can't mount veracrypt containers - failed to create a file or directory in a temporary directory

I’ve spent hours on this and I can’t get it to work. I can’t mount anything in veracrypt - full error message is:

Failed to create a file or directory in a temporary directory.

Please make sure that the temporary directory exists, its security permissions allow you to access it, and there is sufficient disk space:

I’ve tried this in a disposable qube, an appvm, I’ve tried launching veracrypt with sudo, I’ve tried configuring veracrypt for passwordless execution, I’ve ensured the veracrypt vm has plenty of space, I’ve tried setting umask=000 in veracrypt and with sudo mount when I mount the USB drive. I’ve searched the internet for everything I can find connected with this and got nowhere. I don’t know what else I can do. Can anyone help?

veracrypt “Failed to create a file or directory in a temporary directory”

1 Like

That does solve it as a workaround but the folder isn’t persistent in /tmp in my template qube. Appreciate the help! I’m nearly there but I need a workaround to the workaround now.

You can add the folder creation in /rw/config/rc.local or use bind-dirs.

Thanks for the help @apparatus. To summarize for anyone with this problem in the future, it’s solved by adding: sudo mkdir -p /tmp/user/0000000000 (username and number as shown in the veracrypt error message) to /rw/config/rc.local of the template (and reboot).

Some extra info on this issue: only had this problem in debian based template - had no issues with mounting veracrypt volumes in a fedora-based template