Oh yeah! I forgot about another virtualbox trick!
The IP address that is the default gateway for a NAT mode interface will forward to the host’s 127.0.0.1:
HTTP_PROXY=http://10.0.2.2:8989
I can set up something that listens only on my host’s 127.0.0.1, and then access it from the VM by hitting 10.0.2.2.
Here’s some official docs on virtualbox’s networking modes as well: https://www.virtualbox.org/manual/ch06.html