Vagrant VM Provider Config + SSH Forwarding = Error?

37 views
Skip to first unread message

Tyson Trautmann

unread,
May 17, 2017, 1:22:32 AM5/17/17
to Vagrant
Relative Vagrant and Ruby newb here. I'm trying to enable SSH forwarding from my Windows machine to my Vagrant created Ubuntu VM. My Vagrantfile has some provider specific config:

  config.vm.provider "virtualbox" do |v|
    v.name = guestHostname
    v.memory = 8192
    v.cpus = 2
    v.customize ["modifyvm", :id, "--vram", "128"]
    v.gui = true
  end

Works fine and dandy by itself. But when I add the config for SSH forwarding:

  config.ssh.forward_agent = true

Running 'vagrant up' starts failing with this error message:

Bringing machine 'development' up with 'virtualbox' provider...
==> development: Importing base box 'bento/ubuntu-16.10'...
==> development: Matching MAC address for NAT networking...
==> development: Checking if box 'bento/ubuntu-16.10' is up to date...
==> development: Setting the name of the VM: development
==> development: Clearing any previously set network interfaces...
==> development: Preparing network interfaces based on configuration...
    development: Adapter 1: nat
==> development: Forwarding ports...
    development: 22 (guest) => 2222 (host) (adapter 1)
==> development: Running 'pre-boot' VM customizations...
==> development: Booting VM...
==> development: Waiting for machine to boot. This may take a few minutes...
    development: SSH address: 127.0.0.1:2222
    development: SSH username: vagrant
    development: SSH auth method: private key
==> development: Forcing shutdown of VM...
==> development: Destroying VM and associated drives...
C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:54:in `readpartial': An established connection was aborted by the software in your host machine. (Errno::ECONNABORTED)
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:54:in `block (2 levels) in negotiate!'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:52:in `loop'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:52:in `block in negotiate!'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:50:in `loop'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:50:in `negotiate!'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/server_version.rb:32:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/session.rb:84:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh/transport/session.rb:84:in `initialize'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh.rb:233:in `new'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/net-ssh-4.1.0/lib/net/ssh.rb:233:in `start'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb:397:in `block (2 levels) in connect'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb:371:in `block in connect'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/util/retryable.rb:17:in `retryable'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb:370:in `connect'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb:68:in `block in wait_for_ready'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:88:in `block in timeout'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `block in catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:32:in `catch'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/timeout.rb:103:in `timeout'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/plugins/communicators/ssh/communicator.rb:46:in `wait_for_ready'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.9.4/lib/vagrant/action/builtin/wait_for_communicator.rb:16:in `block in call'

Commenting out the provider specific config makes the error go away. Any ideas on what could be causing the issue?

(thanks in advance for the help!)

Alvaro Miranda Aguilera

unread,
May 17, 2017, 3:39:22 PM5/17/17
to vagra...@googlegroups.com
hello

please share the full vagrant file



--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/91ff054c-d127-4376-a2ef-9431cdeac7c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Tyson Trautmann

unread,
May 22, 2017, 1:17:36 PM5/22/17
to Vagrant
It turned out that I just needed to upgrade Vagrant - there was a known bug in the version that I was using (although I'm still not clear why adding the SSH forwarding config was triggering the issue).
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages