I've initialized a standard vagrant (no additional config just default) with ubuntu/trusty64
box. Vagrant freezes on default: SSH auth method: private key
step. I thought it was a ssh problem and tried using username password and etc.
Eventually I found out that the ports are not being forwarded properly. By default port 2222
on host is forwarded to 22
on the guest machine. I can use virtualbox gui to login to the machine and see that the guest is indeed listening on port 22
:
However the host does not have the port 2222
open. If I run netstat -na |grep 2222
on my host machine I get no result (windows 7 host with cygwin).
Additionally if I do telnet localhost 2222
I get Could not open connection to the host, on port 2222: Connect failed
which indicates the port is not open
EXTRA: I have been looking for solution for over 16 hours now but no luck. Tried many different solutions and even managed to ssh into the machine by using public bridged network and static ips however the vagrant-ssh
didn't work in that case and refused to map the default network drives. My conclusion is that vagrant cannot communicate with the guest machine at all once it's booted up.
EDIT Also I get surprising result when I run nmap scan on port 2222
I get both of those result. If I keep running the scan, it'll return either of them randomly
5.0.22 r108 108
and vagrant is1.8.1
– Arijoon.vagrant
folder. Make sure you're working inside a path which doesn't require Administrator priviledges, Example:C:\Users\<yourname>
is good, whileC:\Program Files
is not. It might sound stupid but sometimes avagrant destroy
vagrant box update
might help to get things running fresh again, especially on a Windows host. – MacK2222
on host should be accessible (to route to the guest) but it isn't. Is there any way to assure the ports are forwarded correctly. I have tried a lot of solutions but it really seems like vagrant just can't communicate to the guest machine at all – Arijoon