creating a named host for virtualbox accessible from host

4

For my dev machine, I have windows 7 host with ubuntu guest. I run the guest as the server.

Every time I want to test from the host, I find my current guest IP address, and connect via that (for example, today it is 192.168.1.188:3000/). Of course, this changes every time I connect to a different network.

I want to create a named address, dev.myapp.com that I can connect to from the host windows machine, or possibly any machine on the network (if that is possible, though it may be a security concern, somebody on the network would need to know my url name in order to access, so I'm not that concerned).

I've tried chaning the etc/hosts in ubuntu to include

127.0.0.1:3000 dev.myapp.com

but unfortunately, this isn't resolving from either the host or guest. I'm using a bridged network adapter, promiscuous mode is deny.

pedalpete

Posted 2012-08-14T02:30:00.407

Reputation: 293

Why does the guest not have a static IP? – None – 2012-08-14T02:43:10.650

@RandolphWest, should I be setting a static ip? I thought dynamic was the standard as I'm regularly switching from one network to another. – pedalpete – 2012-08-14T03:12:53.800

Ah, no that's fine. Ignore me :-) – None – 2012-08-14T03:21:32.537

Answers

2

I suggest you use Multicast DNS to fix this.

Ubuntu is using this by default via Avahi.

The Windows host needs an Avahi-client for it to discover other Avahi-services. If your host already uses some Apple software this is probably already there via a service called Bonjour. However, if this is not already installed then a small version of Bonjour is available for download here: Bonjour Print Services. After installation you should be able to access your guest via .local.

Note: The mDNS system seem to use the .local postfix by default. So, if your hostname is "dev.myapp.com", then the actual hostname will be "dev.myapp.com.local".

Spiralis

Posted 2012-08-14T02:30:00.407

Reputation: 171