EDIT: It is worth noting that you must have secure boot disabled and legacy support enabled in the BIOS(f10 or f12), preferrably before you perform these steps.
I am posting this because I have only seen partial fixes on several forums, with little explanation. This guide offers a COMPLETE solution that even inexperienced users may follow. HP and other boot loaders are all slightly different from one another. Specifically for this issue,the bootloader tries to load EFI\Microsoft\Boot\Bootmgfw.efi and does not include the VeraCrypt EFI to the list, even after VeraCrypt installation. On most computers, the VeraCrypt EFI is appended to the boot list and a simple change in boot order is needed. The reason windows tries to repair the disk is that it is trying to directly load the encrypted disk without the prior VeraCrypt authentication. In layman’s terms, it is trying to load jumbled “encrypted” data, so it thinks that the disk has been corrupted. In the case of HP (or other computers with this issue) we can CAREFULLY change a few things to come to a solution. I don’t know if I need to say this, but just in case: When typing these commands into command prompt add all of the text within the quotations… Not the actual quotations themselves. Spacing and capitalization are important.
To fix the issue you can do the following:
1 Hit windows key, type “cmd”, right click command prompt and select “Run as Administrator”
2 Type: “mountvol o: /s” and hit enter
3 Type: “ren o:\EFI\Microsoft\Boot\bootmgfw.efi bootmgfw_ms.efi” and hit enter
4 Type: “notepad o:\EFI\VeraCrypt\DcsProp” and hit enter
5 A notepad window should have appeared. Enter the following text to the top of the list:
“<config key=”ActionSuccess”>postexec file(EFI\Microsoft\Boot\bootmgfw_ms.efi)</config>”
It should look like:
The „ActionSuccess” config key needs to be at the top. Make sure it is placed within the other tags. Keep the quotes around “ActionSuccess” but not around the whole line (remember what I said at the beginning). Location of text here is important.
Use “ctrl + s” to save and X out of notepad
6 Type: “cd EFI” and hit enter
7 Type: “copy .\VeraCrypt\DcsBoot.efi .\Microsoft\Boot” and hit enter
8 Type: “ren .\Microsoft\Boot\DcsBoot.efi bootmgfw.efi” and hit enter
That is all you have to do. You can restart and you will be prompted to enter in your VeraCrypt password and PIM. What this fix does is trick windows into running bootmgfw.efi like it does normally, which is actually the renamed DcsBoot.efi. After the VeraCrypt password (you created during installation) is entered, DcsProp file uses postexec command to load the real bootmgfw.efi which has been renamed to bootmgfw_ms.efi.