If you are trying to reproduce this exactly, I'm using the following environment:
- VirtualBox 4.3.12
- Bills Kitchen 3.0-rc4 (includes Vagrant, Packer, Chef, etc)
First challenge is to get a windows basebox from somewhere. I couldn't find a good one, so built one myself from the windows/boxcutter packer templates:
git clone https://github.com/boxcutter/windows.git windows-boxes
cd windows-boxes
make virtualbox/eval-win7x86-enterprise
This takes a while (~45 minutes, depending on your internet connection).
Once the basebox is built, you can import it to Vagrant:
vagrant box add boxcutter/eval-win7x86-enterprise box/virtualbox/eval-win7x86-enterprise-nocm-1.0.4.box
Next I was trying to figure out a minimal Vagrantfile example, which works for all the basic Vagrant things, e.g.:
vagrant up
should not work reliably (not hang / run into timeouts)vagrant ssh
should workvagrant ssh -c "echo foo"
should run the commandvagrant provision
should work, with eitherinline:
orpath:
(.bat / .ps) "shell" provisioner- synced folders should work (via vboxsf or smb ideally)
The Vagrantfile that is packaged within the above built basebox already includes some windows specific settings, such as setting config.vm.communicator = "winrm"
and config.vm.guest = :windows
, so we don't need to repeat that in our Vagrantfile.
So this was my first try:
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/eval-win7x86-enterprise-nocm"
config.vm.provision "shell", inline: "echo hello!"
config.vm.synced_folder ".", "/vagrant", disabled: true
end
No luck though...
vagrant up
works, but hangs and never completes (I can Ctrl+C though and continue working with the VM)vagrant ssh
works, yay! :-)vagrant ssh -c "echo foo"
drops me into the shell instead of executing the commandvagrant provision
hangs and times out- synced folders I explicitly disabled for now to make it even simpler
Hmmmm... running
vagrant provision --debug
looks like it can't connect to winrm?This is where it stalls: