This is a weird one that I can't get to the bottom of...

Linux vagrant box, booted and provisioned OK.

If the box is spun up using "vagrant up", subsequent calls to "vagrant ssh" 
will fail with "invalid public key". Vagrant ssh-config points to the 
insecure key (correct).
I have also tried removing "config.ssh.insert_key = false" and using the 
secure generated keys. Same effect.

I've also tried specifying a host in my ~/.ssh/config:

User vagrant
IdentityFile ~/.vagrant.d/insecure_private_key
Port 2222
IdentitiesOnly yes

SSH from the console also fails.

Interestingly, vagrant up --provision will connect and run the provisioning 
script, so at some point vagrant is able to connect via ssh, although after 
the box has booted "vagrant halt" can no longer connect.

Now, here's the really weird part...

If I spin up the box manually using the VirtualBox GUI, after the machine 
is booted both ssh and "vagrant ssh" work with no problem. "Vagrant halt" 
is able to connect and everything works as expected (although I have to 
manually log in and mount my sync dir)

So, it very much seems that at some stage "vagrant up" is changing the ssh 
key somehow, although when boot the box using virtualbox and log in, my 
authorized_keys file for the vagrant user is correct, and the date on it 
shows it has not been modified since the box was originally provisioned.

Vagrant 2.0.2, on an Ubuntu host. Virtualbox 5.2

Any ideas what's going on?

This mailing list is governed under the HashiCorp Community Guidelines - Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub 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 view this discussion on the web visit
For more options, visit

Reply via email to