One of my Vagrant boxes ended up with an "Aborted" state, apparently I ran out of memory or something, and yeah. Now the box is not booting... properly.

Here is what I got:

$ vagrant up cloud2
Bringing machine 'cloud2' up with 'virtualbox' provider...
[cloud2] Clearing any previously set forwarded ports...
[cloud2] Fixed port collision for 22 => 2222. Now on port 2200.
[cloud2] Clearing any previously set network interfaces...
[cloud2] Preparing network interfaces based on configuration...
[cloud2] Forwarding ports...
[cloud2] -- 22 => 2200 (adapter 1)
[cloud2] Booting VM...
[cloud2] Waiting for machine to boot. This may take a few minutes...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period. This can
mean a number of things.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.

It says that it is running but I cannot login, though.

$ vagrant status cloud2
Current machine states:
cloud2                    running (virtualbox)
The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

$ vagrant ssh cloud2
ssh_exchange_identification: read: Connection reset by peer

This is the Vagrantfile config for the box:

  config.vm.define "cloud2" do |cloud2|
    cloud2.vm.box = "precise32"
    cloud2.vm.network "public_network", :bridge => 'wlan0'
    config.vm.boot_timeout = 600
#    config.vm.provider :virtualbox do |vb|
#        vb.customize ["modifyvm", :id, "--memory", "1024"]
#        vb.customize ["modifyvm", :id, "--cpus", "2"]
#    end

I've set the time-out 600 while reading some posts over here, but it did not helped me at all.

SOS! I did a lot of stuff on that VM and I....... do not have a backup :D :P



For some reason, the vm was not booting at all, I mean the OS. I added the vb.gui = true and just enter the boot option... the default one, from the grub boot menu :)

See here on how to use this config option.

  • Did this actually solve the underlying issue? Were you able to boot on subsequent attempts without enabling the gui? – Jon Bentley Dec 2 '15 at 15:25
  • I was able to boot afterwards, yes. But this was just a workaround for me. – Matías Jan 8 '16 at 0:36

Execute the command

vagrant ssh-config

On the output, please check the

IdentityFile /home/{USERNAME}/.vagrant.d/insecure_private_key

and switch the

ssh  user {USERNAME}

Finally, run

vagrant up

This might also happen when the /etc/ssh/sshd_config inside the VM is not valid, but the ssh service was restarted.

Example of invalid /etc/ssh/sshd_config:

# Package generated configuration file
# See the sshd_config(5) manpage for details

# What ports, IPs and protocols we listen for
Port 22
UsePAM yesAcceptEnv GIT_*

Such situation is possible when your provisioning script does this or you changed something manually.

Change vb.gui = true in your Vagrantfile and boot your VM (vagrant up) to debug this issue. After /etc/ssh/sshd_config is valid restart your ssh service:

service ssh restart

I had the same error message. The problem came from the ssh key that was not owned by me but by the root user.

sudo chown {USERNAME} /home/{USERNAME}/.vagrant.d/insecure_private_key

Everything works well now!!!

  • The question already has an accepted answer above. – BE77Y Feb 20 '15 at 9:28
  • @BE77Y An accepted answer doesn't mean additional answers aren't valid. In particular, this accepted answer appears to be a workaround rather than a fix to the underlying problem. – Jon Bentley Dec 2 '15 at 15:27
  • Both fair points! – BE77Y Dec 2 '15 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.