It sounds like your problem has to do with trying to use smb, and not with the problem that I worked around. This might be helpful in understanding some of your options: https://www.veracrypt.fr/en/Sharing%20over%20Network.html
@Michael, I recently installed Ubuntu 20.04 and am using VeraCrypt version 1.24-Update4. I found that the same sudoers entry I mentioned in my first post still worked, and that if I removed the uptime part, I was prompted for root passwords. Were you using smb before? My only suggestion is to look at /var/log/auth.log for clues. Look for auth activity around the time of a VeraCrypt invocation.
@Musikolo, here is the comment for the code that was added in the Veracrypt diff I cited above: // Test if the user has an active "sudo" session. // This is only done under Linux / FreeBSD by executing the command 'sudo -n uptime'. I don't think the use case of putting veracrypt in the sudoers file was considered when the change was made.
When I looked at/var/log/auth.log, I discovered that /usr/bin/uptime as well as /usr/bin/veracrypt had to be added to sudoers, for example: john ALL=(ALL) NOPASSWD:/usr/bin/veracrypt, /usr/bin/uptime Search for 'Test if the user has an active "sudo" session' in https://www.veracrypt.fr/code/VeraCrypt/diff/src/?id2=d07bbd00f2f4fd1ab75e888e5160d4d849e7a0d8&context=2&ignorews=0&dt=0 I did not try to figure out why the source change was made; it didn't make sense to me.
When I looked at/var/log/auth.log, I discovered that /usr/bin/uptime as well as /usr/bin/veracrypt had to be added to sudoers, for example: john ALL=(ALL) NOPASSWD:/usr/bin/veracrypt, /usr/bin/uptime Search for 'Test if the user has an active "sudo" session' in https://www.veracrypt.fr/code/VeraCrypt/diff/src/?id2=d07bbd00f2f4fd1ab75e888e5160d4d849e7a0d8&context=2&ignorews=0&dt=0 I did not try to figure out why the sourcechange was made; it didn't make sense to me.