I am by no means a systems admin, nor a networking expert, so what I’m 
trying to do may be way off the mark, but let me try to describe my 
situation…

My employer recently purchased a Vagrant VMWare provider license which I’m 
successfully using with VMWare Workstation 10 on a Windows 7 host using 
Puppet to provision my VMs.  My base VM configuration uses an Ubuntu 
Precise64 box with DHCP and port forwarding.  The relevant parts of my 
Vagrantfile are shown below.

   ## Configure VMWare Workstation as the provider of choice.

  ## System parameters like available memory and number of CPU cores go 
here.

     config.vm.provider "vmware_workstation" do |v|

       v.vmx["memsize"] = "1024"

       v.vmx["numvcpus"] = "2"

     end

 

  ## Give our guest a name.

     config.vm.host_name = "base.dg.dev"

 

  ## Every Vagrant virtual environment requires a box to build off of.

     config.vm.box = "precise64_vmware"

     config.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box";

 

  ## Configure a public network adapter per DHCP.

     config.vm.network "public_network", :bridge => 'en1: Prompt Me'

 

Ultimately *I would like to be able to address and remotely debug web apps 
running on this guest VM (and other, similar guests) using the configured 
vm.host_name, in this case “base.dg.dev”.*  Given my limited knowledge of 
networking, the only way I know of doing this currently is to edit my 
windows “hosts” file (C:\Windows\System32\drivers\etc\hosts) and insert (or 
update) a line like this:

    192.168.1.58     base.dg.dev

In the example above the address of 192.168.1.58 is the *dynamic* value 
assigned to base.dg.dev VM by my router. 

While this solution seems to work nicely, I find myself making frequent 
changes to the “hosts” file as my VMs move from one network environment to 
another (I frequently work from home).  So my question… *Is there a way to 
have Vagrant modify my Windows “hosts” file automatically, or some other 
technique that I’ve completely overlooked?*

Thanks for any assistance or advice you can provide.  Take care.

-- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to