It sounds like you are talking about NAT mode on virtualbox. In this case you can set up port forwarding in the network settings. Also, you can actually reach the host from the guest. In my case my guest has an IP of 10.0.2.15 by default, and I can reach the host on 10.0.2.2