Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinRM causes 'vagrant up' to fail with Vagrant 1.8.4/Win 2008 R2 guest #7489

Closed
deancsmith opened this issue Jun 19, 2016 · 46 comments
Closed

Comments

@deancsmith
Copy link

Vagrant version

1.8.4

Host operating system

OS X 10.11.4

Guest operating system

Windows Server 2008 R2

Vagrantfile

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

VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

    config.vm.box = "windows-2008r2-sql2012SP1Ent-iis75-php54-redis_v16"
    config.vm.guest = :windows

    config.vm.define "workflow-dev"

    config.vm.hostname = "workflow"

    config.vm.provider :virtualbox do |vb|
        vb.name = "workflow-dev"
    end

    config.vm.communicator = "winrm"

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

    config.winrm.username = "vagrant"
    config.winrm.password = "<password>"

    # Port forward WinRM and RDP, LDAP (non-SSL)
    config.vm.network :forwarded_port, guest: 3389, host: 3389
    config.vm.network :forwarded_port, guest: 5986, host: 5986
    config.vm.network :forwarded_port, guest: 5985, host: 5985
    config.vm.network :forwarded_port, guest: 389, host: 1389
    config.vm.network :forwarded_port, guest: 22, host: 2223

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

    config.vm.provider :virtualbox do |v|
        v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
        v.customize ["modifyvm", :id, "--memory", 2048]
        v.customize ["modifyvm", :id, "--cpus", 4]
        v.customize ["modifyvm", :id, "--name", "workflow-dev"]
        v.gui = false
    end

    if defined?(VagrantPlugins::HostsUpdater)
        # Pass the host names to the hostsupdater plugin
        config.hostsupdater.aliases = ["site.dev"]
        # Remove the hosts changes on suspend
        config.hostsupdater.remove_on_suspend = false
    end

    config.ssh.private_key_path = "id_rsa"
    config.ssh.port = 2223

    config.vm.synced_folder ".", "/cygdrive/c/inetpub/wwwroot/", type: "rsync", rsync__exclude: [
        "composer.lock",
        ".git/",
        "vendor/*",
    ]

    # Configure the window for gatling to coalesce writes.
    if Vagrant.has_plugin?("vagrant-gatling-rsync")
        config.gatling.latency = 1.5
        config.gatling.time_format = "%H:%M:%S"
    end

    # Trigger rsyncing of files after an up/resume/reload
    if Vagrant.has_plugin?("vagrant-triggers")
        config.trigger.after [:up, :resume, :reload] do
            run "vagrant gatling-rsync-auto"
        end
    end

    config.berkshelf.berksfile_path = "Berksfile"
    config.berkshelf.enabled = true

  config.vm.provision "chef_solo" do |chef|

    chef.json = {
      <CHEF CONFIG>
    }

    chef.run_list = [
        "recipe[initial-setup::iis]",
        "recipe[initial-setup::sqlsrv]"
    ]
    end

    config.vm.provision "shell" do |s|
        s.path = "provision.bat"
    end

    config.vm.provision "shell", run: "always" do |s|
        s.path = "up.bat"
    end
end

Debug output

https://gist.github.com/deancsmith/13b5368f1a105d2af5b16c4b3f7217f9

Expected behavior

Vagrant should load the box, provision etc.

Everything is running fine in 1.8.1 (and 1.7.x etc. previously).

Actual behavior

Vagrant quits before running Berkshelf and Chef.

I think this is the key exception that is causing the vagrant up to rollback:

==> workflow-dev: Loading Berkshelf datafile...
==> workflow-dev: Sharing cookbooks with VM
==> workflow-dev: Forcing shutdown of VM...
==> workflow-dev: Destroying VM and associated drives...
==> workflow-dev: Vagrant's startup was interrupted by an exception.
/opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:64:in `raise_if_wsman_fault': [WSMAN ERROR CODE: 2150859173]: <f:WSManFault Code='2150859173' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault)
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:51:in `raise_if_error'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:35:in `parse_to_xml'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/transport.rb:200:in `send_request'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:492:in `send_message'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:153:in `open_shell'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:72:in `block in open'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:222:in `retryable'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:71:in `open'
    from /opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:359:in `create_executor'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/shell.rb:176:in `executor'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/shell.rb:59:in `powershell'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/communicator.rb:107:in `block in ready?'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
    from /opt/vagrant/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/communicators/winrm/communicator.rb:106:in `ready?'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:260:in `guest'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/synced_folders/rsync/helper.rb:43:in `rsync_single'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/synced_folders/rsync/synced_folder.rb:48:in `block in enable'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/synced_folders/rsync/synced_folder.rb:47:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/synced_folders/rsync/synced_folder.rb:47:in `enable'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/synced_folders.rb:93:in `block in call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/synced_folders.rb:90:in `each'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/synced_folders.rb:90:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/synced_folder_cleanup.rb:28:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/synced_folders/nfs/action_cleanup.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_nfs_valid_ids.rb:12:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/handle_forwarded_port_collisions.rb:49:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_forwarded_port_collision_params.rb:30:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/env_set.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-hostmanager-1.8.1/lib/vagrant-hostmanager/action/update_all.rb:24:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-omnibus-1.4.1/lib/vagrant-omnibus/action/install_chef.rb:38:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/provision.rb:80:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/upload.rb:23:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/install.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/save.rb:21:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/clear_forwarded_ports.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/set_name.rb:50:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/clean_machine_folder.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/box_check_outdated.rb:36:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/match_mac_address.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/discard_state.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/import.rb:74:in `import'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/import.rb:13:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/prepare_clone_snapshot.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/prepare_clone.rb:15:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/customize.rb:40:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_accessible.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/share.rb:28:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/load.rb:30:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/env_set.rb:19:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-berkshelf-4.1.0/lib/vagrant-berkshelf/action/check.rb:18:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/handle_box.rb:56:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builtin/call.rb:53:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/plugins/providers/virtualbox/action/check_virtualbox.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /Users/<username>/.vagrant.d/gems/gems/vagrant-triggers-0.5.3/lib/vagrant-triggers/action/trigger.rb:17:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/warden.rb:34:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/builder.rb:116:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `block in run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/util/busy.rb:19:in `busy'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/action/runner.rb:66:in `run'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:225:in `action_raw'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:200:in `block in action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/environment.rb:561:in `lock'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:186:in `call'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/machine.rb:186:in `action'
    from /opt/vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'
    from /opt/vagrant/embedded/gems/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `call'
    from /opt/vagrant/embedded/gems/gems/logging-2.1.0/lib/logging/diagnostic_context.rb:450:in `block in create_with_logging_context'

Steps to reproduce

  1. Run vagrant up.

References

I think this might be related to this but am not sure:

@deancsmith deancsmith changed the title WinRM fails causes 'vagrant up' to fail with Vagrant 1.8.4/Win 2008 R2 guest WinRM causes 'vagrant up' to fail with Vagrant 1.8.4/Win 2008 R2 guest Jun 19, 2016
@nickwright80
Copy link

The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user.

Your custom box (windows-2008r2-sql2012SP1Ent-iis75-php54-redis_v16) seems to have dropped the default value for MaxShellsPerUser from 30 to 5 – which seems a little low.

You can tweak this via winrm set winrm/config/winrs '@{MaxShellsPerUser="30"}'. I've seen vagrant rsync peak at 13 concurrent shells per invocation. Ansible seem to get by with just 2 or 3 on the same box.

If you can get to PowerShell during vagrant up, you can track concurrent shells at any point in time via @(Get-Process winrshost).Count.

That said, I think we may be running into the same problem (#7486) – likely during "Sharing cookbooks with VM" in your case.

@sethvargo
Copy link
Contributor

@deancsmith

Can you see if Nick's suggestion works for you please?

@JulianMay
Copy link

JulianMay commented Jun 20, 2016

FYI I'm having the same issue. The settings on base image before vagrant package looks like this:

   Winrs
       AllowRemoteShellAccess = true
       IdleTimeout = 180000
       MaxConcurrentUsers = 5
       MaxShellRunTime = 2147483647
       MaxProcessesPerShell = 15
       MaxMemoryPerShellMB = 512
       MaxShellsPerUser = 30

But vagrant up still fails with the "The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user." error...

Vagrant version

1.8.3

Host operating system

Windows 8.1 Pro

Guest operating system

Windows Server 2008 R2

@JulianMay
Copy link

Setting MaxConcurrentUsers to 30 as well made a difference!
Now, the problem is:
The WS-Management service cannot process the request. This user is allowed a maximum number of 15 concurrent operations, which has been exceeded. Close existing operations for this user, or raise the quota for this user.

@nickwright80
Copy link

nickwright80 commented Jun 20, 2016

@JulianMay: now you're bumping into a different limit, which also appears to have been tightened from the Windows default as shipped.

Try winrm set winrm/confit/winrs '@{MaxProcessesPerShell="25"}'

Something in your provisioning process is locking these resource limits down to levels that seem inappropriate for your use case.

@JulianMay
Copy link

JulianMay commented Jun 20, 2016

Yep, figured as much...
A lot of them though ( now at "MaxConcurrentOperationsPerUser" ), and I have to re-package the box after configuring each step (right?).

This is a fresh new installation of Windows 2008 r2, and I'm only using the shell-provisioner to echo "hello world", so i guess this is not a particular use case - Might even be worth updating the winrm-config guide at https://www.vagrantup.com/docs/boxes/base.html ?

I'll make a note of winrm configs needed to echo "hello world" via shell provisioner and share it here once I finally get it...

@JulianMay
Copy link

JulianMay commented Jun 20, 2016

Got it running (shell "hello world"), with these extra configs (Not sure if they are sane):

winrm set winrm/config/winrs @{MaxShellsPerUser="30"}
winrm set winrm/config/winrs @{MaxConcurrentUsers="30"}
winrm set winrm/config/winrs @{MaxProcessesPerShell="30"}
winrm set winrm/config/service @{MaxConcurrentOperationsPerUser="50"}

@nickwright80
Copy link

nickwright80 commented Jun 20, 2016

You can find (presumably sane?) defaults here:
https://msdn.microsoft.com/en-us/library/aa384372(v=vs.85).aspx

I would consider using the default MaxConcurrentOperationsPerUser = 1500.

It's not clear to me what is meant by "operation", but I assume it's somewhere on the spectrum between a thread and a (sub-)process.

@lmayorga1980
Copy link

👍

@deancsmith
Copy link
Author

deancsmith commented Jun 21, 2016

Hi All

My original settings are below. I do not believe I changed these when I initially created this box so I am not sure how the MaxConcurrentOperationsPerUser got as low as 15 (from the Microsoft-listed default of 1,500).

C:\inetpub\wwwroot>winrm get winrm/config/winrs
Winrs
    AllowRemoteShellAccess = true
    IdleTimeout = 180000
    MaxConcurrentUsers = 5
    MaxShellRunTime = 2147483647
    MaxProcessesPerShell = 15
    MaxMemoryPerShellMB = 512
    MaxShellsPerUser = 5

C:\inetpub\wwwroot>winrm get winrm/config/service
Service
    RootSDDL = <>
    MaxConcurrentOperations = 4294967295
    MaxConcurrentOperationsPerUser = 15
    EnumerationTimeoutms = 60000
    MaxConnections = 25
    MaxPacketRetrievalTimeSeconds = 120
    AllowUnencrypted = true
    Auth
        Basic = true
        Kerberos = true
        Negotiate = true
        Certificate = false
        CredSSP = false
        CbtHardeningLevel = Relaxed
    DefaultPorts
        HTTP = 5985
        HTTPS = 5986
    IPv4Filter = *
    IPv6Filter = *
    EnableCompatibilityHttpListener = false
    EnableCompatibilityHttpsListener = false
    CertificateThumbprint

I changed these settings as recommended by @nickwright80 and @JulianMay to the below:

winrm set winrm/config/winrs @{MaxShellsPerUser="30"} // From 5
winrm set winrm/config/winrs @{MaxConcurrentUsers="30"} // From 5
winrm set winrm/config/winrs @{MaxProcessesPerShell="30"} // From 15
winrm set winrm/config/service @{MaxConcurrentOperationsPerUser="1500"} // From 15

I then repackaged my box, ran vagrant up and it worked normally, as it did in Vagrant 1.8.1.

Thanks all for your help.

@sethvargo, I'm not sure how to handle this generally. If fixes can't be made to make rsync use few enough connections, could Vagrant check these settings and warn (or even override them) during the provisioning process, given that it will likely fail with a nasty error otherwise?

@ggascoigne
Copy link

I've been seeing a leak of winrm connections too. I put together a quick and dirty fix for it here:

master...ggascoigne:fix_winrm_leak

I can't claim that this is thoroughly tested but it's been working pretty well so far and has obviated the need for me to reconfigure all of my Windows box files.

@deancsmith
Copy link
Author

Thanks @ggascoigne.

We only have a few Windows boxes, so it's not so bad, but we have actually rolled back to 1.8.1 for the moment anyway.

@n1t1nv3rma
Copy link

I am having same error without even sharing any folder on Cygwin! :(
Windows 10
Installed Version: 1.8.4

vagrant up
.....
There was an error when attempting to rsync a synced folder.
Please inspect the error message below for more info.

Host path: /home/vermas/Vagrant_Home/Centos/
Guest path: /home/vagrant/sync
Command: "rsync" "--verbose" "--archive" "--delete" "-z" "--copy-links" "--chmod=ugo=rwX" "--no-perms" "--no-owner" "--no-group" "--rsync-path" "sudo rsync" "-e" "ssh -p 2200 -o ControlMaster=auto -o ControlPath=C:/cygwin64/tmp/ssh.89 -o ControlPersist=10m -o StrictHostKeyChecking=no -o IdentitiesOnly=true -o UserKnownHostsFile=/dev/null -i 'C:/cygwin64/home/vermas/Vagrant_Home/Centos/.vagrant/machines/worker-02/virtualbox/private_key'" "--exclude" ".vagrant/" "/home/vermas/Vagrant_Home/Centos/" "[email protected]:/home/vagrant/sync"
Error: Warning: Permanently added '[127.0.0.1]:2200' (ECDSA) to the list of known hosts.
mm_receive_fd: no message header
process_mux_new_session: failed to receive fd 0 from slave
mux_client_request_session: read from master failed: Connection reset by peer
Failed to connect to new control master
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) [sender=3.1.2]
....

@pfaffle
Copy link

pfaffle commented Jul 11, 2016

@n1t1nv3rma that looks like a different problem, see #7301 for a tweak that might help you.

@jaylinski
Copy link

jaylinski commented Jul 13, 2016

I can confirm the issue (v1.8.4, Ubuntu 14.04 x64):

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'

if ! File.exists?('./xampp/xampp_start.exe')
  puts 'XAMPP could not be found!'
  puts "Please download xampp-win32-1.8.2-6-VC9 and extract it to 'xampp'."
  exit 1
end

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "opentable/win-2008r2-standard-amd64-nocm"
  config.vm.network :forwarded_port, guest: 80, host: 8089

  config.vm.provision :shell, path: "scripts/install-apache-php.cmd"
  config.vm.provision :shell, path: "scripts/install-odbc-sql-driver.cmd"
  config.vm.provision :shell, path: "scripts/install-sql-php-driver.cmd"
  config.vm.provision :shell, path: "scripts/configure.cmd"
  config.vm.provision :shell, path: "scripts/start.cmd"

  config.vm.synced_folder "~/PhpstormProjects", "/xampp/htdocs/projects"
end

This Vagrantfile throws the following error:

/opt/vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:64:in `raise_if_wsman_fault': [WSMAN ERROR CODE: 2150859173]: <f:WSManFault Code='2150859173' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault)

Downgrade to v1.8.1 solved the issue.

@shoobbs
Copy link

shoobbs commented Jul 16, 2016

@ggascoigne your fix works for me .. simplest fix IMHO for the interim

@sethvargo sethvargo modified the milestones: 1.8.5, 1.8.6 Jul 19, 2016
@Sharpie
Copy link
Contributor

Sharpie commented Aug 9, 2016

Seeing this on Server 2008 boxes that work fine with Vagrant < 1.8.4 as well. @ggascoigne your fix appears to work, have you submitted it as a pull request?

@aaron-p-lehmann
Copy link

I still get this error on Vagrant 1.8.5 on Windows 10 host building a Windows 7 guest. Is there some configuration I need to do beyond what's out of the box?

@lonniev
Copy link
Contributor

lonniev commented Sep 22, 2016

Yes, it is still happening for me and, no, I'm not the fixer for this so I can't tell us how to get it working reliably. I may have updated my Vagrant build over the last month and that's why I still see it today. (Because I see that I remark above that the @ggascoigne fix did work for me for whatever I was doing back in August.) Today, I'm running Vagrant 1.8.5 on MacOS.

My local files for v1.8.5 have the PR #7712 update and so I'll have to pay more attention to why this issue has returned for a different VM.

@mwrock
Copy link
Contributor

mwrock commented Sep 23, 2016

One workaround is to have a provisioner execute set-item WSMan:\localhost\Shell\MaxShellsPerUser -Value 100 The default is 5 on 2k8r2/win 7. Vagrant uses elevated shell provisioners by default so that command should run without issue.

@aaron-p-lehmann
Copy link

I'm sorry, I'm pretty new to Vagrant, and I don't know Ruby either. Are you saying I need to write my own provisione, @mwrock? Or is there some generic way I can do that?

@mwrock
Copy link
Contributor

mwrock commented Sep 23, 2016

oh my apologies. Its much simpler than creating a provisioner.

just include this in your Vagrantfile:

config.vm.provision "shell", inline: "set-item WSMan:\\localhost\\Shell\\MaxShellsPerUser -Value 100"

@aaron-p-lehmann
Copy link

I tried that @mwrock, and it bombs in the same way when it tries to execute the set-item you gave me. I think that in order for that to work, I'd need to make my own box that has that cooked in.

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

I’ll report that the line, added to the Vagrantfile, as a shell provisioning step, for my self-made box for Softlayer and Windows Server 2012r2 allows the communicator to execute its registered task.

(I’m still looking at downstream provisioning before I say, “It Works For Me!” but, at the moment, this task-quota-limit appears to be the issue and the one-liner steps around it.)

What I really would like is a way to check the actual reason for the exception at the point of the $register_task.Run attempt and in the exception’s Catch block to craft an error message that tells the poor Vagrantfile author what to do to allow the intention to successfully complete.

I want that because in another 4 weeks for another VM, I will have forgotten all about this great patch we found here and that little helpful advice will remind me.

@mwrock
Copy link
Contributor

mwrock commented Sep 23, 2016

Yeah the challenge is that that provisioning script needs to run before 5 shells are created. Your luck of that actually happening could depend on the plugins you are using.

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

Apparently, the real challenge is the Windows TaskFolder GetTask and RegisteredTask Run methods do not provide adequate error exceptions to indicate why a registered task cannot be located or run.

We seem to forced to deal with this mysterious Null exception.

-- 
Lonnie VanZandt
303-900-3048

On 23 September 2016 at 09:57:05, Matt Wrock ([email protected]) wrote:

Yeah the challenge is that that provisioning script needs to run before 5 shells are created. Your luck of that actually happening could depend on the plugins you are using.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

I wrote a positive remark too quickly.

What @mwrock's one-liner does is somehow short-circuit provisioning attempts. Here's what gets reported as INFO:

==> sl-win-esrever: WARNING: The updated configuration might affect the operation of the plugins
==> sl-win-esrever: having a per plugin quota value greater than 100. Verify the configuration of
==> sl-win-esrever: all the registered plugins and change the per plugin quota values for the
==> sl-win-esrever: affected plugins.

The provisioner then stops. For the one-line shell provision, well, ok, that might be ok. It only has to run a powershell set-item command and that's it. Maybe that is the end of the chef run.

However, for the next :chef_solo provisioner, this is also all that happens. First, it shouldn't re-invoke the shell one-liner and secondly, it should go off and run the actual chef recipes. None of that occurs, chef and Vagrant wrap up and think their job is over.

@aaron-p-lehmann
Copy link

This is a pain for me, because the latest version I've found that doesn't have this problem is 1.8.1, which doesn't play nicely with the latest version of virtualbox on the Windows 10 machines we have at my work.

@mwrock
Copy link
Contributor

mwrock commented Sep 23, 2016

this all makes me very sad. I'll have a good look at this over the weekend. let me make sure I understand the scenario here @lonniev. You are targetting a 2008r2 vagrant box and trying to converge chef cookbooks via the chef omnibus plugin. Is there a Vagrantfile gist you can share that repros this? Not sure if your box and cookbooks are publicly available. Even if they are not it may be helpful.

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

It is messing up three of my Vagrant VMs as well.

(I'm pleased to have companions in misery but I trade tears for beers here on sunny Friday afternoon.)

The Microsoft literature indicates that this quota setting has no effect until after the WinRM service is restarted with "restart-service winrm". Therefore, I wonder if the workaround ever really did anything.

Having run set-item on the target once and then rebooting, I can query WSMan:

PS WSMan:\localhost\Shell> dir


   WSManConfig: Microsoft.WSMan.Management\WSMan::localhost\Shell

Type            Name                           SourceOfValue   Value
----            ----                           -------------   -----
System.String   AllowRemoteShellAccess                         true
System.String   IdleTimeout                                    7200000
System.String   MaxConcurrentUsers                             10
System.String   MaxShellRunTime                                2147483647
System.String   MaxProcessesPerShell                           0
System.String   MaxMemoryPerShellMB                            512
System.String   MaxShellsPerUser                               0

The shell provisioner in the Vagrantfile should not be necessary. I remove it.

The nasty-gram about the Quota limit goes away and the $register_task.Run exception returns.

QED: the shell provisioner never really did anything except short-circuit real provisioning attempts.

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

The "base box" that I am using is a Softlayer image that is Windows Server 2012r2 with a vagrant user, rsync, and sshd added. It has been a reliable base box for Softlayer until this winrm issue surfaced.

The image is available to a Softlayer provider with the parameter:

      sl.image_guid = "7017d7bc-ac22-4bc2-a58f-567d02a522fe"

@lonniev
Copy link
Contributor

lonniev commented Sep 23, 2016

I have to break away. Be back later.

With a Try/Catch handler in the erb that queries the $registered_task.Name property in the Catch block, this is the latest:

==> sl-tt-sync: Installing Chef 12.4.0
==> sl-tt-sync: Running provisioner: chef_solo...
==> sl-tt-sync: Detected Chef (latest) is already installed
==> sl-tt-sync: Generating chef JSON and uploading...
==> sl-tt-sync: Running chef-solo...
==> sl-tt-sync: WinRM_Elevated_Shell not Runnable.
Chef never successfully completed! Any errors should be visible in the
output above. Please fix your recipes so that they properly complete.

So the $registered_task value is a legitimate RegisteredTask and it is just that Run cannot be called on it, even though the WSMan limits are set to Unlimited 0.

@mwrock
Copy link
Contributor

mwrock commented Sep 24, 2016

hmm @lonniev I am wondering if you are experiencing a different error alltogether than what was originally discussed in this issue. If you are on 2012r2, the MaxShellsPerUser is 30 by default and not the ultra restrictive 5 of 2008R2. However 30 is not exactly huge. According to your shell settings output above, it looks like you set it to 0 (I'm assuming that translates to unlimited but unsure).

I was curious if a winrm restart was required for the new quota so I simulated the problem by openning up 5 PS Remoting sessions and then I adjusted the quota with no restart and I was immediately able to then open a 6th shell where I had previously gotten the error.

At any rate, can you confirm that the error you receive is:

 [WSMAN ERROR CODE: 2150859173]: <f:WSManFault Code='2150859173' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault)

Thanks!

@lonniev
Copy link
Contributor

lonniev commented Sep 24, 2016

In those WSMan settings, the MSDN documentation claims that 0 is used for a Unlimited limit. After values like 100 and 1000 made no difference, I ran the latest attempts with 0. This makes no difference.

This issue #7489 may have hijacked for a different error at the same method. If I'm to blame for that, I apologize.

Currently, the issue I encounter with trying to get winrm to run the WinRM_Elevated_Shell (that is the script to run chef-solo) is that the Run method on the RegisteredTask throws a Element Not Found exception. The WSManFault does not occur.

At the moment, I am looking for reasons why that apparently properly registered task with apparently valid encoded script cannot be run.

(I removed the pipe to Out-Null on the RegisterTaskDefinition call to capture the output of the register operation. The returned task content looks valid. I then took the embedded powershell command out of that content and ran it in Powershell window. There the encoded command runs fine. This suggests some kind of permission block on winrm or on the vagrant user running scheduled tasks.)

@lonniev
Copy link
Contributor

lonniev commented Sep 24, 2016

Issues #7577 and #6418 are more relevant to the use case that I am trying to diagnose. #7577 is already closed as a duplicate of #6418.

(Is there a way to get GitHub to move issue comments to a more appropriate issue? ;-) )

@chrisroberts chrisroberts modified the milestones: 1.8.7, 1.8.6 Sep 28, 2016
chrisroberts added a commit that referenced this issue Sep 30, 2016
fix #7489 preventing winrm connection leakage
@aaron-p-lehmann
Copy link

When do you expect this to hit the prime-time?

On Fri, Sep 30, 2016 at 12:11 PM, Chris Roberts [email protected]
wrote:

Closed #7489 #7489 via
64828f1
64828f1
.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7489 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABT6TWHHKxLXNCRSPcGpFMwxG5OC1eeks5qvTShgaJpZM4I5F6B
.

Thanks for your time,

Aaron LEHMANN

"Therefore confess your sins to each other and pray for each other so that
you may be healed. The prayer of a righteous person is powerful and
effective." -- James 5:16 If you or yours need prayer, let me know.

@dwickern
Copy link

dwickern commented Oct 26, 2016

This workaround worked for me. Put it before any other provisioners.

config.vm.provision "shell", inline: <<-SCRIPT
  # Workaround: This user is allowed a maximum number of 5 concurrent shells, which has been exceeded.
  Set-Item WSMan:\\localhost\\Shell\\MaxShellsPerUser -Value 100

  # Workaround: This user is allowed a maximum number of 15 concurrent operations, which has been exceeded.
  Set-Item WSMan:\\localhost\\Service\\MaxConcurrentOperationsPerUser -Value 100
SCRIPT

(if vagrant up fails before it runs the provisioner, run vagrant provision)

@hpAB
Copy link

hpAB commented Nov 10, 2016

i have added the following lines to the vagrant file but i am still seeing the same winrm error

win7.vm.provision :shell, inline: "Set-Item WSMan:\\localhost\\Shell\\MaxShellsPerUser -Value 100"
win7.vm.provision :shell, inline: "Set-Item WSMan:\\localhost\\Shell\\MaxConcurrentOperationsPerUser -Value 1500"

Error
==> win7: Setting hostname...
==> win7: Configuring and enabling network interfaces...
==> win7: Mounting shared folders...
win7: C:/.ssh => U:/Private/.ssh
win7: /vagrant => D:/Vagrant/middleware-dev
==> win7: Running provisioner: shell...
==> win7: Running cleanup tasks for 'windows_reboot' provisioner...
==> win7: Running cleanup tasks for 'windows_reboot' provisioner...
==> win7: Forcing shutdown of VM...
==> win7: Destroying VM and associated drives...
D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:64:in raise_if_wsman_fault': [WSMAN ERROR CODE: 2150859173]: <f:WSManFault Code='2150859173' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message>The WS-Management service cannot process the request. This user is allowed a maximum number of 5 concurrent shells, which has been exceeded. Close existing shells or raise the quota for this user. </f:Message></f:WSManFault> (WinRM::WinRMWSManFault) from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:51:inraise_if_error'
from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/response_handler.rb:35:in parse_to_xml' from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/http/transport.rb:200:insend_request'
from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:492:in send_message' from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:153:inopen_shell'
from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:72:in block in open' from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:222:inretryable'
from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/command_executor.rb:71:in open' from D:/Vagrant/embedded/gems/gems/winrm-1.8.1/lib/winrm/winrm_service.rb:359:increate_executor'

@ghost
Copy link

ghost commented Apr 3, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests