Hi, thank you for your help.

I've done a little bit of digging, as you suggested.

The problem appears to be with the synced_folder entry. Before this, I 
could ssh in, if the box is provisioned with this line, SSH is no longer 
possible. This with the ubuntu/xenial box, updated to latest.

If I switch to the hashicorp/precise64 box, I *can* ssh in, although it 
falls back to password. If I don't have the synced_folder line on the 
hashicorp box I am able to ssh in with the public key (i.e. it doesn't fall 
back), so it looks like the hashicorp build has better recovery, but the 
fundamental problem is still there (and indeed, vagrant halt fails to 
connect to the box).

Marcus

On Tuesday, 13 March 2018 07:54:01 UTC, Alvaro Miranda Aguilera wrote:
>
> Hello
>
> Well what I said was basically start minimal and do a change as the time
>
> start with a Vagrantfile like this:
>
> Vagrant.configure("2") do |config|
>
>   #config.ssh.insert_key = false 
>
>   
>
>   #config.vm.box = "ubuntu/xenial64"
>
>   config.vm.box = "hashicorp/precise64"
>
>
>   #config.vm.boot_timeout = 600
>
>
>   #config.vm.hostname = "twelveandus"
>
>   #config.vm.network :private_network, ip: "192.168.33.34"
>
>
>   #config.vm.synced_folder ".", "/home/vagrant/"
>
>
>   #config.vm.provision :shell, path: "vagrant/bootstrap.sh"
>
>   #config.vm.provision :shell, path: "vagrant/startup.sh", run: "always"
>
>
>   #config.vm.provider "virtualbox" do |v|
>
>   #  v.memory = 2048
>
>   #end
>
>
> end
>
>
>
> Does this work ?
>
> if yes, maybe the box you are using is broken.
>
> try as is, then try with the box you want to use
>
> and test one line of the configuration of the time until you find where it 
> breaks
>
> Alvaro
>
> On Mon, Mar 12, 2018 at 11:17 AM, 'Marcus Povey' via Vagrant <
> vagra...@googlegroups.com <javascript:>> wrote:
>
>> Hi, thanks for getting back to me.
>>
>> I tried what you said, both on my own computer and my colleague's 
>> computer. Both cases after bringing up the box with no provisioning, 
>> vagrant ssh failed.
>>
>> Here's the Vagrantfile:
>>
>> Vagrant.configure("2") do |config|
>>   config.ssh.insert_key = false 
>>   
>>   config.vm.box = "ubuntu/xenial64"
>>
>>   config.vm.boot_timeout = 600
>>
>>   config.vm.hostname = "twelveandus"
>>   config.vm.network :private_network, ip: "192.168.33.34"
>>
>>   config.vm.synced_folder ".", "/home/vagrant/"
>>
>>   config.vm.provision :shell, path: "vagrant/bootstrap.sh"
>>   config.vm.provision :shell, path: "vagrant/startup.sh", run: "always"
>>
>>   config.vm.provider "virtualbox" do |v|
>>     v.memory = 2048
>>   end
>>
>> end
>>
>>
>> On Sunday, 11 March 2018 18:55:34 UTC, Alvaro Miranda Aguilera wrote:
>>>
>>> share a zip with the project or the Vagrantfile if you don' have any 
>>> provision.
>>>
>>> I would say
>>>
>>> 1. try like this
>>>
>>> vagrant destroy
>>> vagrant up --no-provision
>>> vagrant ssh
>>> vagrant reload
>>>
>>> works?
>>>
>>> if yes, something is breaking this
>>>
>>> 2. try with a different box
>>>
>>> vagrant destroy
>>> vagrant up --no-provision
>>> vagrant ssh
>>> vagrant reload
>>>
>>> works?
>>>
>>> then something is broken with the box
>>>
>>>
>>> Alvaro
>>>
>>>
>>> On Sun, Mar 11, 2018 at 1:28 PM, 'Marcus Povey' via Vagrant <
>>> vagra...@googlegroups.com> wrote:
>>>
>>>> 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:
>>>>
>>>> Host 127.0.0.1
>>>> 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 
>>>> - 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+...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/vagrant-up/ef4ef8bf-1ab6-44fb-83fd-38df24f5fe35%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/vagrant-up/ef4ef8bf-1ab6-44fb-83fd-38df24f5fe35%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> -- 
>>> Alvaro
>>>
>>> -- 
>> 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+...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/vagrant-up/a42302b8-e1c2-4793-8efd-b48108be8cf6%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/vagrant-up/a42302b8-e1c2-4793-8efd-b48108be8cf6%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Alvaro
>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/60ecce26-cd5c-48e4-8b01-5b07c22cd151%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to