Giter VIP home page Giter VIP logo

vagrant-hostsupdater's Introduction

NOT MAINTAINED

USE AN ALTERNATIVE

March 3, 2021

Hi Everyone. @cgsmith here. I took maintenance over from @agiledivider (Falk Kühnel) in 2015. Myself and the company I worked for relied on Vagrant for our development machines and I relied on vagrant-hostsupdater for changing hosts files. When I found out he was no longer maintaining the project I reached out to him on Twitter and he was willing to let me maintain it and apply some much needed pull requests.

Maintaining a large project is extremely rewarding. I enjoyed doing so but have stopped using Vagrant for development. There are other plugins to help you manage your hosts file or you can feel free to fork this one into your own.

Don't worry if you don't know Ruby... I didn't. I'm a PHP developer. I figured it out though and asked the right questions to get the problem solved.

So long... may we meet elsewhere on this vast planet.

  • Chris Smith

Vagrant::Hostsupdater

Gem Version Gem Gem

Gitter Twitter

This plugin adds an entry to your /etc/hosts file on the host system.

On up, resume and reload commands, it tries to add the information, if it does not already exist in your hosts file. If it needs to be added, you will be asked for an administrator password, since it uses sudo to edit the file.

On halt, destroy, and suspend, those entries will be removed again. By setting the config.hostsupdater.remove_on_suspend = false, suspend and halt will not remove them.

Installation

$ vagrant plugin install vagrant-hostsupdater

Uninstall it with:

$ vagrant plugin uninstall vagrant-hostsupdater

Update the plugin with:

$ vagrant plugin update vagrant-hostsupdater

Usage

You currently only need the hostname and a :private_network network with a fixed IP address.

config.vm.network :private_network, ip: "192.168.3.10"
config.vm.hostname = "www.testing.de"
config.hostsupdater.aliases = ["alias.testing.de", "alias2.somedomain.com"]

This IP address and the hostname will be used for the entry in the /etc/hosts file.

Multiple private network adapters

If you have multiple network adapters i.e.:

config.vm.network :private_network, ip: "10.0.0.1"
config.vm.network :private_network, ip: "10.0.0.2"

you can specify which hostnames are bound to which IP by passing a hash mapping the IP of the network to an array of hostnames to create, e.g.:

config.hostsupdater.aliases = {
    '10.0.0.1' => ['foo.com', 'bar.com'],
    '10.0.0.2' => ['baz.com', 'bat.com']
}

This will produce /etc/hosts entries like so:

10.0.0.1 foo.com
10.0.0.1 bar.com
10.0.0.2 baz.com
10.0.0.2 bat.com

Skipping hostupdater

To skip adding some entries to the /etc/hosts file add hostsupdater: "skip" option to network configuration:

config.vm.network "private_network", ip: "172.21.9.9", hostsupdater: "skip"

Example:

config.vm.network :private_network, ip: "192.168.50.4"
config.vm.network :private_network,
    ip: "172.21.9.9",
    netmask: "255.255.240.0",
    hostsupdater: "skip"

Keeping Host Entries After Suspend/Halt

To keep your /etc/hosts file unchanged simply add the line below to your VagrantFile:

config.hostsupdater.remove_on_suspend = false

This disables vagrant-hostsupdater from running on suspend and halt.

Suppressing prompts for elevating privileges

These prompts exist to prevent anything that is being run by the user from inadvertently updating the hosts file. If you understand the risks that go with supressing them, here's how to do it.

Linux/OS X: Passwordless sudo

To allow vagrant to automatically update the hosts file without asking for a sudo password, add one of the following snippets to a new sudoers file include, i.e. sudo visudo -f /etc/sudoers.d/vagrant_hostsupdater.

For Ubuntu and most Linux environments:

# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /bin/sed -i -e /*/ d /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE

For MacOS:

# Allow passwordless startup of Vagrant with vagrant-hostsupdater.
Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c echo "*" >> /etc/hosts
Cmnd_Alias VAGRANT_HOSTS_REMOVE = /usr/bin/sed -i -e /*/ d /etc/hosts
%admin ALL=(root) NOPASSWD: VAGRANT_HOSTS_ADD, VAGRANT_HOSTS_REMOVE
  • If vagrant still asks for a password on commands that trigger the VAGRANT_HOSTS_ADD alias above (like up), you might need to wrap the echo statement in quotes, i.e. Cmnd_Alias VAGRANT_HOSTS_ADD = /bin/sh -c 'echo "*" >> /etc/hosts'. This seems to be a problem with older versions of Linux and MacOS.
  • If vagrant still asks for a password on commands that trigger the VAGRANT_HOSTS_REMOVE alias above (like halt or suspend), this might indicate that the location of sed in the VAGRANT_HOSTS_REMOVE alias is pointing to the wrong location. The solution is to find the location of sed (ex. which sed) and replace that location in the VAGRANT_HOSTS_REMOVE alias.

Windows: UAC Prompt

You can use cacls or icacls to grant your user account permanent write permission to the system's hosts file. You have to open an elevated command prompt; hold ❖ Win and press X, then choose "Command Prompt (Admin)"

cacls %SYSTEMROOT%\system32\drivers\etc\hosts /E /G %USERNAME%:W 

Using AWS as a Provider

If you'd like AWS as a provider using vagrant-aws or other plugin, this plugin will detect the instance public IP by the tag infomations.
For example, vagrant-aws configures a tag infomations like the following.

config.vm.provider :aws do |aws, override|
  aws.tags = {
    "Name" => "vagrant",
    ...
  }
  aws.elastic_ip = true
  ...
end
  • AWS CLI is required
  • The tag informations be unique for the instance
  • Enable Elastic IP for the instance

Using Google as a provider

If you'd like a Google provider using vagrant-google, this plugin will detect the public IP from the name of the instance. vagrant-google provides a default name, but you can specify your own as follows:

config.vm.provider :google do |google, override|
  google.name = "somename"
  ...
end

Installing development version

If you would like to install vagrant-hostsupdater on the development version perform the following:

git clone https://github.com/cogitatio/vagrant-hostsupdater
cd vagrant-hostsupdater
git checkout develop
gem build vagrant-hostsupdater.gemspec
vagrant plugin install vagrant-hostsupdater-*.gem

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request on the develop branch

Versions

1.2.0

  • Bugfix: Fixing null string #188

1.1.1

  • Bugfix: AWS Feature broke part of the code #155

1.1.0

  • Feature: Added AWS support #74
  • Feature: Added libvirt provider #122
  • Feature: Add support for multiple private network adapters #96
  • Feature: Add support for VMs without private/public networking #23
  • Feature: Add Docker support #149
  • Bugfix: Windows users get UAC prompt #40
  • Bugfix: Documentation update and type fix
  • Misc: Added a note about suppressing UAC prompts

1.0.2

  • Feature: Added remove_on_suspend for vagrant_halt #71
  • Feature: Skip entries if they already exist #69
  • Bugfix: Fixing extra lines in /etc/hosts file #87
  • Misc: Fix yellow text on UI #39

1.0.1

  • Bugfix: Fixing up issue on initialize #28

1.0.0

  • Stable release
  • Feature: Added skip flag #69
  • Feature: Hosts update on provision action #65
  • Bugfix: remove_on_suspend should be true #19
  • Bugfix: Line break not inserted before first host #37
  • Bugfix: Old changes not removed in linux #67
  • Bugfix: Writable issue on OSX #47
  • Bugfix: Update hosts before provisioning #31
  • Misc: Using Semantic Versioning for version number
  • Misc: Added note regarding sudoers file

0.0.11

  • bugfix: Fix additional new lines being added to hosts file (Thanks to vincentmac)

0.0.10

  • bugfix: wrong path on Windows systems (Thanks to Im0rtality)

0.0.9

  • bugfix: now not trying to remove anything if no machine id is given

0.0.8

  • trying to use proper windows hosts file

0.0.7

  • using hashed uids now to identify hosts entries (you might need to remove previous hostentries manually)
  • fixed removing of host entries

0.0.6

  • no sudo, if /etc/hosts is writeable

0.0.5

  • option added to not remove hosts on suspend, adding hosts on resume (Thanks to Svelix)

0.0.4

  • fixed problem with removing hosts entries on destroy command (Thanks to Andy Bohne)

0.0.3

  • added aliases config option to define additional hostnames

vagrant-hostsupdater's People

Contributors

agiledivider avatar aki2o avatar br0ken- avatar cbirajdar avatar cgsmith avatar danepowell avatar didel avatar dlundgren avatar ejfrancis avatar fabacab avatar geerlingguy avatar im0rtality avatar jojo-jojovich avatar jugglinmike avatar kamazee avatar kentr avatar kogent avatar mal avatar markjaquith avatar markus-altran avatar milest avatar phersh avatar radeksimko avatar rmarchei avatar rrader avatar serverbrain avatar skyscooby avatar svelix avatar tobych avatar ypcs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-hostsupdater's Issues

Version history should be at the end of the readme.

Hi,
I just discovered this project and it makes my life easier.

I think, the Version history should be at the end of the readme. It took quite a while, till I found the "Installation" instructions, since most projects have the version history at the end of the page. So I stopped scrolling :)

Plugin does not install on windows 8

I updated to the latest version of vagrant and wanted to use the resulting hostsupdater. This worked in the past, but now it seems it's calling for Ruby to be installed, and with Ruby installed, the json gem doesn't install as well. Cant get around either one.

PS M:\web> vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...`
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
PS M:\web> vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.

PS M:\web> gem install json -v '1.8.1'
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
1 gem installed
PS M:\web> gem install json –platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-1.8.1
Parsing documentation for json-1.8.1
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/generator.so, skipping
unable to convert "\x90" from ASCII-8BIT to UTF-8 for lib/json/ext/parser.so, skipping
ERROR:  Could not find a valid gem 'ûplatform=ruby' (>= 0) in any repository
ERROR:  Interrupted
Terminate batch job (Y/N)? Y
PS M:\web>

[BUG] Segmentation fault

After I install host updater I get " [BUG] Segmentation fault" and long dump list of ruby files.

I am using vagrant 1.7.2 abd virtual box 4.3.28.

Any ideas what's wrong? Here is full error:

C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:308: [BUG] Segmentation fault
ruby 2.0.0p353 (2013-11-22) [i386-mingw32]

-- Control frame information -----------------------------------------------
c:0040 p:---- s:0243 e:000242 CFUNC :get_osfhandle
c:0039 p:0066 s:0239 e:000238 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:308
c:0038 p:0015 s:0233 e:000232 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:137
c:0037 p:0068 s:0228 e:000225 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:109
c:0036 p:0031 s:0219 e:000218 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:32
c:0035 p:0102 s:0215 e:000214 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process.rb:68
c:0034 p:0007 s:0211 e:000210 METHOD C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/abstract_process.rb:82
c:0033 p:0008 s:0208 e:000207 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:104
c:0032 p:0006 s:0206 e:000205 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:26 [FINISH]
c:0031 p:---- s:0204 e:000203 CFUNC :chdir
c:0030 p:0015 s:0200 e:000199 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:25 [FINISH]
c:0029 p:---- s:0198 e:000197 CFUNC :synchronize
c:0028 p:0024 s:0195 e:000194 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:24
c:0027 p:0472 s:0190 e:000189 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:103
c:0026 p:0013 s:0168 e:000167 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:22
c:0025 p:0024 s:0163 e:000162 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:404
c:0024 p:0014 s:0161 e:000160 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19
c:0023 p:0039 s:0157 E:0015a0 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:403
c:0022 p:0017 s:0151 e:000150 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:342
c:0021 p:0044 s:0148 e:000147 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb:17
c:0020 p:0082 s:0142 e:000141 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:337
c:0019 p:0009 s:0134 e:000133 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:141
c:0018 p:0044 s:0132 e:000131 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb:17
c:0017 p:0035 s:0126 e:000125 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:140
c:0016 p:0044 s:0121 e:000120 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:38 [FINISH]
c:0015 p:---- s:0114 e:000113 CFUNC :new
c:0014 p:0019 s:0111 e:000110 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/provider.rb:11
c:0013 p:0190 s:0107 e:000106 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:134
c:0012 p:0013 s:0087 e:000086 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:45
c:0011 p:0214 s:0069 e:000065 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:614
c:0010 p:0146 s:0058 e:000057 LAMBDA E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:168 [FINISH]
c:0009 p:---- s:0052 e:000051 CFUNC :call
c:0008 p:0010 s:0048 e:000047 BLOCK E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:201 [FINISH]
c:0007 p:---- s:0045 e:000044 CFUNC :map
c:0006 p:0238 s:0042 E:002040 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:200
c:0005 p:0086 s:0030 E:000844 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/reload/command.rb:37
c:0004 p:0158 s:0023 e:000022 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb:42
c:0003 p:0020 s:0017 e:000016 METHOD E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:301
c:0002 p:0807 s:0013 E:000f58 EVAL E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:174 [FINISH]
c:0001 p:0000 s:0002 E:000a74 TOP [FINISH]

E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant:174:in <main>' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:301:incli'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb:42:in execute' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/reload/command.rb:37:inexecute'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:200:in with_target_vms' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:200:inmap'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:201:in block in with_target_vms' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:201:incall'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:168:in block in with_target_vms' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:614:inmachine'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:45:in machine' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb:134:inmachine_config'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/provider.rb:11:in usable?' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/provider.rb:11:innew'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:38:in initialize' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:140:inread_version'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb:17:in retryable' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb:141:inblock in read_version'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:337:in execute' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb:17:inretryable'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:342:in block in execute' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:403:inraw'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in busy' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb:404:inblock in raw'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:22:in execute' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:103:inexecute'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:24:in safe_chdir' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:24:insynchronize'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:25:in block in safe_chdir' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:25:inchdir'
E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb:26:in block (2 levels) in safe_chdir' E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb:104:inblock in execute'
C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/abstract_process.rb:82:in start' C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process.rb:68:inlaunch_process'
C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:32:in start' C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:109:insetup_io'
C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb:137:in std_stream_handle_for' C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:308:inhandle_for'
C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb:308:in `get_osfhandle'

-- C level backtrace information -------------------------------------------
C:\Windows\SysWOW64\ntdll.dll(ZwWaitForSingleObject+0x15) [0x7789F8CD]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObjectEx+0x43) [0x757E1194]
C:\Windows\syswow64\kernel32.dll(WaitForSingleObject+0x12) [0x757E1148]
E:\HashiCorp\Vagrant\embedded\bin\msvcrt-ruby200.dll(rb_vm_bugreport+0xa7) [0x668F7EB7]
E:\HashiCorp\Vagrant\embedded\bin\msvcrt-ruby200.dll(rb_name_err_mesg_new+0x69d) [0x667BE44D]
E:\HashiCorp\Vagrant\embedded\bin\msvcrt-ruby200.dll(rb_bug+0x2e) [0x667BF24E]
E:\HashiCorp\Vagrant\embedded\bin\msvcrt-ruby200.dll(rb_check_safe_str+0x180) [0x6687E320]
[0x00401866]
C:\Windows\SysWOW64\ntdll.dll(RtlKnownExceptionFilter+0xb7) [0x778F1CA7]

-- Other runtime information -----------------------------------------------

  • Loaded script: E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/bin/vagrant

  • Loaded features:

    0 enumerator.so
    1 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/encdb.so
    2 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/iso_8859_1.so
    3 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/trans/transdb.so
    4 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
    5 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/compatibility.rb
    6 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/defaults.rb
    7 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/deprecate.rb
    8 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/errors.rb
    9 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/version.rb
    10 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/requirement.rb
    11 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/platform.rb
    12 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/specification.rb
    13 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/exceptions.rb
    14 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/defaults/operating_system.rb
    15 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/utf_16le.so
    16 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/trans/utf_16_32.so
    17 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb
    18 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/thread.rb
    19 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/monitor.rb
    20 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb
    21 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems.rb
    22 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/trans/single_byte.so
    23 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/path_support.rb
    24 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/dependency.rb
    25 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/etc.so
    26 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fileutils.rb
    27 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/pathname.so
    28 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/pathname.rb
    29 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/gem_path_manipulation.rb
    30 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/gem_helpers.rb
    31 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/match_platform.rb
    32 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/rubygems_ext.rb
    33 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/user_interaction.rb
    34 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/config_file.rb
    35 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/rubygems_integration.rb
    36 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/version.rb
    37 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/constants.rb
    38 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/current_ruby.rb
    39 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler.rb
    40 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/settings.rb
    41 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/shared_helpers.rb
    42 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/digest.so
    43 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/digest.rb
    44 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/digest/sha1.so
    45 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/set.rb
    46 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/definition.rb
    47 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/dependency.rb
    48 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/ruby_dsl.rb
    49 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/dsl.rb
    50 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/source_list.rb
    51 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/source.rb
    52 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/common.rb
    53 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/generic.rb
    54 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/ftp.rb
    55 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/http.rb
    56 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/https.rb
    57 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/ldap.rb
    58 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/ldaps.rb
    59 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri/mailto.rb
    60 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/uri.rb
    61 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/cgi/core.rb
    62 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/cgi/util.rb
    63 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/cgi/cookie.rb
    64 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/cgi.rb
    65 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/socket.so
    66 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/socket.rb
    67 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/fcntl.so
    68 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/timeout.rb
    69 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/openssl.so
    70 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/bn.rb
    71 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/cipher.rb
    72 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/stringio.so
    73 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/config.rb
    74 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/digest.rb
    75 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/x509.rb
    76 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/buffering.rb
    77 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl/ssl.rb
    78 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/openssl.rb
    79 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/securerandom.rb
    80 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/fiddle.so
    81 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/function.rb
    82 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/closure.rb
    83 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle.rb
    84 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/value.rb
    85 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/pack.rb
    86 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/struct.rb
    87 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/cparser.rb
    88 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/fiddle/import.rb
    89 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/win32/registry.rb
    90 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/win32/resolv.rb
    91 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/resolv.rb
    92 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/remote_fetcher.rb
    93 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/text.rb
    94 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/name_tuple.rb
    95 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/rubygems/spec_fetcher.rb
    96 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/source/rubygems.rb
    97 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/tsort.rb
    98 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/forwardable.rb
    99 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/spec_set.rb
    100 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/environment.rb
    101 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/runtime.rb
    102 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/source/path.rb
    103 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/resolver.rb
    104 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/dep_proxy.rb
    105 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/index.rb
    106 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/ui.rb
    107 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/ui/silent.rb
    108 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/remote_specification.rb
    109 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/lazy_specification.rb
    110 E:/HashiCorp/Vagrant/embedded/gems/gems/bundler-1.7.11/lib/bundler/endpoint_specification.rb
    111 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/version.rb
    112 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/config.rb
    113 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/base.rb
    114 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/singleton.rb
    115 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/repository.rb
    116 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/logevent.rb
    117 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/loggerfactory.rb
    118 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/staticlogger.rb
    119 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/logger.rb
    120 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/outputterfactory.rb
    121 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/formatter/formatter.rb
    122 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/outputter.rb
    123 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/iooutputter.rb
    124 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/fileoutputter.rb
    125 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/consoleoutputters.rb
    126 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/staticoutputter.rb
    127 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/outputter/rollingfileoutputter.rb
    128 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/GDC.rb
    129 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/MDC.rb
    130 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/NDC.rb
    131 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r/formatter/patternformatter.rb
    132 E:/HashiCorp/Vagrant/embedded/gems/gems/log4r-1.1.10/lib/log4r.rb
    133 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/delegate.rb
    134 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/tmpdir.rb
    135 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/tempfile.rb
    136 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/shared_helpers.rb
    137 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/json/version.rb
    138 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/ostruct.rb
    139 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/json/generic_object.rb
    140 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/json/common.rb
    141 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/utf_16be.so
    142 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/utf_32be.so
    143 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/enc/utf_32le.so
    144 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/json/ext/parser.so
    145 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/json/ext/generator.so
    146 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/json/ext.rb
    147 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/json.rb
    148 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/errors.rb
    149 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/abstract_process.rb
    150 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/abstract_io.rb
    151 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/2.0/ffi_c.so
    152 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/platform.rb
    153 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/types.rb
    154 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/library.rb
    155 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/errno.rb
    156 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/pointer.rb
    157 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/memorypointer.rb
    158 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/struct_layout_builder.rb
    159 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/struct.rb
    160 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/union.rb
    161 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/managedstruct.rb
    162 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/callback.rb
    163 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/io.rb
    164 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/autopointer.rb
    165 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/variadic.rb
    166 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/enum.rb
    167 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi/ffi.rb
    168 C:/Users/Mike/.vagrant.d/gems/gems/ffi-1.9.9-x86-mingw32/lib/ffi.rb
    169 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/lib.rb
    170 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/structs.rb
    171 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/handle.rb
    172 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/io.rb
    173 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process_builder.rb
    174 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows/process.rb
    175 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess/windows.rb
    176 C:/Users/Mike/.vagrant.d/gems/gems/childprocess-0.5.6/lib/childprocess.rb
    177 E:/HashiCorp/Vagrant/embedded/gems/gems/i18n-0.6.11/lib/i18n/version.rb
    178 E:/HashiCorp/Vagrant/embedded/gems/gems/i18n-0.6.11/lib/i18n/exceptions.rb
    179 E:/HashiCorp/Vagrant/embedded/gems/gems/i18n-0.6.11/lib/i18n/interpolate/ruby.rb
    180 E:/HashiCorp/Vagrant/embedded/gems/gems/i18n-0.6.11/lib/i18n.rb
    181 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/version.rb
    182 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin.rb
    183 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/registry.rb
    184 E:/HashiCorp/Vagrant/embedded/gems/gems/i18n-0.6.11/lib/i18n/config.rb
    185 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/components.rb
    186 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/errors.rb
    187 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2.rb
    188 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/plugin.rb
    189 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/manager.rb
    190 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v1/errors.rb
    191 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v1.rb
    192 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v1/plugin.rb
    193 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v1/manager.rb
    194 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/provisioners/chef/command_builder.rb
    195 E:/HashiCorp/Vagrant/embedded/rgloader/rgloader20.mingw.so
    196 E:/HashiCorp/Vagrant/embedded/rgloader/loader.rb
    197 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-share-1.1.3/lib/vagrant-share.rb
    198 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/version.rb
    199 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util.rb
    200 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/shellwords.rb
    201 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/io.rb
    202 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_chdir.rb
    203 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/which.rb
    204 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/subprocess.rb
    205 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/platform.rb
    206 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb
    207 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/Action/UpdateHosts.rb
    208 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/Action/CacheHosts.rb
    209 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/Action/RemoveHosts.rb
    210 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/plugin.rb
    211 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater.rb
    212 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant.rb
    213 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/bundler.rb
    214 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/optparse.rb
    215 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/safe_puts.rb
    216 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb
    217 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb
    218 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/io/console.so
    219 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/ui.rb
    220 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/protocol.rb
    221 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/i386-mingw32/zlib.so
    222 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/exceptions.rb
    223 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/header.rb
    224 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/generic_request.rb
    225 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/request.rb
    226 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/requests.rb
    227 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/response.rb
    228 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/responses.rb
    229 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/proxy_delta.rb
    230 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http/backward.rb
    231 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/http.rb
    232 E:/HashiCorp/Vagrant/embedded/lib/ruby/2.0.0/net/https.rb
    233 E:/HashiCorp/Vagrant/embedded/gems/gems/hashicorp-checkpoint-0.1.4/lib/checkpoint/platform.rb
    234 E:/HashiCorp/Vagrant/embedded/gems/gems/hashicorp-checkpoint-0.1.4/lib/checkpoint/version.rb
    235 E:/HashiCorp/Vagrant/embedded/gems/gems/hashicorp-checkpoint-0.1.4/lib/checkpoint.rb
    236 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/file_mode.rb
    237 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/util.rb
    238 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/generator.rb
    239 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/converter.rb
    240 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/error.rb
    241 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/context.rb
    242 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/evaluator.rb
    243 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/engine.rb
    244 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/helper.rb
    245 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/enhancer.rb
    246 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/engine/eruby.rb
    247 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis/local-setting.rb
    248 E:/HashiCorp/Vagrant/embedded/gems/gems/erubis-2.7.0/lib/erubis.rb
    249 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/template_renderer.rb
    250 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/vagrantfile.rb
    251 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb
    252 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb
    253 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action.rb
    254 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/hook.rb
    255 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb
    256 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb
    257 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/synced_folders/nfs/action_cleanup.rb
    258 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/scoped_hash_override.rb
    259 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/mixin_synced_folders.rb
    260 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/synced_folder_cleanup.rb
    261 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb
    262 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/up/start_mixins.rb
    263 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/reload/command.rb
    264 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config.rb
    265 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/loader.rb
    266 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2.rb
    267 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/util.rb
    268 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/root.rb
    269 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/version_base.rb
    270 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/loader.rb
    271 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/vm_provisioner.rb
    272 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/stacked_proc_runner.rb
    273 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/vm_subvm.rb
    274 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/config.rb
    275 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/vm.rb
    276 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/ssh_connect.rb
    277 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/ssh.rb
    278 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/config/v2/dummy_config.rb
    279 C:/Users/Mike/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/config.rb
    280 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/downloader.rb
    281 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/retryable.rb
    282 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/provisioner.rb
    283 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/provisioners/shell/provisioner.rb
    284 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/provisioners/shell/config.rb
    285 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/rdp/config.rb
    286 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/communicators/winrm/config.rb
    287 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/guests/smartos/config.rb
    288 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/guests/solaris/config.rb
    289 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/guests/solaris11/config.rb
    290 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/guests/windows/config.rb
    291 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/package.rb
    292 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/push.rb
    293 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/kernel_v2/config/vagrant.rb
    294 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/synced_folders/nfs/config.rb
    295 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/config.rb
    296 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/silence_warnings.rb
    297 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine_index.rb
    298 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/box_collection.rb
    299 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/capability_host.rb
    300 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/provider.rb
    301 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/provider.rb
    302 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/base.rb
    303 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/driver/meta.rb
    304 E:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/errors.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

ignore machines that havn't been created yet

In a multi-machine vagrant configuration, it is possible to end up in a scenario where the hostsupdater tries to remove hosts for a machine that hasn't been created yet. For example,

Assume web01 and db01 machines are defined but have not been created
User does vagrant up web01
Then user does vagrant halt

In this situation, hostsupdater presents an error on the halt because of a specific error as shown here:
https://gist.github.com/einsty/5790884

(note the line numbers are based on the version that I'd been working on for windows support)

This is a low priority fix but just something to add polish

Remove hosts after actually agreed with destroying the VM

Actual situation:

Hosts are removed before the user have chance to confirm destruction.

radeksimko@me:web-server $ sudo vagrant destroy
[default] Removing hosts
Are you sure you want to destroy the 'default' VM? [y/N]

Expected situation:

radeksimko@me:web-server $ sudo vagrant destroy
Are you sure you want to destroy the 'default' VM? [y/N]y
[default] Removing hosts

Exception when hashing machine's uuid

Hello,

We were using hostsupdater for a few weeks for our project, but we're having an issue since the last couple of releases came out. When attempting to "vagrant up" a virtual machine, we receive the following error:

Bringing machine 'default' up with 'virtualbox' provider...
[default] Checking for host entries
/Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:104:in digest': can't convert nil into String (TypeError) from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:104:inhexdigest'
from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:104:in signature' from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:66:inblock in getHostEntries'
from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:65:in each' from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:65:ingetHostEntries'
from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:33:in block in addHostEntries' from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:32:ineach'
from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/HostsUpdater.rb:32:in addHostEntries' from /Users/willhastings/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.9/lib/vagrant-hostsupdater/Action/UpdateHosts.rb:18:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/warden.rb:34:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/plugins/providers/virtualbox/action/created.rb:15:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/warden.rb:34:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/builder.rb:109:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/runner.rb:61:in block in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/util/busy.rb:19:inbusy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/runner.rb:61:in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/builtin/call.rb:43:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/warden.rb:34:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/builtin/config_validate.rb:25:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/warden.rb:34:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/warden.rb:34:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/builder.rb:109:incall'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/runner.rb:61:in block in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/util/busy.rb:19:inbusy'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/action/runner.rb:61:in run' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/machine.rb:129:inaction'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/plugins/commands/up/command.rb:37:in block in execute' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/plugin/v2/command.rb:182:inblock in with_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/plugin/v2/command.rb:180:in each' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/plugin/v2/command.rb:180:inwith_target_vms'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/plugins/commands/up/command.rb:32:in execute' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/cli.rb:46:inexecute'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/lib/vagrant/environment.rb:406:in cli' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.2/bin/vagrant:60:in<top (required)>'
from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in load' from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in

'

I think maybe "@machine.id" isn't returning our VM's ID? Our Vagrantfile is located here:
https://github.com/kalamuna/kalastack/blob/2.x/Vagrantfile

In order for all of our VMs to have unique IDs, we create a random ID and save it to a file, then assign it to the VM with:
config.vm.hostname = File.read(".kalabox/uuid")

Would you be able to shed any light on why this isn't working with hostsupdater? We'd really appreciate any insight you may have.

Best,
Will Hastings
Kalamuna

Consolidate /etc/hosts management plugin efforts

https://github.com/mosaicxm/vagrant-hostmaster

It seems that the maintainer of vagrant-hostmaster has, for all intents and purposes, abandonned the project. If you feel you can shepherd a project more effectively, I'd be happy to raid his issue queues and try to send everyone your way.

Also, so long as you attribute, I also can't see any problem with leveraging some of the code and features that he's written where you can. Obviously, I'll reach out to him on both these things before acting, but just wanted to know whether you'd be up to the challenge of maintaining -- even if you don't feel prepared yourself, you just need to be willing to open up to help, and make sure that somebody is looking after it :)

Hosts removed even if VM not destroyed

A vagrant destroy command immediately removes the /etc/hosts entries prior to the Vagrant Y/N prompt.

If possible it would be better to only remove the entires after the user has confirmed they wish to destroy.

$ vagrant destroy
[default] Removing hosts
fd58effd-d272-4133-8058-22b830d2ce64
fd58effd-d272-4133-8058-22b830d2ce64
removing uids
sed -e '/fd58effd-d272-4133-8058-22b830d2ce64/ d' -ibak /etc/hosts
Are you sure you want to destroy the 'default' VM? [y/N] n
[default] The VM 'default' will not be destroyed, since the confirmation
was declined.

Disable deleting host entries

We just started using your plug-in and we're very thankful for it. I was wondering, however, if there are any plans for adding an option not to undo the changes to the hosts file upon halting the vagrant machine. The nature of our setup doesn't require us to modify that file all too often and the constant prompts for the admin password are a bit annoying. Just to be clear, I have no problem with the prompt itself and understand the need for it, but in our particular case I feel like the rewriting of the hosts file is a bit superfluous.

DHCP / Dynamic IP

Am I correct in thinking this plugin does not work for networks that use DHCP?

eg:

  config.vm.network "private_network", type: "dhcp"

Error on vagrant reload

Summary

When running vagrant reload --no-provision on a Vagrantfile that contains multiple machines, the vagrant-hostsupdater plugin will cause a fatal error. I believe that this fatal error is related to having some machines with autostart: false.

Steps to Reproduce

  • Install the following Vagrant file, and run vagrant up:
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|

  config.ssh.forward_x11 = true
  config.ssh.forward_agent = true
  config.vm.provider "virtualbox" do |v|
    v.memory = 1024
  end
  config.vm.synced_folder ENV['HOME'], "/host"

  config.vm.define "test1" do |test|
    test.vm.box = "hashicorp/precise64"
    test.vm.network "private_network", ip: "192.168.33.10"
    test.vm.hostname = "test1.vagrant.dev"
  end

  config.vm.define "test2", autostart: false do |test|
    test.vm.box = "ubuntu/trusty64"
    test.vm.network "private_network", ip: "192.168.33.11"
    test.vm.hostname = "test2.vagrant.dev"
  end 

  config.vm.define "test3" do |test|
    test.vm.box = "hashicorp/precise64"
    test.vm.network "private_network", ip: "192.168.33.12"
    test.vm.hostname = "test3.vagrant.dev"
  end

end
  • Run vagrant reload --no-provision
  • See output similar to the following:
==> test1: Attempting graceful shutdown of VM...
==> test1: Checking if box 'hashicorp/precise64' is up to date...
==> test1: Clearing any previously set forwarded ports...
==> test1: Fixed port collision for 22 => 2222. Now on port 2202.
==> test1: Clearing any previously set network interfaces...
==> test1: Preparing network interfaces based on configuration...
    test1: Adapter 1: nat
    test1: Adapter 2: hostonly
==> test1: Forwarding ports...
    test1: 22 => 2202 (adapter 1)
==> test1: Running 'pre-boot' VM customizations...
==> test1: Booting VM...
==> test1: Waiting for machine to boot. This may take a few minutes...
    test1: SSH address: 127.0.0.1:2202
    test1: SSH username: vagrant
    test1: SSH auth method: private key
    test1: Warning: Connection timeout. Retrying...
==> test1: Machine booted and ready!
==> test1: Checking for guest additions in VM...
    test1: The guest additions on this VM do not match the installed version of
    test1: VirtualBox! In most cases this is fine, but in rare cases it can
    test1: prevent things such as shared folders from working properly. If you see
    test1: shared folder errors, please make sure the guest additions within the
    test1: virtual machine match the version of VirtualBox you have installed on
    test1: your host and reload your VM.
    test1: 
    test1: Guest Additions Version: 4.2.0
    test1: VirtualBox Version: 4.3
==> test1: Checking for host entries
==> test1: Setting hostname...
==> test1: Configuring and enabling network interfaces...
==> test1: Mounting shared folders...
    test1: /host => /Users/jpry
    test1: /vagrant => /Users/jpry/vagrant_test
==> test1: Machine not provisioning because `--no-provision` is specified.
==> test2: VM not created. Moving on...
==> test2: Checking for host entries
/Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `digest': no implicit conversion of nil into String (TypeError)
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `hexdigest'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `signature'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:70:in `block in getHostEntries'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:69:in `each'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:69:in `getHostEntries'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:33:in `block in addHostEntries'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:32:in `each'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:32:in `addHostEntries'
    from /Users/jpry/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/Action/UpdateHosts.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/action/message_not_created.rb:11:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:214:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:191:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:516:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/machine.rb:178:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/reload/command.rb:39:in `block in execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:226:in `block in with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:220:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/plugin/v2/command.rb:220:in `with_target_vms'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/plugins/commands/reload/command.rb:37:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/cli.rb:42:in `execute'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.7.2/lib/vagrant/environment.rb:301:in `cli'
    from /opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant:174:in `<main>'

Password-less sudo?

I'm on OS X. Is there a way to stop Vagrant from asking my password in order to add/remove the host entries?

Asks for password when modifying /etc/hosts but does not accept vagrant's default password

This might not be a bug in hostsupdater, more of a misconfiguration on my part, but on my fairly basic vagrant install I keep getting prompted for a password during the /etc/hosts update and yet no password I can think of will work (especially vagrant's default "vagrant" password). Since the vagrant user is setup to be passwordless it's unclear why it should even be prompting for a password?

This also seems to cause some issue with future "vagrant up" commands hanging, but not sure if it's truly related.

osx sudoers and the correct command to allow

I wanted to allow hosts updater to run without root password on osx. although this is not horrible to work around I feel like it could make it much easier to implement.

Another similar situation was the NFS shares requiring access to /etc/exports.. there was a solution by adding the command to the sudoers file and I have attempted to without success to create a similar solution for this.

Was there any information on what the command might consist of and has anyone else accomplished this in their own machine?

Example of sudoers setup script:
https://gist.github.com/GUI/2864683

Skip sudo if the user has write permissions to /etc/hosts

If users have write permissions to /etc/hosts we shouldn't force a sudo (to avoid the pw prompting).

if !File.writable?("/etc/hosts")
sudo(removeFromHosts)
else
#{removeFromHosts}
end

Would work, if you disabled the backups in sed. The backup file creation requires write access to /etc which I doubt people want to open up that wide.

Yellow text on white background

Steps to reproduce:

  1. Run a command like vagrant destroy when you haven't created a VM.

Expected result: Black on white text.

Actual result: A message in yellow text that I have to highlight to read. It says: ==> default: No machine id, nothing removed from /etc/hosts

There are others, and this issue is meant to refer to the yellow text in general.

Hosts file change only happens if provisioning is successful

Bug Description

Running vagrant up with ansible provisioning fails, due to the hosts file not being altered yet. Running vagrant up --provision-with=shell shows the hosts file being updated after the provisioning call.

Expected behaviour

Hostsupdater should execute its hooks prior to provisioning executing.

Multiple Sites

Hi all,
If I have a Vagrantfile in the root of (for example), my ~/Sites directory and then have projects within that I'd like to have custom hostnames for - does this plugin allow for something like that (to read from internal projects/folders and setup each)?

Line break not inserted before first host — leads to broken lines

MAMP Pro seems to insert its rules at the end of /etc/hosts without a trailing line break. vagrant-hostsupdater then adds its rules after without a prepended line break. Thus, two rules get put on one line, and the vagrant-hostsupdater line does not work. I have to manually go in and fix it from time to time.

I would suggest that vagrant-hostsupdater always include a prepended line break.

configuration with yaml

i'm using the laravel/homestead, Homestead.yaml config has sites like "homestead.app" and in vagranfile

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
Homestead.configure(config, YAML::load(File.read(path + '/Homestead.yaml')))
end

after up at /etc/hosts only appear "homestead" without extension

allow opting out

It would be nice for highly technical users to be able to opt out of using this, and for hostsupdater to provide a message stating what configuration must be added if a user opts out.

Would you accept a PR for this behavior, or consider implementing it yourself?

/cc @tbranyen @jugglinmike

Errors on 'vagrant destroy' if vm doesn't exist

Hostupdater isn't handling a destroy request properly if the VM is already destroyed.

i.e. - execute vagrant destroy twice and on the second invocation you'll get:
/Users/tpbrown/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.5/lib/vagrant-hostsupdater/HostsUpdater.rb:51:in quote': can't convert NilClass to String (TypeError) from /Users/tpbrown/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.5/lib/vagrant-hostsupdater/HostsUpdater.rb:51:inremoveHostEntries'
from /Users/tpbrown/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.5/lib/vagrant-hostsupdater/Action/RemoveHosts.rb:17:in call' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/warden.rb:34:incall'

remove_on_suspend should default to true

Regarding #4, I think having remove_on_suspend default to false is very odd.

Why would you want your hosts entries to persist if your VM is not available? They're not of any use. And if it's a real domain you're resolving, it can actually lead to confusion. The entries relate to the VM. If the VM isn't running, the entries shouldn't be there.

newline for windows

I've noticed when doing a halt then an up in vagrant that the host entry in my windows host file is placed at the end of the last line instead of on a new line.

Support for multiple `private_network` adapters

Given the following Vagrant setup, vagrant-hostsupdater produces an invalid /etc/hosts file where different hostnames need to be bound to different IP addresses within the guest:

  ip_address_au = "10.0.0.28"
  ip_address_nz = "10.0.0.29"
  config.vm.network "private_network", ip: ip_address_nz
  config.vm.network "private_network", ip: ip_address_au

  if Vagrant.has_plugin?("vagrant-hostsupdater")
    config.hostsupdater.aliases = ["foo.com", "bar.com"}
  end
  ...

The /etc/hosts file will look something like:

10.0.0.28  foo.com  # VAGRANT: 76d2a8f38ca5dad7d0414a3dc013813c (default) / 234b3f77-7624-4b98-8ce1-5560abeb4ff7
10.0.0.28  bar.com  # VAGRANT: 76d2a8f38ca5dad7d0414a3dc013813c (default) / 234b3f77-7624-4b98-8ce1-5560abeb4ff7
10.0.0.29  foo.com  # VAGRANT: 72750f9e895980fb84e2792fd10a90f3 (default) / 5571d2f0-bb3e-4897-b151-394a8db63b05
10.0.0.29  foo.com  # VAGRANT: 72750f9e895980fb84e2792fd10a90f3 (default) / 5571d2f0-bb3e-4897-b151-394a8db63b05b

It would be great if support for mapping IPs to hostnames were added:

e.g. a syntax something like:

    config.hostsupdater.aliases = {ip_address_au => ["foo.com"], ip_address_nz => ["bar.com"]}

would produce a hosts file like:

10.0.0.28  foo.com  # VAGRANT: 76d2a8f38ca5dad7d0414a3dc013813c (default) / 234b3f77-7624-4b98-8ce1-5560abeb4ff7
10.0.0.29  bar.com  # VAGRANT: 72750f9e895980fb84e2792fd10a90f3 (default) / 5571d2f0-bb3e-4897-b151-394a8db63b05b

Strange error on first vagrant up [Mac OS 10.8/10.9]

I have received the same error on 2 separate machines (Macbook Pro @ 10.8 /iMac @ 10.9):

~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `digest': can't convert nil into String (TypeError)
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `hexdigest'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:107:in `signature'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:70:in `block in getHostEntries'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:69:in `each'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:69:in `getHostEntries'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:33:in `block in addHostEntries'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:32:in `each'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/HostsUpdater.rb:32:in `addHostEntries'
  from ~/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.11/lib/vagrant-hostsupdater/Action/UpdateHosts.rb:18:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builtin/call.rb:57:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/warden.rb:34:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/builder.rb:116:in `call'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `block in run'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/util/busy.rb:19:in `busy'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/action/runner.rb:61:in `run'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/machine.rb:147:in `action'
  from /Applications/Vagrant/embedded/gems/gems/vagrant-1.3.5/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'

This is my Vagrantfile:
https://raw.github.com/milojennings/zippy/0.1/Vagrantfile

Everything works perfectly on the second vagrant up.

Aliases should be kept in same line as host declarations?

@Cogitatio, I don't now if it would really be an enhancement (I've heard from @alganet we could share cookies between hosts if they were declared together).

Anyway, the way /etc/hosts is defined currently:

192.168.56.101  s4aws.localhost  # VAGRANT: 0c9076b3-e38f-4b9d-b62b-210c8fc67043 (default)
192.168.56.101  www.s4aws.localhost  # VAGRANT: 0c9076b3-e38f-4b9d-b62b-210c8fc67043 (default)

The way I think it could be:

192.168.56.101  s4aws.localhost  www.s4aws.localhost  # VAGRANT: 0c9076b3-e38f-4b9d-b62b-210c8fc67043 (default)

@netojoaobatista, you already help me with this gist. Could you say as if what I'm proposing here is worth or not?

Thanks guys!

failed to remove hosts on vagrant 1.4.0

Hi.

After I updated vagrant from 1.3.5 to 1.4.0 (I also uninstalled and re-installed vagant-hostupdater). The plugin failed to remove the /etc/hosts entries. Would you kindly please see what's broken?

here are some debug logs. let me know if you need other info :)

Can't convert NilClass to String Exception executing vagrant destroy

To reproduce the bug is sufficient to execute the command vagrant destroy on a running or previously halted virtual machine.

I attach here the full terminal output:

smux:vagrant-web andrea$ vagrant halt
[vagrant_web] Attempting graceful shutdown of VM...
[vagrant_web] Removing hosts
953c75ef-6368-4829-aa70-908ab258649a
953c75ef\-6368\-4829\-aa70\-908ab258649a
removing uids
sed -e '/953c75ef-6368-4829-aa70-908ab258649a/ d' -ibak /etc/hosts
smux:vagrant-web andrea$ vagrant destroy
[vagrant_web] Removing hosts
Are you sure you want to destroy the 'vagrant_web' VM? [y/N] y
[vagrant_web] Destroying VM and associated drives...
/Users/andrea/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.3/lib/vagrant-hostsupdater/HostsUpdater.rb:51:in `quote': can't convert NilClass to String (TypeError)
    from /Users/andrea/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.3/lib/vagrant-hostsupdater/HostsUpdater.rb:51:in `removeHostEntries'
    from /Users/andrea/.vagrant.d/gems/gems/vagrant-hostsupdater-0.0.3/lib/vagrant-hostsupdater/Action/RemoveHosts.rb:16:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/builder.rb:116:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/machine.rb:147:in `action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/command.rb:23:in `block in execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:182:in `block in with_target_vms'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:180:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/plugin/v2/command.rb:180:in `with_target_vms'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/plugins/commands/destroy/command.rb:22:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/cli.rb:46:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/environment.rb:467:in `cli'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/bin/vagrant:84:in `<top (required)>'
    from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
    from /Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'

Thanks!

Wrong line break in /etc/hosts

Plugin installed in version : 0.0.11

$ vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Installed the plugin 'vagrant-hostsupdater (0.0.11)'!

but having this in my /etc/hosts after doing vagrant up :

10.0.0.11
  thor.es.dev  # VAGRANT: 8090827cd2e880fb1b5fb09f745f8a20 (vm1) / 7b9f78fa-c713-4056-83ef-f93c206f01e8

Adding support for docker provider.

Hi,

Are there plans to add docker provider support or is this available already and I have missed it? I tested and got the following configuration working so that the container could be accessed from my local host with the alias on the default port:

config.vm.network "forwarded_port", guest: 8080, host: 80
config.vm.network "private_network", ip: "127.0.0.1"
config.hostsupdater.aliases = ["blah"]

The current version of docker updates the container IP on commands like reload and up so static IP is does not work. I was thinking that having the plugin update the host file with the new docker IP. The work around above which limits me to having only one alias to the default web port. Is there interest in adding this functionality?

Vang

aliases are ignored on vagrant 1.7.4

it looks like that on vagrant 1.7.4 the hostname gets inserted correctly into the /etc/hosts file though the aliases are just ignored upon vagrant startup instructions.

UAC issues on Windows

On Windows, hostsupdater fails unless vagrant is run as an administrator. Unfortunately, this is really not the smart way to run vagrant. I know you can elevate privileges through WIN32OLE, but I'm not familiar enough with ruby to actually patch it myself. Thoughts?

Bundler Says error installing nokogiri

Sorry I am not sure if this is an issue with this repo or with bundler itself, but..
Getting an error installing "An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.6.6.2' succeeds before bundling."

I ran "gem install nokogiri -v '1.6.6.2'" and it installed just fine. I would assume since it's already installed bundler shouldn't even try to install but I keep getting this error. I originally had to recompile ruby with openssl as I was getting an issue with installing nokogiri this way as well.

gem build vagrant-hostsupdater.gemspec produces invalid gem

gem build vagrant-hostsupdater.gemspec
mv vagrant-hostsupdater-0.0.11.gem /tmp/vagrant-hostsupdater-0.0.11.gem
vagrant plugin uninstall vagrant-hostsupdater
vagrant plugin install /tmp/vagrant-hostsupdater-0.0.11.gem

produces empty ~.vagrant.d\gems\gems\vagrant-hostsupdater-0.0.11 folder
unlike other vagrant plugins

that makes it impossible to build custom gems from plugin forks and makes git useless, unless you merge #41

Windows Support? What would it take?

Thanks so much for this little plugin. SO far it is working like a champ for those in our team who are on *nix operating systems but the Windows folks are left hanging in the wind.

I might be inclinded to help out on this task but not totally familiar w/ ruby, would this be as easy as extracting the path that is used in the .rb file several times into a variable that is determined in some fashion? Or is there more to it?

Set custom ip

There would be nice to have a chance to configure ip address that is used in hosts file when host entries are added. The default would be :private_network and if it necessary, user can set

config.hostsupdater.ip = "127.0.0.1"

and override defaults.

What do you think about it?

Installation break up - Nokogiri issue

vagrant plugin install vagrant-hostsupdater
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing nokogiri (1.6.6.2), and Bundler cannot continue.
Make sure that gem install nokogiri -v '1.6.6.2' succeeds before bundling.

sudo should ask for password at beginning of 'vagrant up', not in the middle.

Hi,

We've started using this plugin with Vagrant under OS X at our office, and it works well. But one issue that keeps coming up is that some time after running "vagrant up", 'sudo' requests the user's password (in order to edit /etc/hosts) in the middle of our fairly long provisioning process. The length of that process wouldn't be an issue if a user could start it and walk away, but instead they have to wait around an indeterminate period of time before they're asked to enter their password.

I solve this by running "sudo echo foo; vagrant up" so that sudo caches my password. It would be much better if the plugin did that internally: ask for the user's password as early in the process as possible, and let sudo cache it until it's needed.

Install crashes on OSX Mavericks

It looks like something is seriously wrong with the installer when attempting to set up hostsupdater under OSX Mavericks. Even with root privileges, the installer generates the following output:

Xs-MacBook-Pro:~ x$ sudo vagrant plugin install vagrant-hostsupdater
Password:
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes...
Building nokogiri using packaged libraries.
Bundler, the underlying system Vagrant uses to install plugins,
reported an error. The error is shown below. These errors are usually
caused by misconfigured plugin installations or transient network
issues. The error from Bundler is:

An error occurred while installing nokogiri (1.6.2.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.6.2.1'` succeeds before bundling.

...and when I try to install the dependency directly:

Xs-MacBook-Pro:~ x$ sudo gem install nokogiri -v '1.6.2.1'
Building native extensions.  This could take a while...
Building nokogiri using packaged libraries.
ERROR:  Error installing nokogiri:
    ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
Building nokogiri using packaged libraries.
checking for iconv.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
    --help
    --clean
    --use-system-libraries
    --enable-static
    --disable-static
    --with-zlib-dir
    --without-zlib-dir
    --with-zlib-include
    --without-zlib-include=${zlib-dir}/include
    --with-zlib-lib
    --without-zlib-lib=${zlib-dir}/lib
    --enable-cross-build
    --disable-cross-build
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:502:in `with_werror'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:310:in `open'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
    from extconf.rb:103:in `have_iconv?'
    from extconf.rb:148:in `block (2 levels) in iconv_prefix'
    from extconf.rb:90:in `preserving_globals'
    from extconf.rb:143:in `block in iconv_prefix'
    from extconf.rb:120:in `each_iconv_idir'
    from extconf.rb:137:in `iconv_prefix'
    from extconf.rb:424:in `block in <main>'
    from extconf.rb:161:in `block in process_recipe'
    from extconf.rb:154:in `tap'
    from extconf.rb:154:in `process_recipe'
    from extconf.rb:419:in `<main>'


Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.2.1/ext/nokogiri/gem_make.out

Note that xcode is installed on this system, and the command-line tools seem to be working. I don't have enough experience with Ruby to get into any serious debugging with this one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.