BerlinVagrant / vagrant-dns

A plugin to manage DNS records for vagrant environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Accessing VMs from another device in the same network

njam opened this issue · comments

For testing and developing on mobile devices it would be great if we could access vagrant boxes from devices on the same network (let's call them "iPhone").

Our idea to accomplish this is something like this:

  • Allow vagrant-dns to bind on port 53, therefore becoming the default DNS server on the Mac (#32)
  • Connect to an "Internet Sharing" interface from the iPhone to the Mac. This will make the iPhone use the Mac's DNS server (vagrant-dns). To accomplish that the iPhone can actually access the VM we would need to use vagrant bridged networking. This would require vagrant-dns to retrieve the IP address from within the box after booting and use it for resolving.

@kris-lab @fnordfish what do you think?

We are facing the same problems, have you made any progress on this issue?

I'm using landrush, which is also a vagrant DNS plugin. It detects the IP address of the operating system in the VM, so it works with DHCP-assigned addresses.

I've written up some docu on how to do it:
https://github.com/phinze/landrush/tree/master/doc/proxy-mobile

Another solution which proxies from a public IP to your local one (and replacing all hostnames etc): http://www.browsersync.io/