Virtualbox: get host IP address
That all depends on your networking arrangement.
If you are using a NAT or Host Only arrangement then the hosts's IP address will be your default route provided by DHCP by the host.
If you are bridging your network then there is no way to automatically know the host's IP address.
This doesn't answer the question, but perhaps solves the problem.
To clone a hg repository, I would uses shared folders in this case. HOWTO: Use Shared Folders