Hello Jacob,
This is what I have found.
If I build the box, and run a vagrant file like this:
Vagrant.configure(2) do |config|
config.vm.box = "sgjacob"
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
end
It works.
The reason is, in your provision script, seems you are missing to add the
vagrant known public ssh key.
So you can add this to your template:
"mkdir ~vagrant/.ssh",
"chmod 700 ~vagrant/.ssh",
"echo 'ssh-rsa
AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==
vagrant insecure public key' > ~vagrant/.ssh/authorized_keys",
"chmod 600 ~vagrant/.ssh/authorized_keys",
"chown -R vagrant: ~vagrant/.ssh",
And should fix the issues.
Alvaro.
On Mon, Mar 7, 2016 at 4:37 AM, Jacob Dougherty <[email protected]> wrote:
> Sure.
>
> I build with: https://github.com/sgjacob/packer-centos7-virtualbox-vagrant
> Then import the box locally and up with:
> https://gist.github.com/sgjacob/8c710c8b2c27ecd921f5
> Some times it will start fine, but reload a few times and the error shows
> up. Once it shows, I can't get vagrant to up anymore, I just continually
> get that error, for hours.
>
> Thanks for taking a look.
>
> Jacob.
>
> On 03/04/2016 08:18 PM, Alvaro Miranda Aguilera wrote:
>
> Hello,
>
> I am more than happy to review and help you to get this working, and I can
> check the packer part if you are willing to share what you got.
>
> Alvaro.
>
> On Sat, Mar 5, 2016 at 10:42 AM, <[email protected]> wrote:
>
>> Hello. I am having an issue that I am hoping to get assistance on, maybe
>> someone else has run into it, because googling for it has been hard.
>>
>> I have been using a CentOS 7 box, which I made with Packer, that
>> regularly has issues starting up. I am using a boilerplate Vagrantfile,
>> with the only meaningful addition being:
>> config.vm.network "private_network", ip: "172.18.7.6"
>>
>> Version: 1.7.4
>> Provider: VirtualBox
>> Host: Suse Leap
>> Guest: CentOS 7
>>
>> *Output:*
>> vagrant up
>> Please report a bug if this causes problems.
>> Bringing machine 'default' up with 'virtualbox' provider...
>> ==> default: Importing base box 'centos7'...
>> ==> default: Matching MAC address for NAT networking...
>> ==> default: Setting the name of the VM: centos7
>> ==> default: Clearing any previously set network interfaces...
>> ==> default: Preparing network interfaces based on configuration...
>> default: Adapter 1: nat
>> default: Adapter 2: hostonly
>> ==> default: Forwarding ports...
>> default: 22 => 2222 (adapter 1)
>> ==> default: Running 'pre-boot' VM customizations...
>> ==> default: Booting VM...
>> ==> default: Waiting for machine to boot. This may take a few minutes...
>> default: SSH address: 127.0.0.1:2222
>> default: SSH username: vagrant
>> default: SSH auth method: private key
>> default:
>> default: Vagrant insecure key detected. Vagrant will automatically
>> replace
>> default: this with a newly generated keypair for better security.
>> default:
>> default: Inserting generated public key within guest...
>> default: Removing insecure key from the guest if it's present...
>> default: Key inserted! Disconnecting and reconnecting using new SSH
>> key...
>> ==> default: Machine booted and ready!
>> ==> default: Checking for guest additions in VM...
>> ==> default: Setting hostname...
>> ==> default: Configuring and enabling network interfaces...
>> The following SSH command responded with a non-zero exit status.
>> Vagrant assumes that this means the command failed!
>>
>> cat /sys/class/net/veth00d3838/address
>>
>> Stdout from the command:
>>
>>
>>
>> Stderr from the command:
>>
>> cat: /sys/class/net/veth00d3838/address: No such file or directory
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> <https://groups.google.com/d/msgid/vagrant-up/34c76054-6862-4d71-a809-3516e48af924%40googlegroups.com?utm_medium=email&utm_source=footer>
>> https://groups.google.com/d/msgid/vagrant-up/34c76054-6862-4d71-a809-3516e48af924%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> 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 a topic in the
> Google Groups "Vagrant" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/vagrant-up/6vnXcHc3mv4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> <https://groups.google.com/d/msgid/vagrant-up/CAHqq0exOLLofK5CmbNTZTPSLPiuf29MX9ANdnFZ-qnyL7Z2R2Q%40mail.gmail.com?utm_medium=email&utm_source=footer>
> https://groups.google.com/d/msgid/vagrant-up/CAHqq0exOLLofK5CmbNTZTPSLPiuf29MX9ANdnFZ-qnyL7Z2R2Q%40mail.gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/56DC4EA4.2070106%40shiftgig.com
> <https://groups.google.com/d/msgid/vagrant-up/56DC4EA4.2070106%40shiftgig.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vagrant-up/CAHqq0ey_7rP2A5oMYYxmB8zAVvJv%3D9PhsEQsXcWBE50-JgO7zw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.