Code Monkey home page Code Monkey logo

vagrant-windows's Introduction

Vagrant-Windows

Build Status Code Climate Gem Version

This plugin is deprecated, please use Vagrant 1.6+ which natively supports Windows guests over WinRM.

This Vagrant plugin allows you to standup Windows guests using WinRM instead of SSH on older versions of Vagrant.

Getting Started

  1. Install the vagrant-windows plugin.
  2. Create and configure a Windows guest base box.
  3. Create a Vagrantfile.
  4. vagrant up

Installation

Vagrant 1.6 will natively support Windows guests, this plugin should not be used with Vagrant 1.6 or later.

  • For Vagrant 1.1 -> 1.5 execute vagrant plugin install vagrant-windows.
  • For Vagrant 1.0 execute vagrant plugin install vagrant-windows --plugin-version 0.1.2.

Creating a Base Box

Supported Guest Operating Systems:

  • Windows 7
  • Windows 8
  • Windows Server 2008
  • Windows Server 2008 R2
  • Windows Server 2012

Windows Server 2003 and Windows XP are not supported by the maintainers of this project. Any issues regarding any unsupported guest OS will be closed. If you still insist on using XP or Server 2003, this may help.

You'll need to create a new Vagrant base box. Create a new Windows VM in VirtualBox, configure some Windows settings (see below) then follow the Vagrant packaging instructions.

  • Create a vagrant user, for things to work out of the box username and password should both be "vagrant".
  • Turn off UAC (Msconfig)
  • Disable complex passwords
  • Disable Shutdown Tracker on Windows 2008/2012 Servers (except Core).
  • Disable "Server Manager" Starting at login on Windows 2008/2012 Servers (except Core).
  • Enable and configure WinRM (see below)

WinRM Configuration

These commands assume you're running from a regular command window and not PowerShell.

   winrm quickconfig -q
   winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}
   winrm set winrm/config @{MaxTimeoutms="1800000"}
   winrm set winrm/config/service @{AllowUnencrypted="true"}
   winrm set winrm/config/service/auth @{Basic="true"}
   sc config WinRM start= auto

NOTE: For the WinRM service to work in Windows 7, the network profile has to be changed from Public to Work. To ensure that networks added later (i.e. through the Vagrantfile) also are made non-public, add the following to your Vagrantfile:

# Ensure that all networks are set to private
config.windows.set_work_network = true

Additional WinRM 1.1 Configuration

These additional configuration steps are specific to Windows Server 2008 (WinRM 1.1). For Windows Server 2008 R2, Windows 7 and later versions of Windows you can ignore this section.

  1. Ensure the Windows PowerShell feature is installed
  2. Change the default WinRM port (see below) or upgrade to WinRM 2.0.
netsh firewall add portopening TCP 5985 "Port 5985"
winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}

Required Windows Services

If you like to turn off optional Windows services you'll need to ensure you leave these services enabled for vagrant-windows to continue to work:

  • Base Filtering Engine
  • Remote Procedure Call (RPC)
  • DCOM Server Process Launcher
  • RPC Endpoint Mapper
  • Windows Firewall
  • Windows Remote Management (WS-Management)

The Vagrant File

Add the following to your Vagrantfile

config.vm.guest = :windows
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true

Example:

Vagrant.configure("2") do |config|

  # Configure base box parameters
  config.vm.box = "vagrant-windows2008r2"
  config.vm.box_url = "./vagrant-windows2008r2.box"
  config.vm.guest = :windows

  # Port forward WinRM and RDP
  config.vm.network :forwarded_port, guest: 3389, host: 3389
  config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
  
end

Available Config Parameters:

  • config.windows.halt_timeout - How long Vagrant should wait for the guest to shutdown before forcing exit, defaults to 30 seconds
  • config.windows.halt_check_interval - How often Vagrant should check if the system has shutdown, defaults to 1 second
  • config.windows.set_work_network - Force network adapters to "Work Network". Useful for Win7 guests using private networking.
  • config.winrm.username - The Windows guest admin user name, defaults to vagrant.
  • config.winrm.password - The above's password, defaults to vagrant.
  • config.winrm.host - The IP of the guest, but because we use NAT with port forwarding this defaults to localhost.
  • config.winrm.guest_port - The guest's WinRM port, defaults to 5985.
  • config.winrm.port - The WinRM port on the host, defaults to 5985. You might need to change this if your hosts is also Windows.
  • config.winrm.max_tries - The number of retries to connect to WinRM, defaults to 20.
  • config.winrm.timeout - The max number of seconds to wait for a WinRM response, defaults to 1800 seconds.

Note - You need to ensure you specify a config.windows and a config.winrm in your Vagrantfile. Currently there's a problem where Vagrant will not load the plugin config even with defaults if at least one of its values doesn't exist in the Vagrantfile.


What Works?

  • vagrant up|halt|reload|provision
  • Chef Vagrant Provisioner
  • Puppet Vagrant Provisioner
  • Shell Vagrant provisioner. Batch files or PowerShell (ps1) scripts are supported as well as inline scripts.

Troubleshooting

When I run the winrm command I get: "Error: Invalid use of command line. Type "winrm -?" for help."

  • You're running the winrm command from powershell. You need to put @{MaxMemoryPerShellMB="512"} etc in single quotes:
   winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="512"}'

I get a 401 auth error from WinRM

  • Ensure you've followed the WinRM configuration instructions above.
  • Ensure you can manually login using the specified config.winrm.username you've specified in your Vagrantfile.
  • Ensure your password hasn't expired.
  • Ensure your password doesn't need to be changed because of policy.

I get a non-401 error from WinRM waiting for the VM to boot

  • Ensure you've properly setup port forwarding of WinRM
  • Make sure your VM can boot manually through VBox.

SQL Server cookbook fails to install through Vagrant

  • Ensure UAC is turned off
  • Ensure your vagrant user is an admin on the guest
  • The SQL Server installer uses a lot of resources, ensure WinRM Quota Management is properly configured to give it enough resources.
  • See COOK-1172 and http://stackoverflow.com/a/15235996/82906 for more information.

If all else fails try running vagrant with debug logging, perhaps that will give you enough insight to fix the problem or file an issue.

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_feature_branch)
  3. Commit your changes (git commit -am "Added a sweet feature")
  4. Push to the branch (git push origin my_feature_branch)
  5. Create a pull requst from your branch into master (Please be sure to provide enough detail for us to cipher what this change is doing)

Development

Clone this repository and use Bundler to get the dependencies:

$ bundle install

Once you have the dependencies, you can run the tests with rake:

$ bundle exec rake spec

If those pass, you're ready to start developing the plugin. You can test the plugin without installing it into your Vagrant environment by just creating a Vagrantfile in the top level of this directory (it is gitignored) that uses it, and use bundler to execute Vagrant:

$ bundle exec vagrant up

Installing Vagrant-Windows From Source

If you want to globally install your locally built plugin from source, use the following method (this would be for 1.2.0):

 bundle install
 bundle exec rake build
 vagrant plugin install pkg/vagrant-windows-1.2.0.gem

Keep in mind you should have Ruby 1.9.3 and Ruby DevKit installed. Check out the following gist that can get you what you need (from blank system to fully ready): Install Vagrant Windows Plugin From Source Gist.

References and Shout Outs

  • Chris McClimans - Vagrant Branch (https://github.com/hh/vagrant/blob/feature/winrm/)
  • Dan Wanek - WinRM GEM (https://github.com/zenchild/WinRM)
    • +1 For being super responsive to pull requests.
  • Mike Griffen - Added first vagrant-windows unit tests and updated readme
  • Geronimo Orozco - Shell provisioner support
  • David Cournapeau - Added config.windows.set_work_network option
  • keiths-osc - Fixed Vagrant 1.2 shared folder action
  • Rob Reynolds - Updated readme installation and box configuration notes
  • stonith - Updated readme winrm config notes
  • wenns - Updated readme to advise against forwarding RDP
  • Joe Fitzgerald - Added VMWare support and improved retry logic.

vagrant-windows's People

Contributors

cleblanc87 avatar cournape avatar dabide avatar dpetzel avatar dracoblue avatar ferventcoder avatar gorozco1 avatar joefitzgerald avatar kanzure avatar legal90 avatar mgriffin avatar odeits-vidder avatar pmorton avatar smurawski avatar sneal avatar steenhulthin avatar stonith avatar thematthopkins avatar wenns 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vagrant-windows's Issues

Chef's output is only displayed in console after completion (or after an error)

Hi, it may be more a question than a bug report, but I thinking it's worth asking since I couldn't find the answer elsewhere...

I'm running vagrant-windows 1.1 with Virtual Box and Chef. My run-list takes a long time (~25 minutes) and I noticed that it stays on Running chef-solo... until it either completes or fails. Then everything get "flushed" to the console. With a Linux box, I see the [INFO] outputted "live" which helps identify progression. Is there a way to have that with vagrant-windows too?

Thanks.

Versions:
Vagrant 1.1.5
Vagrant-windows 1.1
Virtual Box 4.2.12
Chef-solo 11.4.4-2

vagrant-windows causes "shared folder guest path is used multiple times" error when multiple chef provisioners are used

I have been using the vagrant-1.2 branch of vagrant windows for a while now. I've found an issue related to chef provisioning. Vagrant allows multiple chef provisioners to be set up on a VM. When vagrant-windows is installed from the vagrant-1.2 branch, this functionality is broken. For example, suppose you have the following Vagrantfile:

require 'openssl'

Vagrant.configure('2') do |config|
  config.berkshelf.enabled = true
  config.omnibus.chef_version = '11.4.4'

  config.vm.define :ensemble do |ensemble|
    ensemble.vm.box = 'opscode_centos-6.4_provisionerless'
    ensemble.vm.box_url = 'https://opscode-vm.s3.amazonaws.com/vagrant/opscode_centos-6.4_provisionerless.box'
    ensemble.vm.network :private_network, ip: '192.168.50.5'
    ensemble.vm.hostname = 'ensemble.example.com'

    ensemble.vm.provider :virtualbox do |vb|
      vb.name = 'ensemble'
      vb.customize ['modifyvm', :id, '--vram', 48, '--cpus', 8, '--memory', 2048, '--nictype2', 'virtio']
      #vb.gui = true
    end

    ensemble.vm.provision :chef_solo do |chef_solo|
      chef_solo.add_recipe('yum::epel')  # no one would really run this twice.  It's just an example to show the issue
    end

    ensemble.vm.provision :chef_solo do |chef_solo|
      chef_solo.add_recipe('yum::epel')  # no one would really run this twice.  It's just an example to show the issue
    end

  end

end

And the following Berksfile sitting next to the vagrantfile:

site :opscode

cookbook 'yum'

And these plugins installed:

E:\vagrant\test2>vagrant plugin list
vagrant-berkshelf (1.3.3)
vagrant-chefutil (1.2.0)
vagrant-omnibus (1.1.0)

When vagrant-windows is not installed, the machine comes up as you would expect:

E:\vagrant\test2>vagrant up
Bringing machine 'ensemble' up with 'virtualbox' provider...
[ensemble] Clearing any previously set forwarded ports...
[Berkshelf] Updating Vagrant's berkshelf: 'C:/Users/keiths/.berkshelf/ensemble/vagrant/berkshelf-20130723-8552-rbbu1x-ensemble'
[Berkshelf] Using yum (0.8.0)
[ensemble] Fixed port collision for 22 => 2222. Now on port 2201.
[ensemble] Creating shared folders metadata...
[ensemble] Clearing any previously set network interfaces...
[ensemble] Preparing network interfaces based on configuration...
[ensemble] Forwarding ports...
[ensemble] -- 22 => 2201 (adapter 1)
[ensemble] Running any VM customizations...
[ensemble] Booting VM...
[ensemble] Waiting for VM to boot. This can take a few minutes.
[ensemble] VM booted and ready for use!
[ensemble] Setting hostname...
[ensemble] Configuring and enabling network interfaces...
[ensemble] Mounting shared folders...
[ensemble] -- /vagrant
[ensemble] -- /tmp/vagrant-chef-1/chef-solo-1/cookbooks
[ensemble] Installing Chef 11.4.4 Omnibus package...
[ensemble] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
[2013-07-23T18:11:29+00:00] INFO: *** Chef 11.4.4 ***
[2013-07-23T18:11:29+00:00] INFO: Setting the run_list to ["recipe[yum::epel]"] from JSON
[2013-07-23T18:11:29+00:00] INFO: Run List is [recipe[yum::epel]]
[2013-07-23T18:11:29+00:00] INFO: Run List expands to [yum::epel]
[2013-07-23T18:11:29+00:00] INFO: Starting Chef Run for ensemble.example.com
[2013-07-23T18:11:29+00:00] INFO: Running start handlers
[2013-07-23T18:11:29+00:00] INFO: Start handlers complete.
[2013-07-23T18:11:29+00:00] INFO: Processing remote_file[/var/chef/cache/epel-release-6-8.noarch.rpm] action create (yum::epel line 38)
[2013-07-23T18:11:50+00:00] INFO: remote_file[/var/chef/cache/epel-release-6-8.noarch.rpm] updated
[2013-07-23T18:11:50+00:00] INFO: remote_file[/var/chef/cache/epel-release-6-8.noarch.rpm] sending install action to rpm_package[epel-release] (immediate)
[2013-07-23T18:11:50+00:00] INFO: Processing rpm_package[epel-release] action install (yum::epel line 45)
[2013-07-23T18:11:50+00:00] INFO: Processing rpm_package[epel-release] action nothing (yum::epel line 45)
[2013-07-23T18:11:50+00:00] INFO: Processing file[epel-release-cleanup] action delete (yum::epel line 51)
[2013-07-23T18:11:50+00:00] INFO: file[epel-release-cleanup] backed up to /var/chef/backup/var/chef/cache/epel-release-6-8.noarch.rpm.chef-20130723181150
[2013-07-23T18:11:50+00:00] INFO: file[epel-release-cleanup] deleted file at /var/chef/cache/epel-release-6-8.noarch.rpm
[2013-07-23T18:11:50+00:00] INFO: Chef Run complete in 21.014843018 seconds
[2013-07-23T18:11:50+00:00] INFO: Running report handlers
[2013-07-23T18:11:50+00:00] INFO: Report handlers complete
[ensemble] Running provisioner: chef_solo...
Generating chef JSON and uploading...
Running chef-solo...
[2013-07-23T18:11:51+00:00] INFO: *** Chef 11.4.4 ***
[2013-07-23T18:11:51+00:00] INFO: Setting the run_list to ["recipe[yum::epel]"] from JSON
[2013-07-23T18:11:51+00:00] INFO: Run List is [recipe[yum::epel]]
[2013-07-23T18:11:51+00:00] INFO: Run List expands to [yum::epel]
[2013-07-23T18:11:51+00:00] INFO: Starting Chef Run for ensemble.example.com
[2013-07-23T18:11:51+00:00] INFO: Running start handlers
[2013-07-23T18:11:51+00:00] INFO: Start handlers complete.
[2013-07-23T18:11:51+00:00] INFO: Processing remote_file[/var/chef/cache/epel-release-6-8.noarch.rpm] action create (yum::epel line 38)
[2013-07-23T18:11:51+00:00] INFO: Processing rpm_package[epel-release] action nothing (yum::epel line 45)
[2013-07-23T18:11:51+00:00] INFO: Processing file[epel-release-cleanup] action delete (yum::epel line 51)
[2013-07-23T18:11:51+00:00] INFO: Chef Run complete in 0.240250844 seconds
[2013-07-23T18:11:51+00:00] INFO: Running report handlers
[2013-07-23T18:11:51+00:00] INFO: Report handlers complete

When vagrant-windows is installed, you get this instead:

E:\vagrant\test2>vagrant up
Bringing machine 'ensemble' up with 'virtualbox' provider...
[ensemble] Importing base box 'opscode_centos-6.4_provisionerless'...
[ensemble] Matching MAC address for NAT networking...
[ensemble] Setting the name of the VM...
[ensemble] Clearing any previously set forwarded ports...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* A shared folder guest path is used multiple times. Shared
folders must all map to a unique guest path: /tmp/vagrant-chef-1/chef-solo-1/cookbooks

I have tracked this down to lib/vagrant-windows/monkey_patches/vm.rb. This monkey patch changes the shared folder id into a string that can safely be used in a windows share. Vagrant version 1.2 stores the collection of shared folders in a hash that is keyed by the guest path. That key ends up being the shared folder name in virtualbox. This monkey patch changes the key to be the "id" of the folder. Each instance of the chef provisioner creates a shared folder using the same path but a different id. Without the monkey patch, the folder collection just ends up with one copy of the shared folder (the one for the instance of the chef provisioner that shows up last in the Vagrantfile). With the monkey patch, the config ends up with an entry for each instance of the chef provisioner, all pointing to the same guest path. Also, the monkey patch causes the shared folder configuration in Virtualbox for linux guests to look different depending on whether the vagrant-windows plugin is installed or not, which does not seem ideal.

Issue when using specific IP Address

Hi,

I was trying to use the following configuration since already have a puppet master running with Passenger.

config.vm.network :private_network, ip: "10.11.12.16"

Environment


  • OS: Mac OSX 10.8.4
  • Virtual Box 4.2.12
  • Ruby 2.0.0p0
  • Target Windows Version: Windows Server 2008 R2 Standard
  • Processor : Intel Core i7 - 64 bit

Exception Details


An error occurred executing a remote WinRM command.

Shell: powershell
Command: function which {
    $command = [Array](Get-Command $args[0] -errorAction SilentlyContinue)
    if($null -eq $command)
    {
      exit 1
    }
    write-host $command[0].Definition
    exit 0
}

function test ([Switch] $d, [String] $path) {
  if(Test-Path $path)
  {
    exit 0
  }
  exit 1
}

function chown {
  exit 0
}

function mkdir ([Switch] $p, [String] $path)
{
  if(Test-Path $path)
  {
    exit 0
  } else {
    New-Item $path -Type Directory -Force | Out-Null
  }
}


hostname
Message: Connection refused - connect(2) (http://localhost:5985)

[vagrant-1.2.2] Add Support to VMWare Fusion Provider

Hi,

I have installed(purchased) the VMWare Fusion provider plugin for Vagrant and I already set my first vmware box but it seems that is not able to recognize the vmware_fusion provider

Environment


  • OS: Mac OSX 10.8.4
  • Vagrant 1.2.2
  • VMWare Fusion 5.0.3
  • Ruby 2.0.0p0
  • Target Windows Version: Windows Server 2008 R2 Standard
  • Processor : Intel Core i7 - 64 bit

Details


$ bundle exec vagrant up --provider=vmware_fusion
You appear to be running Vagrant in a Bundler environment. Because
Vagrant should be run within installers (outside of Bundler), Vagrant
will assume that you're developing plugins and will change its behavior
in certain ways to better assist plugin development.

The provider 'vmware_fusion' could not be found, but was requested to
back the machine 'default'. Please use a provider that exists.

Errors in chef run during chef provisioning aren't causing the vagrant provision to stop with an error

I've been testing the latest code on the vagrant-1.2 branch. I have several VMs that have multiple chef provisioners. I've noticed that if one of the chef runs fails, it seems to move on and run the next provisioner instead of stopping the vagrant provision with an error. I haven't investigated in depth, but my first guess is that the powershell script that's being run to do the chef run in monkey_patches\chef_solo.rb is failing to returning a non-zero exit code when it should be.

Windows-7 setting host name fails with 'Invalid Verb Switch.

Vagrant file from https://github.com/chef-azure/azure-cookbook/blob/master/Vagrantfile#L56

I'm not sure what it's setting the hostname to here

  config.vm.define :windows7 do |windows7_config|
    windows7_config.vm.host_name = "azure-windows7-workstation"
    windows7_config.vm.box = "windows-7-enterprise"
    windows7_config.vm.box_url = "./windows-7-enterprise.box" # github/opscode/bento
    windows7_config.vm.network :hostonly, "33.33.33.11"
    #...
  end

With a basebox build from https://github.com/opscode/bento/blob/master/definitions/windows-7-enterprise/definition.rb

[windows7] Importing base box 'windows-7-enterprise'...
[windows7] Matching MAC address for NAT networking...
[windows7] Clearing any previously set forwarded ports...
[windows7] Fixed port collision for 22 => 2200. Now on port 2201.
[windows7] Forwarding ports...
[windows7] -- 22 => 2201 (adapter 1)
[windows7] -- 3389 => 3390 (adapter 1)
[windows7] -- 5985 => 5985 (adapter 1)
[Berkshelf] installing cookbooks...
[Berkshelf] Using azure (0.1.0) at path: '/home/user/azure/azure-cookbook'
[windows7] Creating shared folders metadata...
[windows7] Clearing any previously set network interfaces...
[windows7] Preparing network interfaces based on configuration...
[windows7] Running any VM customizations...
[windows7] Booting VM...
[windows7] Waiting for VM to boot. This can take a few minutes.
vagrant-win7ent
[windows7] VM booted and ready for use!
[windows7] Configuring and enabling network interfaces...

[windows7] Setting host name...
Invalid Verb Switch.
translation missing: en.vagrant.errors.winrm_bad_exit_status

Vagrant 1.2 is not yet supported

It is mentioned in the README that Vagrant 1.2 is not yet supported - but I'm wondering if someone is actively working on this, or if we can start a discussion on what needs to be fixed/changed?

[vagrant1.2 branch] Error running vagrant reload

Environment


  • OS: Mac OSX 10.8.4
  • Vagrant 1.2.2
  • Virtual Box 4.2.12
  • Ruby 2.0.0p195
  • Target Windows Version: Windows Core Server 2012 Standard
  • Processor : Intel Core i7 - 64 bit

Details


I am getting the following error in a random sequence.

windows.rb:10:in initialize: wrong number of arguments (0 for 1) (ArgumentError)

I am using the published gem vagrant-windows-1.0.3

```from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:70:innew' from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:70:in block (3 levels) in detect!'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:67:in`each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:67:in `block (2 levels) in detect!'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:66:in`each'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:66:in `block in detect!'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:64:in`catch'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/guest.rb:64:in `detect!'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/machine.rb:182:in`guest'
from /Applications/Vagrant/embedded/gems/gems/vagrant-1.2.2/lib/vagrant/action/builtin/graceful_halt.rb:47: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/action/builtin/call.rb:43: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/builtin/call.rb:57: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/plugins/providers/virtualbox/action/discard_state.rb:15: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/plugins/providers/virtualbox/action/check_accessible.rb:18: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/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/action/builtin/call.rb:51: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/plugins/providers/virtualbox/action/check_virtualbox.rb:17: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/builtin/config_validate.rb:25: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/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/action/builtin/call.rb:51: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/plugins/providers/virtualbox/action/check_virtualbox.rb:17: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/reload/command.rb:29: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/reload/command.rb:28: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 `

'

Provisioning returns error on linux master with windows box

Hi,

vagrant provison returns the following error message.

<Objs xmlns="http://schemas.microsoft.com/powershell/2004/04" Version="1.1.0.1">
  <S S="Error">The token '&amp;&amp;' is not a valid statement separator in this version._x000D__x000A_</S>
  <S S="Error">At line:25 char:36_x000D__x000A_</S>
  <S S="Error">+ cd /tmp/vagrant-puppet/manifests &amp;&amp; &lt;&lt;&lt;&lt;  puppet apply --verbose --debug --tr_x000D__x000A_</S>
  <S S="Error">ace --modulepath '/tmp/vagrant-puppet/modules-0' /tmp/vagrant-puppet/manifests/_x000D__x000A_</S>
  <S S="Error">site.pp --detailed-exitcodes || [ $? -eq 2 ]_x000D__x000A_</S>
  <S S="Error">    + CategoryInfo          : ParserError: (&amp;&amp;:String) [], ParentContainsError _x000D__x000A_</S>
  <S S="Error">   RecordException_x000D__x000A_</S>
  <S S="Error">    + FullyQualifiedErrorId : InvalidEndOfLine_x000D__x000A_</S>
  <S S="Error"> _x000D__x000A_</S>
</Objs>

I'm using the 'Windows Server 2008 R2 - Datacentre full' from http://vagrantbox.es (http://dl.dropbox.com/u/58604/vagrant/win2k8r2.box) with 'vagrant-windows'.

Looks like the command in https://github.com/mitchellh/vagrant/blob/1-0-stable/lib/vagrant/provisioners/puppet.rb line 155 doesn't run in powershell.

Would it be possible to adapt this command in the 'vagrant-windows' gem?

Chef client provisioner output is garbled when using the vagrant-1.2 branch of vagrant-windows with Vagrant 1.2.5+

Vagrant has two chef provisioners: chef_solo and chef_client. I noticed recently when using the chef_client provisioner with a windows guest that the chef output is garbled in the console. Each line of the log appears to overwrite the previous line as new lines are printed. I've tracked this down to a combination of two things. First, Vagrant made a change to all of their provisioners that change how new lines are handled. (See the changeset here). Second, in winrmcommunicator.rb in vagrant-windows, the handle_out method splits the log output line by line and calls a block for each line to actually print the output instead of giving the entire output to the block. Since vagrant stopped including new lines in the blocks in the changeset linked above, the log output is now messed up.

This issue currently doesn't show up in chef solo provisioners because chef_solo.rb was copied and monkey patched from an older version of vagrant where new line characters are still being inserted, so we sort of luck out that the monkey patched code is "out of date". However, there is no monkey patch for chef_client.rb, so Vagrant's original version is being used as-is.

Action 'change_host_name" issued under powershell (not cmd)

The change_host_name method on line 15 in file

lib/vagrant-windows/guest/windows.rb

calls channel.execute without options and is therefore run under powershell. The default of powershell is specified on line 65 in file

lib/vagrant-windows/communication/winrm.rb

As such, I think the line

vm.channel.execute("wmic computersystem where name=\"%COMPUTERNAME%\" call rename name=\"#{name}\"")

should actually be

vm.channel.execute("wmic computersystem where name=\"%COMPUTERNAME%\" call rename name=\"#{name}\"", :shell => :cmd)

Run under powershell the statement fails with "Description: Invalid Query".

I believe this to be the root cause of these defects in other projects

The script

#!/usr/bin/env ruby

require 'winrm'

endpoint='http://127.0.0.1:5985/wsman'

winrm = WinRM::WinRMWebService.new(endpoint, :plaintext,
   :user=>'vagrant',
   :pass=>'vagrant',
   :basic_auth_only=>true,
   :disable_sspi=>true
)

output = winrm.cmd('wmic computersystem where name="%COMPUTERNAME%" call rename name="W12-RES-DC01X"') do | stdout, stderr |
    STDOUT.print stdout
    STDERR.print stderr
end 
STDOUT.print output.to_yaml

output = winrm.powershell('wmic computersystem where name="%COMPUTERNAME%" call rename name="W12-RES-DC01X"') do | stdout, stderr |
    STDOUT.print stdout
    STDERR.print stderr
end
STDOUT.print output.to_yaml

demonstrates that the command issued by change_host_name works under CMD

Executing (\\W12-RES-DC01X\ROOT\CIMV2:Win32_ComputerSystem.Name="W12-RES-DC01X")->rename()
Method execution successful.

Out Parameters:
instance of __PARAMETERS
{
    ReturnValue = 0;
};
--- 
:data: 
- :stdout: |
    Executing (\\W12-RES-DC01X\ROOT\CIMV2:Win32_ComputerSystem.Name="W12-RES-DC01X")->rename()

- :stdout: |
    Method execution successful.

- :stderr: "\r\n"
- :stdout: |
    Out Parameters:
    instance of __PARAMETERS
    {
        ReturnValue = 0;
    };

:exitcode: 0

but not Powershell

Invalid Verb Switch.
--- 
:data: 
- :stderr: |
    Invalid Verb Switch.

:exitcode: 1

vagrant provision failes on windows

The vagrant provision command failes for me with:

"Shared folders that Puppet requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a vagrant reload so that the proper shared
folders will prepared and mounted on the VM."

Running with debug logging enabled reveals that vagrant is checking existence of a unix path "/tmp/vagrant-puppet/manifests":

DEBUG winrm: 1
DEBUG winrm: if(-not (test-path /tmp/vagrant-puppet/manifests)) {exit 1} EXIT STATUS 1
ERROR warden: Error occurred: Shared folders that Puppet requires are missing on the virtual machine.

Im running:
Host: Linux
Guest: Windows 7
Provisioner: Puppet

bridged network not working with vagrant windows base box built with vagrant-windows and winRm

Hello:

I have built a windows 7 base box using vagrant-windows and winrm following all the steps that are mentioned in your README file.While this box works with nat and host only networking.It fails with bridged networking because winrm fails while enabling the network interfaces with the below error:

DEBUG winrm: WinRM Trying to connect
INFO winrm: Execute: netsh interface ip set address "Local Area Connection 2" dhcp
DHCP is already enabled on this interface.

DEBUG winrm: 1
DEBUG winrm: netsh interface ip set address "Local Area Connection 2" dhcp EXIT STATUS 1
ERROR warden: Error occurred: translation missing: en.vagrant.errors.winrm_bad_exit_status
INFO interface: error: translation missing: en.vagrant.errors.winrm_bad_exit_status
translation missing: en.vagrant.errors.winrm_bad_exit_status

Looks like when the new adapter is added with bridged network being enabled windows VM automatocally detects the dhcp ip and so when winrm tries to enable it fails.

Any help will be really appreciable.

Set up working environment for testing vagrant-windows

Hi,

I am planning to test vagrant-windows project using various windows versions.

My current setup looks like this:

  1. OS: Mac OSX 10.8.4
  2. Vagrant 1.2.2
  3. Virtual Box 4.2.12
  4. Ruby 2.0.0p195

I did proceed with the installation of the ruby gem but when I try to launch a box it shows me the following message:

There are errors in the configuration of this machine. Please fix the following errors and try again:

Vagrant: Unknown configuration section 'windows'. Unknown configuration section 'winrm'.

I followed all the steps for the Vagrantfile configuration but would like to know if i am missing something.

Thanks.

Error while using vagrant 1.1

Hi:
I have recently updated to vagrant 1.1
I am getting below error while trying to do vagrant up

[win1] Waiting for VM to boot. This can take a few minutes.
[win1] Failed to connect to VM!
Failed to connect to VM via SSH. Please verify the VM successfully booted
by looking at the VirtualBox GUI.

My vagrant, vagrant-windows, winrm versions are as below:
kamalim:selenium_grid kamalim$ vagrant -v
Vagrant version 1.1.5
kamalim:selenium_grid kamalim$ gem list vagrant-windows

*** LOCAL GEMS ***

vagrant-windows (1.0.1)
kamalim:selenium_grid kamalim$ gem list winrm

*** LOCAL GEMS ***

winrm (1.1.2)

My vagrant file snippet is as ๐Ÿ‘
Vagrant::Config.run do |config|
config.vm.define :win1 do |win1_config|
win1_config.vm.guest = :windows
win1_config.vm.box = "win7_enVL"
win1_config.vm.boot_mode = :gui
win1_config.vm :forward_port, guest: 3389, host: 3390
win1_config.vm :forward_port, guest: 5985, host: 5985
win1_config.vm.network :hostonly, "192.168.200.12"

Please help

Private Network fails to Vagrant Up

Here's my set up:
Vagrant: 1.1.5
ruby 1.9.3p374 (2013-01-15) [i386-mingw32]
vagrant-windows (1.0.3) [installed via vagrant plugin install vagrant-windows]
Guest: Win Server 2012 x64
Vitual Box: 4.2.16 r86992

When I do a vagrant up, I get the output below. This seems related to #29

Is there something obvious I'm missing?

Thanks,
Ashic.

G:\vagrant_test> set VAGRANT_LOG=debug
G:\vagrant_test> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] -- 80 => 8080 (adapter 1)
[default] -- 5985 => 5985 (adapter 1)
[default] -- 1433 => 1433 (adapter 1)
[default] -- 3389 => 3389 (adapter 1)
[default] Booting VM...
[default] Waiting for VM to boot. This can take a few minutes.
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
C:/Users/ashic/.vagrant.d/gems/gems/vagrant-windows-1.0.3/lib/vagrant-windows/gu
est/windows.rb:85:in block in configure_networks': undefined method[]' for ni
l:NilClass (NoMethodError)
from C:/Users/ashic/.vagrant.d/gems/gems/vagrant-windows-1.0.3/lib/vagra
nt-windows/guest/windows.rb:84:in each' from C:/Users/ashic/.vagrant.d/gems/gems/vagrant-windows-1.0.3/lib/vagra nt-windows/guest/windows.rb:84:inconfigure_networks'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/network.rb:115:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/clear_network_interfaces.rb:26:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/share_folders.rb:20:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/clear_shared_folders.rb:12:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/prepare_nfs_settings.rb:11:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/builtin/nfs.rb:28:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/prune_nfs_exports.rb:15:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/builtin/handle_forwarded_port_collisions.rb:106:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/builtin/env_set.rb:19:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/builtin/provision.rb:45:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/clear_forwarded_ports.rb:13:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/set_name.rb:35:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/clean_machine_folder.rb:17:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide
rs/virtualbox/action/check_accessible.rb:18:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in block in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/uti l/busy.rb:19:inbusy'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builtin/call.rb:51:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/runner.rb:61:inblock in run'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/uti
l/busy.rb:19:in busy' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/runner.rb:61:inrun'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/builtin/call.rb:51:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/warden.rb:34:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in block in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/uti l/busy.rb:19:inbusy'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builtin/call.rb:51:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builtin/config_validate.rb:25:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide rs/virtualbox/action/check_virtualbox.rb:17:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builtin/call.rb:57:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builtin/config_validate.rb:25:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/provide rs/virtualbox/action/check_virtualbox.rb:17:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/warden.rb:34:in call' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act ion/builder.rb:109:incall'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in block in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/uti l/busy.rb:19:inbusy'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/act
ion/runner.rb:61:in run' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/mac hine.rb:129:inaction'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/command
s/up/command.rb:37:in block in execute' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plu gin/v2/command.rb:182:inblock in with_target_vms'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plu
gin/v2/command.rb:180:in each' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plu gin/v2/command.rb:180:inwith_target_vms'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/command
s/up/command.rb:32:in execute' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/cli .rb:46:inexecute'
from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/env
ironment.rb:408:in cli' from D:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.5/bin/vagrant:75: in<top (required)>'
from D:/vagrant/vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23
:in load' from D:/vagrant/vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23 :in

'

Synced Folder is Read-Only

For some reason using vagrant-windows 1.0.0 and vagrant 1.1.4, the synced folder is Read-only where I can only create folders. However if I use the absolute path at \vboxsrv\vagrant-root\vagrant, I can write new files.

Is this expected behavior or am I missing something in the setup?

Problems provisioning Win2k8 Domain Controller

I have two base boxes. One base box has a default installation of Windows 2k8, with a local 'vagrant' account. I can use vagrant-windows to up, halt, and destroy this box fine.

Another has an installation of Windows 2k8 where it has been promoted to be a domain controller. Consequently, I can not add local accounts to this installation. I created a new account on the domain called 'vagrant' and added that user to the Administrators group, so this user can log in locally. However, I can not run vagrant up successfully using this account's credentials (which are the default credentials: vagrant/vagrant).

Is using vagrant-windows with a domain controller possible?

Shell provisioner for windows does not work

When I try to use a script.ps1 to do shell provisioner this does not work and vagrant send this as output:

< CLIXML

The token '&&' is not a valid statement separator in this version.x000D__x000AAt line:34 char:31_x000D__x000A_+ chmod +x /tmp/vagrant-shell && <<<< /tmp/vagrant-shell_x000D__x000A_ + CategoryInfo : ParserError: (&&:String) [], ParentContainsError x000D__x000A RecordException_x000D__x000A_ + FullyQualifiedErrorId : InvalidEndOfLine_x000D__x000A_ x000D__x000A

When using chef solo provisioning, chef-client doesn't run as administrator unless UAC is disabled on the guest

I've been playing around with the latest vagrant-windows code. A recent change pulled in by this pull request seems to have broken some of our provisioning recipes. The user that submitted the request describes what he did on this opscode ticket and on this stackexchange post. In the opscode ticket comments, he mentions that UAC needs to be off, and my testing seems to confirm that this is the case. The chef-client is now being executed by running the ps_runas.ps1 script. If UAC is enabled, then it seems that chef-client does not run as an administrator. Most provisioning recipes need administrator access, so now they will not work unless UAC is off. Requiring that UAC be disabled doesn't really seem ideal since it will be enabled in production environments and vagrant is often used to create test environments that mirror production. Rather than changing vagrant-windows to work around issues with the SQL Server installer not working via WinRM, I think the task-scheduler trick should have been used in the SQL Server recipe as was suggested by Adam Edwards in the comments on the above chef issue. We actually have used this trick ourselves to work around auth issues we were running into when installing the .NET 4.0 framework. We didn't run chef client using a scheduled task (as suggested by Adam Edwards), but instead we had our recipe run the installer by scheduling a task and then running the task immediately. I believe the same trick would work around his SQL Server problem without the need for the ps_runas script in vagrant-windows.

undefined method `read_mac_addresses' on vagrant up

[default] Waiting for VM to boot. This can take a few minutes.
WIN-FNO6SSRUL91
[default] VM booted and ready for use!
[default] Configuring and enabling network interfaces...
[default] Forcing shutdown of VM...
[Berkshelf] cleaning Vagrant's shelf
[default] Destroying VM and associated drives...
/Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-windows-0.1.1/lib/vagrant-windows/guest/windows.rb:64:in `configure_networks': undefined method `read_mac_addresses' for #<Vagrant::Driver::VirtualBox_4_2:0x007f95076f54e8> (NoMethodError)
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/network.rb:72:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/clear_network_interfaces.rb:26:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/host_name.rb:10:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/share_folders.rb:20:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/clear_shared_folders.rb:13:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/nfs.rb:41:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/prune_nfs_exports.rb:15:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/provision.rb:27:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:84:in `block in finalize_action'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:84:in `block in finalize_action'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/forward_ports.rb:24:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_port_collisions.rb:42:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/env/set.rb:16:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/clear_forwarded_ports.rb:13:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/clean_machine_folder.rb:17:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/berkshelf-1.0.2/lib/berkshelf/vagrant/action/validate.rb:25:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/match_mac_address.rb:16:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/default_name.rb:17:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_guest_additions.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/import.rb:31:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_box.rb:28:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/vm/check_accessible.rb:18:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/general/validate.rb:13:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/general/check_virtualbox.rb:23:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/warden.rb:33:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/builder.rb:92:in `call'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/runner.rb:49:in `block in run'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/action/runner.rb:49:in `run'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/vm.rb:192:in `run_action'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/vm.rb:145:in `up'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/up.rb:31:in `block in execute'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:116:in `block in with_target_vms'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:111:in `each'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/base.rb:111:in `with_target_vms'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/command/up.rb:24:in `execute'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/cli.rb:42:in `execute'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/lib/vagrant/environment.rb:167:in `cli'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/lib/ruby/gems/1.9.1/gems/vagrant-1.0.5/bin/vagrant:43:in `<top (required)>'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/bin/vagrant:23:in `load'
    from /Users/Adam/.rbenv/versions/1.9.3-p286/bin/vagrant:23:in `<main>'

Chef Porovisioner fails on first attempt

I'm using vagrant-windows to manage a windows 7 guest that I'd like to provision with chef. However, every time I create a new VM using vagrant up, chef fails with the message that it can't find any cookbook. I have tried to debug the problem but just retrying vagrant provision makes it go away (interestingly vagrant up --no-provision and then vagrant provision works half of the time, but also fails half the time). Any ideas?

chef logging not 'real time' anymore

When using chef-solo provisioner, we get the log only after chef-solo ran, instead of during the run.

That makes the logging much less useful: is there an easy way to fix this ? I am using the vagrant-1.2 branch on top of vagrant 1.2.4 (issue seen on both osx and linux hosts).

chef-solo displays error "The system cannot find the path specified" on first provision

INFO interface: info: Running chef-solo...
Running chef-solo...
DEBUG winrmcommunicator: powershell executing:
function which {
$command = [Array](Get-Command $args[0] -errorAction SilentlyContinue)
if($null -eq $command)
{
exit 1
}
write-host $command[0].Definition
exit 0
}

function test ([Switch] $d, [String] $path) {
if(Test-Path $path)
{
exit 0
}
exit 1
}

function chown {
exit 0
}

function mkdir ([Switch] $p, [String] $path)
{
if(Test-Path $path)
{
exit 0
} else {
New-Item $path -Type Directory -Force | Out-Null
}
}

      $old = Get-ExecutionPolicy;
      Set-ExecutionPolicy Unrestricted -force;
      c:\tmp\vagrant-chef-1\cheftask.ps1;
      Set-ExecutionPolicy $old -force

INFO interface: info: ERROR:
ERROR:
INFO interface: info: The system cannot find the path specified.
The system cannot find the path specified.

vagrant 1.2 logging busted

I believe logging in vagrant-windows 1.2 branch is broken, I've set VAGRANT_LOG to INFO, WARN & ERROR and I only see messages from vagrant, I cannot find anything by vagrant-windows plugin.

Apparent host renaming issues in Win2k8R2 / distro-specificity

I'm not sure how many people run into this issue, but I can't seem to get a Windows 2008R2 guest to take a rename. I need to be able to rename VMs in order to run the Chef client on them.

Has anyone already gotten system renaming to work? Does the code in Vagrant::Guest::Windows.change_host_name() already work for anybody? I'm happy to send a pull request if not.

I using the netdom command to do the host renaming and kicking off a reboot with the shutdown command. The reboot is, unfortunately, mandatory for the rename to fully take effect. These commands appear to date back only to around Win2k3, so those interested in running older versions might still be out of luck even with my changes.

I haven't even thought about making any of this work in Active Directory, BTW.

To accommodate further Windows-version-specific behavior, I've made a couple of ham-fisted attempts to determine what version of Windows is running based on a WMI call and feed that to Vagrant::Guest::Windows.distro_dispatch() ... honestly, I'm hoping that I can just get the basic info out there and someone who spends more time in Windows than I have for the last few years could carry the ball the rest of the way... I can offer this code in the same pull request or separately if you're interested.

Thanks!

Private Networking does not work with virtual box 4.2.12

Using the following vagrant file (vagrant 1.1.5, Virtualbox 4.2.12), windows will boot and work as long as the private network line is commented out. Otherwise, I receive a NoMethodError during configure_networks:

Vagrant.configure("2") do |config|
  config.vm.box = "vagrant-windows2008r2"
  config.vm.network :private_network, ip: "192.168.33.10"

   config.vm.provider :virtualbox do |vb|
     vb.gui = true
   end

   # Max time to wait for the guest to shutdown
  config.windows.halt_timeout = 15

  # Admin user name and password
  config.winrm.username = "vagrant"
  config.winrm.password = "vagrant"

  # Configure base box parameters
  config.vm.guest = :windows

  # Port forward WinRM and RDP
  config.vm.network :forwarded_port, guest: 3389, host: 3389
  config.vm.network :forwarded_port, guest: 5985, host: 5985
end
...
[default] Booting VM...
 INFO subprocess: Starting process: ["VBoxManage", "startvm", "b3480617-2908-4405-a02c-2263aada4165", "--type", "gui"]
 INFO interface: info: Waiting for VM to boot. This can take a few minutes.
[default] Waiting for VM to boot. This can take a few minutes.
 INFO machine: guest is windows, using WinRM for communication channel
 INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "b3480617-2908-4405-a02c-2263aada4165", "--machinereadable"]
 INFO interface: info: VM booted and ready for use!
[default] VM booted and ready for use!
 INFO warden: Calling action: #<VagrantPlugins::ProviderVirtualBox::Action::CheckGuestAdditions:0x00000100e97860>
 INFO subprocess: Starting process: ["VBoxManage", "guestproperty", "get", "b3480617-2908-4405-a02c-2263aada4165", "/VirtualBox/GuestAdd/Version"]
 INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "b3480617-2908-4405-a02c-2263aada4165", "--machinereadable"]
 INFO interface: info: Configuring and enabling network interfaces...
[default] Configuring and enabling network interfaces...
 INFO machine: Loading guest: windows
 INFO windows: distro_dispatch: windows
 WARN machine: Distro dispatch loop in 'windows'. Exiting loop.
 INFO windows: configure_networks: [{:type=>:static, :adapter_ip=>"192.168.33.1", :ip=>"192.168.33.10", :netmask=>"255.255.255.0", :auto_config=>true, :interface=>1}]
 INFO subprocess: Starting process: ["VBoxManage", "showvminfo", "b3480617-2908-4405-a02c-2263aada4165", "--machinereadable"]
ERROR warden: Error occurred: undefined method `[]' for nil:NilClass
 INFO warden: Beginning recovery process...
...
/Users/jnorman/.vagrant.d/gems/gems/vagrant-windows-1.0.0/lib/vagrant-windows/guest/windows.rb:92:in `block in configure_networks': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/jnorman/.vagrant.d/gems/gems/vagrant-windows-1.0.0/lib/vagrant-windows/guest/windows.rb:91:in `each'
    from /Users/jnorman/.vagrant.d/gems/gems/vagrant-windows-1.0.0/lib/vagrant-windows/guest/windows.rb:91:in `configure_networks'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/network.rb:115:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/clear_network_interfaces.rb:26:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/share_folders.rb:20:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/clear_shared_folders.rb:12:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/prepare_nfs_settings.rb:11:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/nfs.rb:28:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/prune_nfs_exports.rb:15:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:106:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/env_set.rb:19:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/provision.rb:45:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:13:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/set_name.rb:35:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:51:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:51:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:51:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:57:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builder.rb:109:in `call'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/machine.rb:129:in `action'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/commands/up/command.rb:37:in `block in execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:182:in `block in with_target_vms'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:180:in `each'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:180:in `with_target_vms'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/commands/up/command.rb:32:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/cli.rb:46:in `execute'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/environment.rb:408:in `cli'
    from /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/bin/vagrant:75: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>'

Update Requirements for Windows Core Versions

Environment


  • OS: Mac OSX 10.8.4
  • Vagrant 1.2.2
  • Virtual Box 4.2.12
  • Ruby 2.0.0p195
  • Target Windows Version: Windows Core Server 2012 Standard
  • Processor : Intel Core i7 - 64 bit

Details


Hi,

I think Windows Core 2008/2012 Servers do not need to configure the Shutdown Event Tracker or the Server Manager at Login. The registry entries for these configurations do not exist.

http://www.computerperformance.co.uk/windows_server/server-2012-shutdown-event-tracker.htm

Unknown error without translation: en.vagrant.errors.winrm_bad_exit_status

Beyond adding a translation, I'm still unsure what this error is.

[windows7] Running provisioner: Vagrant::Provisioners::ChefSolo...
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Resolve-Path : Cannot find path
 'C:\tmp\vagrant-chef-1\chef-solo-1\cookbooks' b_x000D__x000A_</S><S S="Error">ecause it does not exist._x000D__x000A_</S><S
 S="Error">At line:7 char:15_x000D__x000A_</S><S S="Error">+   Resolve-Path &lt;&lt;&lt;&lt;  $path| Out-Null;_x000D__x000A_
</S><S S="Error">    + CategoryInfo          : ObjectNotFound: (C:\tmp\vagrant-...olo-1\cookboo _x000D__x000A_</S><S S="Erro
r">   ks:String) [Resolve-Path], ItemNotFoundException_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : PathNotFo
und,Microsoft.PowerShell.Commands.Resol _x000D__x000A_</S><S S="Error">   vePathCommand_x000D__x000A_</S><S S="Error"> _x000
D__x000A_</S></Objs>                                                                                                       
C:\opscode\chef\bin\chef-solo.bat
[windows7] Generating chef JSON and uploading...
#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">Exception calling "WriteAllByte
s" with "2" argument(s): "Could not find a part _x000D__x000A_</S><S S="Error">of the path 'C:\tmp\vagrant-chef-1\dna.json'.
"_x000D__x000A_</S><S S="Error">At line:28 char:42_x000D__x000A_</S><S S="Error">+           [System.IO.File]::WriteAllBytes
 &lt;&lt;&lt;&lt; ($new_file,$bytes)_x000D__x000A_</S><S S="Error">    + CategoryInfo          : NotSpecified: (:) [], Metho
dInvocationException_x000D__x000A_</S><S S="Error">    + FullyQualifiedErrorId : DotNetMethodException_x000D__x000A_</S><S S
="Error"> _x000D__x000A_</S></Objs>                                                                                        
translation missing: en.vagrant.errors.winrm_bad_exit_status

[vagrant1.2 branch] Issue running Vagrant Up

It starts up the VM successfully but it shutdown on an initialize ruby class windows.rb. I guess may be i am missing a configuration value on the Vagrant file?

Environment


  • OS: Mac OSX 10.8.4
  • Vagrant 1.2.2
  • Virtual Box 4.2.12
  • Ruby 2.0.0p195
  • Target Windows Version: Windows Core Server 2012 Standard
  • Processor : Intel Core i7 - 64 bit

Details


  • $ vagrant up
  • Bringing machine 'default' up with 'virtualbox' provider...
  • [default] Importing base box 'vagrant-windows2012'...
  • [default] Matching MAC address for NAT networking...
  • [default] Setting the name of the VM...
  • [default] Clearing any previously set forwarded ports...
  • [default] Creating shared folders metadata...
  • [default] Clearing any previously set network interfaces...
  • [default] Preparing network interfaces based on configuration...
  • [default] Forwarding ports...
  • [default] -- 22 => 2222 (adapter 1)
  • [default] -- 5985 => 5985 (adapter 1)
  • [default] -- 3389 => 3389 (adapter 1)
  • [default] Running any VM customizations...
  • [default] Booting VM...
  • [default] Waiting for VM to boot. This can take a few minutes.
  • [default] VM booted and ready for use!
  • [default] Configuring and enabling network interfaces...
  • [default] Forcing shutdown of VM...
  • [default] Destroying VM and associated drives...
  • /Users/lmo0/.vagrant.d/gems/gems/vagrant-windows-1.0.3/lib/vagrant-windows/guest/-windows.rb:10:in initialize': wrong number of arguments (0 for 1) (ArgumentError)

Windows Vagrant 1.1.4 and Vagrant-Windows 0.2.0 Not Working

Hi,

I've got vagrant/vagrant windows working on one of my machines but running an old version of vagrant (0.7.0) so I'm trying to update everything so I can use 1.1+ but I'm having difficulties getting it going.

Here's what I've done:

  • installed Vagrant 1.1.4 (also tried 1.1.5)
  • Downloaded latest branch and followed rake build instructions to build vagrant-windows 0.2.0.gem
  • Ran vagrant plugin install pkg\vagrant-windows-0.2.0.gem which succeeded

When I run vagrant -v I receive:

PS C:\vagrant\Win2008> vagrant -v
INFO global: Vagrant version: 1.1.4
INFO manager: Registered plugin: box command
INFO manager: Registered plugin: destroy command
INFO manager: Registered plugin: halt command
INFO manager: Registered plugin: init command
INFO manager: Registered plugin: package command
INFO manager: Registered plugin: plugin command
INFO manager: Registered plugin: provision command
INFO manager: Registered plugin: reload command
INFO manager: Registered plugin: resume command
INFO manager: Registered plugin: ssh command
INFO manager: Registered plugin: ssh-config command
INFO manager: Registered plugin: status command
INFO manager: Registered plugin: suspend command
INFO manager: Registered plugin: up command
INFO manager: Registered plugin: ssh communicator
INFO manager: Registered plugin: Arch guest
INFO manager: Registered plugin: Debian guest
INFO manager: Registered plugin: Fedora guest
INFO manager: Registered plugin: FreeBSD guest
INFO manager: Registered plugin: Gentoo guest
INFO manager: Registered plugin: Linux guest.
INFO manager: Registered plugin: OpenBSD guest
INFO manager: Registered plugin: PLD Linux guest
INFO manager: Registered plugin: RedHat guest
INFO manager: Registered plugin: Solaris guest.
INFO manager: Registered plugin: SUSE guest
INFO manager: Registered plugin: Ubuntu guest
INFO manager: Registered plugin: Arch host
INFO manager: Registered plugin: BSD host
INFO manager: Registered plugin: Fedora host
INFO manager: Registered plugin: FreeBSD host
INFO manager: Registered plugin: Gentoo host
INFO manager: Registered plugin: Linux host
INFO manager: Registered plugin: OpenSUSE host
INFO manager: Registered plugin: Windows host
INFO manager: Registered plugin: kernel
INFO manager: Registered plugin: kernel
INFO manager: Registered plugin: VirtualBox provider
INFO manager: Registered plugin: chef
INFO manager: Registered plugin: puppet
INFO manager: Registered plugin: shell
INFO vagrant: vagrant invoked: ["-v"]
INFO environment: Environment initialized (#Vagrant::Environment:0x2b005c0)
INFO environment: - cwd: C:/vagrant/Win2008
INFO environment: Home path: C:/Users/gibbonsd/.vagrant.d
INFO environment: Local data path: C:/vagrant/Win2008/.vagrant
INFO environment: Loading plugin from JSON: vagrant-windows
ERROR root: Failed to load plugin: vagrant-windows
ERROR root: -- Error: #<LoadError: cannot load such file -- vagrant-windows>
ERROR root: -- Backtrace:
ERROR root: C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' C:/vagrant/vagrant/embedded/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant.rb:186:in require_plugin' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:647:inblock in load_plugins'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:644:in each' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:644:inload_plugins'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/lib/vagrant/environment.rb:128:in initialize' C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:53:innew'
C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/bin/vagrant:53:in <top (required)>' C:/vagrant/vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23:inload'
C:/vagrant/vagrant/bin//../embedded/../embedded/gems/bin/vagrant:23:in <main>' INFO interface: error: The plugin "vagrant-windows" could not be found. Please make sure that it is properly installed viavagrant plugin. Note that plugins made for Vagrant 1.0.x are not compatible with 1.1+ and this error will likely continue to show when you useplugin install` with a 1.0.x plugin.

The plugin "vagrant-windows" could not be found. Please make sure that it is
properly installed via vagrant plugin. Note that plugins made for
Vagrant 1.0.x are not compatible with 1.1+ and this error will likely
continue to show when you use plugin install with a 1.0.x plugin.
INFO environment: Running hook: environment_load
INFO environment: Initializing config...
INFO loader: Set :default = "C:/vagrant/vagrant/embedded/gems/gems/vagrant-1.1.4/config/default.rb"
INFO loader: Set :root = #Pathname:C:/vagrant/Win2008/Vagrantfile
INFO loader: Loading configuration in order: [:default, :home, :root]
INFO hosts: Host class: VagrantPlugins::HostWindows::Host
INFO runner: Running action: #Vagrant::Action::Builder:0x1f9d268
INFO cli: CLI: ["-v"] nil []
INFO interface: info: Vagrant version 1.1.4
Vagrant version 1.1.4
INFO environment: Running hook: environment_unload
INFO runner: Running action: #Vagrant::Action::Builder:0x3177db0

I'd really like to get this going and it looks close but I'm stuck now. Any ideas?

Thanks

Dan

Server 2003 Does Not Work With Chef

Because symbolic links are not available in server 2003, more specifically mklink, chef-solo does not work as the c:\tmp\vagrant-chef-1* links do not create correctly. Need the option to be able to change location of chef-solo files.

[vagrant-1.2 branch] Puppet provisioning error?

I'm using puppet with vagrant-windows on the 1.2 branch, and it seems like it wants to error with the following:

[default] Mounting shared folders...
[default] -- /vagrant
[default] -- /tmp/vagrant-puppet/manifests
[default] Running provisioner: puppet...
The remote command returned a bad exit status of 1.

Shell: powershell
Command: chmod 0777 /tmp/vagrant-puppet

My current work around is to fire puppet via shell provider.

The specified guest type is unknown: windows.

Hello,

I'm trying to get vagrant-windows working on ubuntu 12.10 and running into this error:

$ vagrant up
The specified guest type is unknown: windows. Please change this
to a proper value.

Any idea where I've gone wrong? See my setup below.

Thanks,
Collin

sudo aptitude update
sudo aptitude install linux-headers-$(uname -r)
sudo aptitude install virtualbox
sudo aptitude install rubygems ruby-dev libxml2-dev libxslt-dev
gem install -r vagrant-windows -v 0.1.2
vagrant box add win2k8r2 http://dl.dropbox.com/u/58604/vagrant/win2k8r2-core.box
vagrant init win2k8r2
vagrant up

Vagrant Puppet provisioner errors out with "The token '||' is not a valid statement separator in this version"

Hi,

I am trying to run the puppet_server provisioner for a Windows Server 2008 R2 box. My set up is the following:
Vagrant 1.1.5
vagrant-windows 1.0.3

The vagrant file looks as follows:

config.vm.define :webnode do |webnode|
webnode.vm.box = "Win2008R2"
webnode.vm.guest = :windows
webnode.vm.network :private_network, ip: "168.192.73.4", :netmask => "255.255.255.0"
webnode.windows.halt_timeout = 15
webnode.winrm.username = "vagrant"
webnode.winrm.password = "vagrant"
webnode.winrm.max_tries = 20
webnode.vm.network :forwarded_port, guest: 3389, host: 3389
webnode.vm.network :forwarded_port, guest: 80, host: 8080
webnode.vm.network :forwarded_port, guest: 5985, host: 5985
webnode.vm.network :forwarded_port, guest: 1433, host: 1433

webnode.vm.provider "virtualbox" do |v| 
    v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
    v.gui = true
end

webnode.vm.provision :puppet_server do |agent|
    agent.puppet_server = "puppet"
    agent.options = "--environment dev"
    agent.facter = {
        "custom_role" => "websrv"
    }       
end

end

When it reaches the part for running the provisioner it bombs out. Full error message:
...
Running Puppet agent...

< CLIXML

The token '||' is not a valid statement separator in this version._ x000D__x000A_At line:34 char:83_x000D__x000A_+ puppet agent --certname Win2008R2SQL2008R2 --server puppet --detailed-exitcod_x 000D__x000A_es || <<<< [ $? -eq 2 ]_x000D__x000A_< /S> + CategoryInfo : ParserError: (||:String) [], Paren tContainsError _x000D__x000A_ RecordException_x000D__x000A_ + FullyQualifiedErrorId : InvalidEndOfLine_x000D__x000A_< S S="Error"> _x000D__x000A_

synced_folder does not work with Windows

Using Vagrant 1.1.5 and vagrant-windows 1.0.0.

I'm getting the following error from Vagrant:

ERROR vagrant: /Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/config_validate.rb:18:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builtin/call.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/builder.rb:109:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/action/runner.rb:61:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/machine.rb:129:in `action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/commands/destroy/command.rb:23:in `block in execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:182:in `block in with_target_vms'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:180:in `each'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/plugin/v2/command.rb:180:in `with_target_vms'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/plugins/commands/destroy/command.rb:22:in `execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/cli.rb:46:in `execute'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/lib/vagrant/environment.rb:408:in `cli'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.1.5/bin/vagrant:75:in `<top (required)>'
/Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `load'
/Applications/Vagrant/bin/../embedded/gems/bin/vagrant:23:in `<main>'
 INFO interface: error: There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The shared folder guest path must be absolute: C:/mounted-packages

The relevant part of my Vagrantfile is:

artifacts_dir = "C:/mounted-packages"
config.vm.synced_folder build_output_dir, artifacts_dir

Is it possible this was fixed in a newer version of Vagrant, but is unreachable because of the backwards incompatibility with vagrant-windows 1.0.0? Or am I just doing something wrong here?

Forcing private network mode to give a default gateway ?

One issue that comes up with private network is that since there is no default gateway, windows 7 decides to set that network into 'work network' mode, which means you can't access the VM at this ip from the host, making it rather useless.

One (the only ?) way to fix this is to set up a dummy gateway manually through the UI, and then everything works fine. Is there a way we can automate this ? I have not found a way to set up the gateway with netsh, unfortunately.

Support VMware Fusion Provider

I figured out how to get the vagrant-windows 1.2 branch packaged up and running with the VMware Fusion driver with the help of @mitchellh.

  1. git clone [email protected]:WinRb/vagrant-windows.git
  2. cd vagrant-windows
  3. git checkout 1.2
  4. bundle install
  5. gem build vagrant-windows.gemspec
  6. vagrant plugin install vagrant-windows-1.2.0.gem

So now, with the vagrant-vmware-fusion (0.8.2) & vagrant-windows (1.2.0) plugins enabled, I tried to vagrant up --provider=vmware_fusion:

$ vagrant up --provider=vmware_fusion 
Bringing machine 'vagrant-windows' up with 'vmware_fusion' provider...
[vagrant-windows] Cloning VMware VM: 'windows2008r2'. This can take some time...
[vagrant-windows] Verifying vmnet devices are healthy...
[vagrant-windows] Preparing network adapters...
[vagrant-windows] Starting the VMware VM...
[vagrant-windows] Waiting for the VM to finish booting...
An error occurred executing a remote WinRM command.

Shell: powershell
Command: function which {
    $command = [Array](Get-Command $args[0] -errorAction SilentlyContinue)
    if($null -eq $command)
    {
      exit 1
    }
    write-host $command[0].Definition
    exit 0
}

function test ([Switch] $d, [String] $path) {
  if(Test-Path $path)
  {
    exit 0
  }
  exit 1
}

function chown {
  exit 0
}

function mkdir ([Switch] $p, [String] $path)
{
  if(Test-Path $path)
  {
    exit 0
  } else {
    New-Item $path -Type Directory -Force | Out-Null
  }
}


hostname
Message: undefined method `read_forwarded_ports' for #<HashiCorp::VagrantVMwarefusion::Driver::Fusion:0x000001040edee0>

My Vagrantfile is:

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.define "vagrant-windows"
  config.vm.box = "windows2008r2"

  # Admin user name and password
  config.winrm.username = "vagrant"
  config.winrm.password = "vagrant"

  config.vm.guest = :windows  
  config.windows.halt_timeout = 15

  # Port forward WinRM and RDP
  config.vm.network :forwarded_port, guest: 3389, host: 3389
  config.vm.network :forwarded_port, guest: 5985, host: 5985

  config.vm.provider :virtualbox do |v, override|
  end

  config.vm.provider :vmware_fusion do |v, override|
    v.gui = true
    v.vmx["ethernet0.virtualDev"] = "vmxnet3"
  end

  config.vm.provider :vmware_workstation do |v, override|
    v.vmx["ethernet0.virtualDev"] = "vmxnet3"
    v.gui = true
  end
end

Any ideas?

Chef-Solo + remote_file + Bad HTTP response returned from server (500)

First all, thanks for this plugin. I'm really liking it.

I am having an issue, which I'm not sure is caused by this plugin, but at the very least its intertwined. I've got everything working so that I can vagrant up a windows box and it comes online and fires the chef-solo provisioner

While running through a series of cookbooks via the chef-solo provisioner it always bombs on a remote file download with a 500 response from winrm. After bombing the vm is immediately destroyed. I believe the automatic destruction is a separate issue than 500 on remote file.

I'll start with the automatic destruction as I think I have this narrowed down a little.
In https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/action/vm/import.rb#L41 there is a check that the error class is Errors::VagrantError. Any other class results in a vm destruction.

In the case of this error the error class is WinRM::WinRMHTTPTransportError. As a result the VM gets trashed every time I hit the 500 response. I've been able to work around this for now by updated type checking in that block of code. I only mention it as it might make sense to incorporate the fix.

The larger issue I have, which I'm at a lose for is why do I get the 500 response code on the remote file? It feels like a timeout issue while the file is downloading (its a couple hundred megs), but I've adjusted the timeout value of @{MaxTimeoutms="1800000"} as outlined in the documentation. I've turned on debug logging for vagrant, but I don't see much of value.

So I'm hoping someone has some insight into what might be causing this, and what additional things I look at.

Snippet of output around the failure:
?[36mwinrm?[0m [Mon, 11 Jun 2012 05:46:49 -0700] INFO: Processing remote_file[/tmp/vagrant-chef-1/MyZipFile.zip] action create (dynamically defined)
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
INFO warden: Calling recover: #Vagrant::Action::VM::Import:0x3a2b9b8
INFO subprocess: Starting process: ["C:\Program Files\Oracle\VirtualBox\VBoxManage.exe", "showvminfo", "dcdaa6f6-3bfe-4a4d-8dec-d636a15342a0", "--machinereadable"]
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
ERROR warden: Error occurred: Bad HTTP response returned from server (500).
C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/http/transport.rb:48:in send_request': Bad HTTP response returned from server (500). (WinRM::WinRMH TTPTransportError) from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:368:insend_message'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:155:in get_command_output' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:inget_command_output'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:in get_command_output' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:inget_command_output'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:in get_command_output' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:inget_command_output'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:174:in get_command_output' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/winrm-1.1.2/lib/winrm/winrm_service.rb:267:inrun_powershell_script'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-windows-0.0.3/lib/vagrant-windows/communication/winrm.rb:164:in shell_execute' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-windows-0.0.3/lib/vagrant-windows/communication/winrm.rb:72:inblock in execute'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/util/retryable.rb:14:in retryable' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-windows-0.0.3/lib/vagrant-windows/communication/winrm.rb:70:inexecute'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-windows-0.0.3/lib/vagrant-windows/communication/winrm.rb:51:in sudo' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:203:inblock in run_chef_solo'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:in times' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:189:inrun_chef_solo'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/provisioners/chef_solo.rb:96:in provision!' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:34:inblock in call'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:in each' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/provision.rb:31:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/forward_ports.rb:24:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_port_collisions.rb:42:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/env/set.rb:16:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/clear_forwarded_ports.rb:13:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/clean_machine_folder.rb:17:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/match_mac_address.rb:16:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/default_name.rb:17:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_guest_additions.rb:33:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/import.rb:31:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_box.rb:28:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/vm/check_accessible.rb:18:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/validate.rb:13:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/general/check_virtualbox.rb:23:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/warden.rb:33:in call' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/builder.rb:92:incall'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in block in run' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/util/busy.rb:19:inbusy'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/action/runner.rb:49:in run' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/vm.rb:192:inrun_action'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/vm.rb:145:in up' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:31:inblock in execute'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:116:in block in with_target_vms' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:ineach'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/base.rb:111:in with_target_vms' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/command/up.rb:24:inexecute'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/cli.rb:42:in execute' from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/lib/vagrant/environment.rb:167:incli'
from C:/vagrant/vagrant/embedded/lib/ruby/gems/1.9.1/gems/vagrant-1.0.3/bin/vagrant:43:in <top (required)>' from C:/vagrant/vagrant/bin//../embedded/bin/vagrant:19:inload'
from C:/vagrant/vagrant/bin//../embedded/bin/vagrant:19:in `

'

An error occurred executing a remote WinRM command

Hi.

I'm having problems getting a Windows 2008R2 server running on a Windows 7 host. I have set up my own server base box and enabled winrm. I've stopped the firewall as well to make sure that that's not causing the problem.

I used the basic Vagrantfile from the readme but when I run vagrant up, I get an error saying that "An error occurred executing a remote WinRM command". Then it shows the powershell command.

The server comes up okay, I can see it after setting the gui to be on and the command runs fine from the command line so winrm is working.

I've tried this with vagrant 1.1 and 1.2 and vagrant-windows 1.0.1, 1.0.2, 1.1.0

solo.rb file_cache_path is not a Windows friendly path

The path specified in the solo.rb generated by vagrant is not Windows friendly and causes problems for some applications.

Actual path: /tmp/vagrant-chef-1
Expected path: c:\tmp\vagrant-chef-1

More specifically this causes problems with the community SQL Server cookbook. This cookbook generates a configuration file in the chef file cache which it passes off to setup.exe. The path it generates is missing the drive letter (as in the example above) and fails the setup.

config_file_path = win_friendly_path(File.join(Chef::Config[:file_cache_path], "ConfigurationFile.ini"))

Note: None of the other paths in the solo.rb file are Windows friendly either, however they're not causing any specific issues at the moment that I have encountered.

SQL Server cookbook fails to install through Vagrant

I've created this issue in order to fix COOK-1172.

There are essentially two issues with installing SQL Server through vagrant-windows, or more specifically through WinRM:

  1. The guest VM group policy needs to be relaxed around WinRM console limits on memory. This can easily be addressed via a group policy change on the VM.
  2. The chef-solo process needs to run under the context of an administrative user that can delegate credentials.

The latter needs to be patched in vagrant-windows. My current thinking is to wrap the chef-solo command in a PowerShell script that spawns chef-solo via System.Diagnostics.Process providing the vagrant credentials.

function ps-runas ([String] $cmd, [String] $arguments)
{
  $secpasswd = ConvertTo-SecureString "vagrant" -AsPlainText -Force

  $process = New-Object System.Diagnostics.Process
  $setup = $process.StartInfo
  $setup.FileName = $cmd
  $setup.Arguments = $arguments
  $setup.UserName = "vagrant"
  $setup.Password = $secpasswd
  $setup.Verb = "runas"
  $setup.UseShellExecute = $false
  $setup.RedirectStandardError = $true
  $setup.RedirectStandardOutput = $true
  $setup.RedirectStandardInput = $false

  # Hook into the standard output and error stream events
  $errEvent = Register-ObjectEvent -InputObj $process `
    -Event "ErrorDataReceived" `
    -Action `
    {
        param
        (
            [System.Object] $sender,
            [System.Diagnostics.DataReceivedEventArgs] $e
        )
        Write-Host $e.Data
    }
  $outEvent = Register-ObjectEvent -InputObj $process `
    -Event "OutputDataReceived" `
    -Action `
    {
        param
        (
            [System.Object] $sender,
            [System.Diagnostics.DataReceivedEventArgs] $e
        )
        Write-Host $e.Data
    }

  Write-Host "ps-runas starting: $cmd"

  if (!$process.Start())
  {
    Write-Error "Failed to start $cmd"
  }

  $process.BeginOutputReadLine()
  $process.BeginErrorReadLine()

  # Wait until process exit
  $process.WaitForExit()

  $process.CancelOutputRead()
  $process.CancelErrorRead()
  $process.Close()
}

I still need to figure out how to pass the appropriate credentials instead of hardcoding them and I also need to figure out if I should spawn yet another PowerShell process to invoke chef-solo, because the command given from Vagrant isn't really Windows or System.Diagnostics.Process friendly (e.g. chef-solo -c /tmp/vagrant-chef-1/solo.rb -j /tmp/vagrant-chef-1/dna.json).

I also wonder does it make sense to wrap every command in this ps-runas wrapper or only the chef-solo command?

[vagrant1.2 branch] Issue running puppet provisioning

Environment


  • OS: Mac OSX 10.8.4
  • Vagrant 1.2.2
  • Virtual Box 4.2.12
  • Ruby 2.0.0p195
  • Target Windows Version: Windows Core Server 2012 Standard
  • Processor : Intel Core i7 - 64 bit

Details


It seems that puppet client cannot be found from vagrant.

$ bundle exec vagrant up 

[default] Running provisioner: VagrantPlugins::Puppet::Provisioner::Puppet...
The `puppet` binary appears to not be in the PATH of the guest. This
could be because the PATH is not properly setup or perhaps Puppet is not
installed on this guest. Puppet provisioning can not continue without
Puppet properly installed.

screen shot 2013-06-19 at 7 57 59 pm

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.