Vagrant Stopped Working Suddenly

2,583 views
Skip to first unread message

sharingsunshine

unread,
Dec 22, 2014, 5:53:03 PM12/22/14
to vagra...@googlegroups.com
I am using vagrant Installed Version: 1.7.0 and Virtual Box 4.3.20


The system was working fine and I got confused and I hit control w thinking I was in nano and then it seemed to drop all out of vagrant so I did vagrant ssh and now I keep getting this message:

ssh_exchange_identification: Connection closed by remote host

I searched on that message but none of the answers on the group seemed to fit my situation.

rjw vagrant ssh-config
Host default
  HostName 127.0.0.1
  User web
  Port 15022
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile /Users/rjw/devop/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

When I do a vagrant reload I get the bottom message until it times out

rjw vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 80 => 15080 (adapter 1)
    default: 15022 => 15022 (adapter 1)
    default: 3306 => 18306 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:15022
    default: SSH username: web
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...
    default: Warning: Remote connection disconnect. Retrying...

Please help me get back the system without having to start over.

Thanks,

Randal



Alvaro Miranda Aguilera

unread,
Dec 22, 2014, 7:24:16 PM12/22/14
to vagra...@googlegroups.com
you can open the virtualbox gui, and check whats happening there?

try stopping and turning on the VM from the virtualbox gui,



--
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.
For more options, visit https://groups.google.com/d/optout.

The Herbs Place

unread,
Dec 23, 2014, 9:53:02 AM12/23/14
to vagra...@googlegroups.com
Thanks for the directions.  I did open up the gui and it is asking for the username and password rather than coming up normally.

I did try stopping and turning it on through the guy but it still keeps wanting the username and password.  When I do supply them it just acts  like a  normal server outside of the vagrant shell.

Is there anyway to get it back to working under the vagrant shell?

Blessings!

Randal J. Watkins
The Herbs Place
http://www.TheHerbsPlace.com
Healthy Pet Corner
http://www.HealthyPetCorner.com


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/rV5gTGisRgg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Alvaro Miranda Aguilera

unread,
Dec 23, 2014, 2:58:13 PM12/23/14
to vagra...@googlegroups.com
hello,

vagrant turn on the vm and connect over ssh

based on the error, it seems the vm start but can't ssh into.

try this:
turn vm on by gui
test  vagrant ssh  when you are at user login prompt on the gui

if doesn't work, you need to troubleshoot the guest, can be something related to ssh/firewall/network

try to login as vagrant/vagrant then sudo su -
or root/root

but the problem, based on the logs you did provide is that vagrant is not being able to ssh into the guest


sharingsunshine

unread,
Dec 29, 2014, 5:10:47 PM12/29/14
to vagra...@googlegroups.com
Thanks for your suggested fixes.  However, none of them seemed to work.  It seems the box I am using doesn't have vagrant vagrant setup.  Also at the login I couldn't use vagrants ssh.

The server still works but only if brought up from the gui.  If I use vagrant up it comes up but then continually repeats the message "default: Warning: Remote connection disconnect. Retrying."  Even if I login via the gui that message still keeps going.   Somehow it seems to have forgotten the vagrant commands.

This has all happened with the host machine firewall turned off and selinux disabled on the guest.

Do you have any other suggestions?

Torben Knerr

unread,
Dec 29, 2014, 7:10:43 PM12/29/14
to vagra...@googlegroups.com
Hi,

you can try to log in via plain ssh from the commandline with verbose
logging, this might give you some more information on what's going
wrong, e.g.:

ssh vag...@127.0.0.1 -p 2222 -i
.vagrant/machines/default/virtualbox/private_key -o
StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -vvv

Does that show anything helpful?

HTH,
Torben

The Herbs Place

unread,
Dec 30, 2014, 12:25:25 PM12/30/14
to vagra...@googlegroups.com
Hi Torben,

Thanks for the ssh command. It does open up more details but unfortunately I am not able to copy and paste the messages to see them fully. I have extensions installed and clipboard bidirectional and drag and drop bidirectional too.

It also can’t find this path .vagrant/machines/default/virtualbox/private_key so I am thinking there is some step that has been overlooked. I have tested this on another completely different box and it still says can’t find that path or using this command

find / -name “.vagrant"
find / -name “virtualbox"
find / -name “machines” -

it can’t find any directory names as above on the server.

I am testing on a puppet box I took off of their site and another box that is fully provisioned which can be found at http://devopera.com/applications/linux-apache-mysql-php-lamp - I need centos 6 which is why I am using these boxes.

Do you have any other ideas I might try?

Blessings!

Randal J. Watkins
The Herbs Place
http://www.TheHerbsPlace.com
Healthy Pet Corner
http://www.HealthyPetCorner.com


> 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/rV5gTGisRgg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.

Torben Knerr

unread,
Dec 30, 2014, 4:47:51 PM12/30/14
to vagra...@googlegroups.com
Hi Randal,

sorry I was not specific enough. The .vagrant directory is created in
your project directory where the Vagrantfile is, i.e.
`<your-project>/.vagrant`.

Usually this file is .gitignored as it is created ba Vagrant when you
run `vagrant up`.

As of Vagrant 1.7, the insecure private key that is shipped with
Vagrant (you can find it in `~/.vagrant.d/insecure_private_key`) is
used for the first login only and then immediately replaced with a
newly created private key (this one here:
`.vagrant/machines/default/virtualbox/private_key`) for security
matters.

So if it never got to that point you should be able to log in with the
default insecure private key still, i.e.:

ssh vag...@127.0.0.1 -p 2222 -i ~/.vagrant.d/insecure_private_key
-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -vvv

HTH,
Torben

The Herbs Place

unread,
Jan 2, 2015, 3:35:52 PM1/2/15
to vagra...@googlegroups.com
Hi Torben,

Thanks for the clarification. The file was on the host all the time. When I run your command I get the following:

Trying private key: .vagrant/machines/default/virtualbox/private_key
debug1: read PEM private key done: type RSA
debug3: sign_and_send_pubkey: RSA cb:fd:04:5e:70:93:b6:b0:01:bc:e7:5e:47:2b:ab:88
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

It seems to indicate that the private key was read then something goes wrong and defaults to password which is what is going on that I have to use the gui to login now.

Do you have any suggestions?

Blessings!

Randal J. Watkins
The Herbs Place
http://www.TheHerbsPlace.com
Healthy Pet Corner
http://www.HealthyPetCorner.com


Alvaro Miranda Aguilera

unread,
Jan 6, 2015, 5:35:41 PM1/6/15
to vagra...@googlegroups.com
can you share the vagrantfile you are using?

The Herbs Place

unread,
Jan 7, 2015, 8:54:21 PM1/7/15
to vagra...@googlegroups.com
Hello,

This is the vagrant file I am using for the box from devopera - http://devopera.com/applications/linux-apache-mysql-php-lamp

Thanks for taking a look at it.

# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at

  # Every Vagrant virtual environment requires a box to build off of.
 config.vm.provider "virtualbox" do |v|  
 v.gui = true
 end
  config.vm.box = "doco6"
  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # If true, then any SSH connections made will enable agent forwarding.
  # Default value: false
  # config.ssh.forward_agent = true

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Don't boot with headless mode
  #   vb.gui = true
  #
  #   # Use VBoxManage to customize the VM. For example to change memory:
  #   vb.customize ["modifyvm", :id, "--memory", "1024"]
  # end
  #
  # View the documentation for the provider you're using for more
  # information on available options.

  # Enable provisioning with CFEngine. CFEngine Community packages are
  # automatically installed. For example, configure the host as a
  # policy server and optionally a policy file to run:
  #
  # config.vm.provision "cfengine" do |cf|
  #   cf.am_policy_hub = true
  #   # cf.run_file = "motd.cf"
  # end
  #
  # You can also configure and bootstrap a client to an existing
  # policy server:
  #
  # config.vm.provision "cfengine" do |cf|
  #   cf.policy_server_address = "10.0.2.15"
  # end

  # Enable provisioning with Puppet stand alone.  Puppet manifests
  # are contained in a directory path relative to this Vagrantfile.
  # You will need to create the manifests directory and a manifest in
  # the file default.pp in the manifests_path directory.
  #
  # config.vm.provision "puppet" do |puppet|
  #   puppet.manifests_path = "manifests"
  #   puppet.manifest_file  = "default.pp"
  # end

  # Enable provisioning with Chef Solo, specifying a cookbooks path, roles
  # path, and data_bags path (all relative to this Vagrantfile), and adding
  # some recipes and/or roles.
  #
  # config.vm.provision "chef_solo" do |chef|
  #   chef.cookbooks_path = "~/chef/cookbooks"
  #   chef.roles_path     = "~/chef/roles"
  #   chef.data_bags_path = "~/chef/data_bags"
  #
  #   chef.add_recipe "mysql"
  #   chef.add_role "web"
  #
  #   chef.json = { mysql_password: "foo" }
  # end
  #
  # Chef Solo will automatically install the latest version of Chef for you.
  # This can be configured in the provisioner block:
  #
  # config.vm.provision "chef_solo" do |chef|
  #   chef.version = "11.16.4"
  # end
  #
  # Alternative you can disable the installation of Chef entirely:
  #
  # config.vm.provision "chef_solo" do |chef|
  #   chef.install = false
  # end

  # Enable provisioning with Chef Zero. The Chef Zero provisioner accepts the
  # exact same parameter as the Chef Solo provisioner:
  #
  # config.vm.provision "chef_zero" do |chef|
  #   chef.cookbooks_path = "~/chef/cookbooks"
  #   chef.roles_path     = "~/chef/roles"
  #   chef.data_bags_path = "~/chef/data_bags"
  #
  #   chef.add_recipe "mysql"
  #   chef.add_role "web"
  #
  #   # You may also specify custom JSON attributes:
  #   chef.json = { mysql_password: "foo" }
  # end

  # Enable provisioning with Chef Server, specifying the chef server URL,
  # and the path to the validation key (relative to this Vagrantfile).
  #
  # The Hosted Chef platform uses HTTPS. Substitute your organization for
  # ORGNAME in the URL and validation key.
  #
  # If you have your own Chef Server, use the appropriate URL, which may be
  # HTTP instead of HTTPS depending on your configuration. Also change the
  # validation key to validation.pem.
  #
  # config.vm.provision "chef_client" do |chef|
  #   chef.chef_server_url     = "https://api.opscode.com/organizations/ORGNAME"
  #   chef.validation_key_path = "ORGNAME-validator.pem"
  # end
  #
  # If you're using the Hosted Chef platform, your validator client is
  # ORGNAME-validator, replacing ORGNAME with your organization name.
  #
  # If you have your own Chef Server, the default validation client name is
  # chef-validator, unless you changed the configuration.
  #
  #   chef.validation_client_name = "ORGNAME-validator"
  #
  # Chef Client will automatically install the latest version of Chef for you.
  # This can be configured in the provisioner block:
  #
  # config.vm.provision "chef_client" do |chef|
  #   chef.version = "11.16.4"
  # end
  #
  # Alternative you can disable the installation of Chef entirely:
  #
  # config.vm.provision "chef_client" do |chef|
  #   chef.install = false
  # end

  # Enable provisioning with Chef Apply, specifying an inline recipe to execute
  # on the target system.
  #
  # config.vm.provision "chef_apply" do |chef|
  #   chef.recipe = <<-RECIPE
  #     package "curl"
  #   RECIPE
  # end
  #
  # Chef Apply will automatically install the latest version of Chef for you.
  # This can be configured in the provisioner block:
  #
  # config.vm.provision "chef_apply" do |chef|
  #   chef.version = "11.16.4"
  # end
end

Blessings!

Randal J. Watkins
The Herbs Place
http://www.TheHerbsPlace.com
Healthy Pet Corner
http://www.HealthyPetCorner.com


On Jan 6, 2015, at 5:35 PM, Alvaro Miranda Aguilera <kik...@gmail.com> wrote:

can you share the vagrantfile you are using?

Alvaro Miranda Aguilera

unread,
Jan 9, 2015, 10:58:28 PM1/9/15
to vagra...@googlegroups.com
try to add the box again to your base boxes

vagrant box add doco6-lamp-dev http://devopera.com/node/63/download/centos6

but that box name doesn't match the one you have on vagrantfile

so try this


vagrant box add doco6-lamp-dev http://devopera.com/node/63/download/centos6

then create a new folder

mkdir doco6
cd doco6
vagrant init doco6-lamp-dev -m
vagrant up



--
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.
Reply all
Reply to author
Forward
0 new messages