# Ansible + Vagrant with VirtualBox ssh error

**URL:** <https://forum.ansible.com/t/ansible-vagrant-with-virtualbox-ssh-error/14143>\
**Category:** Ansible Project\
**Created:** [December 12, 2013, 9:14pm UTC](https://forum.ansible.com/t/ansible-vagrant-with-virtualbox-ssh-error/14143 "2013-12-12T21:14:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seth\_Edwards](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@Seth\_Edwards](https://forum.ansible.com/u/Seth_Edwards)\
**Post date:** [December 12, 2013, 9:14pm UTC](https://forum.ansible.com/t/ansible-vagrant-with-virtualbox-ssh-error/14143/1 "2013-12-12T21:14:28Z")

</div>

I’ve just recently started using Ansible + Vagrant and I have a multi-machine Vagrant file which I’ve put in this pastebin

[http://pastebin.com/91GLiJaD](http://pastebin.com/91GLiJaD)

When I run ‘vagrant up’ sometimes it works and other times I get errors. The error I get is below

fatal: [192.168.33.20] =\> SSH encountered an unknown error. The output was:  
OpenSSH\_6.2p2, OSSLShim 0.9.8r 8 Dec 2011  
debug1: Reading configuration data /Users/seth/.ssh/config  
debug1: /Users/seth/.ssh/config line 8: Applying options for \*  
debug1: Reading configuration data /etc/ssh\_config  
debug1: /etc/ssh\_config line 20: Applying options for \*  
debug1: /etc/ssh\_config line 102: Applying options for \*  
debug1: auto-mux: Trying existing master  
debug1: Control socket “/Users/seth/.ansible/cp/ansible-ssh-192.168.33.20-22-vagrant” does not exist  
debug2: ssh\_connect: needpriv 0  
debug1: Connecting to 192.168.33.20 [192.168.33.20] port 22.  
debug2: fd 3 setting O\_NONBLOCK  
debug1: connect to address 192.168.33.20 port 22: Operation timed out  
ssh: connect to host 192.168.33.20 port 22: Operation timed out

TASK: [common | be sure ntp is installed] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
FATAL: no hosts matched or all hosts have already failed – aborting

Any ideas what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![Sebastian\_Pawlus](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@Sebastian\_Pawlus](https://forum.ansible.com/u/Sebastian_Pawlus)\
**Post date:** [December 14, 2013, 10:15am UTC](https://forum.ansible.com/t/ansible-vagrant-with-virtualbox-ssh-error/14143/2 "2013-12-14T10:15:42Z")

</div>

I’ve found the same issue this morning:

- ansible 1.4.1, and devel with at #91f903eabeddfa19552eb1d1b998297d99627e3d as well
- Vagrant 1.4
- host machine ubuntu 13.10 64,
- guest machine ubuntu 12.04 64

It looks a bit nondeterministic, there are moments when vagrant up works just fine.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [December 14, 2013, 10:14pm UTC](https://forum.ansible.com/t/ansible-vagrant-with-virtualbox-ssh-error/14143/3 "2013-12-14T22:14:25Z")

</div>

Sounds like there should be a bug filed in the provisioner to wait for the port

(This is not part of Ansible core)

– Michael
