See the Building and Debugging document for information on how to build VirtualBox. This guide assumes VirtualBox 7.0.14, but any recent-ish version should work.
I'm also noting down potential primitives and techniques that can help with exploits.
You can find these notes in the Exploit Primitives document.