Your PC needs to restart. Please hold down the power button. Error Code: 0x00000005D
To get it working, I quit VirtualBox and at the Terminal changed to the VirtualBox directory:
$ cd /Applications/VirtualBox.app/Contents/MacOS
I then ran this command (where Windows 10 is the name I gave my virtual machine):
$ VBoxManage setextradata "Windows 10" VBoxInternal/CPUM/CMPXCHG16B 1
After that the Windows 10 installation worked perfectly.
I figured this out from the following link which explains what that command actually does. Thanks!