4

Whenever I try to boot a Vagrant box on my Windows 7 x64 laptop in git bash using vagrant up, I get a long series of Warning: Remote connection disconnect. Retrying... messages. Occasionally this results in failure with a couple of different messages (either guest VM tools not being installed, or a timeout), but sometimes, after 10 or 15 messages, it will boot successfully and I can SSH into it.

A picture, to illustrate:

Vagrant up in git bash

And the full output of the vagrant up command:

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ianwalter/ubuntu-node-nginx' is up to date...
==> 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: 9966 => 9966 (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:2222
    default: SSH username: vagrant
    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...
    default: Warning: Remote connection disconnect. Retrying...

And so on. Is this usual behavior? Is there some way I can fix it? I'm running Vagrant 1.6.2 with VirtualBox 4.3.12.

EDIT: After BrianC's advice, I booted a GUI session to see what the VM was doing while the connection was refused. This is what it looks like:

Git bash and VM gui

joemaller
  • 19,579
  • 7
  • 67
  • 84
Daniel Buckmaster
  • 7,108
  • 6
  • 39
  • 57
  • I would try enabling the GUI mode to see if that points to your startup problem. See my answer here for details: http://stackoverflow.com/questions/23690124/vagrant-up-timeout/23742373#23742373 – BrianC Jul 31 '14 at 00:17
  • @BrianC I added a picture to my question. The machine seems to halt after `vesafb: module verification failed` and its error messages. – Daniel Buckmaster Aug 07 '14 at 00:58
  • Which network options are set in the Vagrantfile? Also, if you watch the VirtualBox output, which command is stalling? I see this with `cloud-init-nonet` which waits 10, then 120 seconds for a network device. – joemaller Aug 22 '14 at 15:54
  • @joemaller there's just a port forward, nothing else. That VirtualBox screenshot shows where the output stalls. – Daniel Buckmaster Aug 23 '14 at 02:27
  • For the sake of completeness, this may happen when a folder containing dot vagrant subfolder is shared between machines, e.g. via Dropbox. The workaround would be to explicitly provide ssh password http://stackoverflow.com/a/26482167/673826 – mlt Jan 30 '15 at 22:37

2 Answers2

1

I have solved this for now by changing base box from ianwalter/ubuntu-node-nginx to ubuntu/trusty64 and installing node/NPM manually from the package manager. It doesn't seem to give me the same trouble, so I surmise there is something in the other image that is causing the stall.

Daniel Buckmaster
  • 7,108
  • 6
  • 39
  • 57
1

I also faced similar issue with vagrant but in my case I was not able to SSH even the vagrant was up.

I was using following configurations.

  • windows 10 64 bit

  • virtual box 5.0.20

  • HP ab032tx laptop
  • enabled virtualization in BIOS settings

Following were the vagrant file setting in my project folder.

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

Vagrant.configure("2") do |config|

config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
config.vm.boot_timeout = 1000    

# Optional NFS. Make sure to remove other synced_folder line too
#config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }

end

Every time I run vagrant up command following error occurred.

default: Warning: Remote connection disconnect. Retrying.. 

Solution To fix this I run the following command (vagrant destroy)

vagrant destroy
    default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...

Once this command was run I again run vagrant up and everything started working. Before this when ever I was running vagrang ssh I got following output.

 vagrant ssh-config
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile "C:/Users/muk_t/.vagrant.d/insecure_private_key"
  IdentitiesOnly yes
  LogLevel FATAL

Note : linux version used was 64 bit.

Mukesh
  • 7,630
  • 21
  • 105
  • 159