Can't SSH into the VM based on lucid32 box

1,835 views
Skip to first unread message

Eugene Bolshakov

unread,
May 25, 2011, 12:39:56 PM5/25/11
to vagra...@googlegroups.com
Hi guys,

I'm just starting to use vagrant and following the getting started guide. I have VB 4.0.8 and vagrant 0.7.5 and downloaded the lucid32 box from the site this morning. So I'm creating a new VM and I'm able to start it (I'm starting it in GUI mode and I see that it's working), but most of the time not SSH into it.

vagrant up says: Failed to connect to VM!Failed to connect to VM via SSH...
when I try to ssh manually (I've copied the output of vagrant ssh_config to my ~/.ssh/config) I get: ssh_exchange_identification: Connection closed by remote host

*Sometimes* it works though. I was able to figure out because I tried to start the VM many times.

Interestingly, restarting networking (/etc/init.d/networking restart) in the VM seems to fix it. I'am able to ssh after the restart. 

I also tried to download this box and it works fine: http://www.vagrantbox.es/26/

So maybe it's a problem with the lucid32 box? I'd be happy to debug this issue, but I don't really know how to do it. Any suggestions are welcome.

Thanks

Matt Doran

unread,
May 28, 2011, 10:24:13 PM5/28/11
to Vagrant
Hi there,

On May 26, 2:39 am, Eugene Bolshakov <eugene.bolsha...@gmail.com>
wrote:
> Hi guys,
>
> I'm just starting to use vagrant and following the getting started guide. I
> have VB 4.0.8 and vagrant 0.7.5 and downloaded the lucid32 box from the site
> this morning. So I'm creating a new VM and I'm able to start it (I'm
> starting it in GUI mode and I see that it's working), but most of the time
> not SSH into it.
>

I'm seeing the exact same problem on a new Macbook Pro. VB 4.0.8 and
it won't connect over SSH. I've tried starting new VMs 3-4 times and
it never seems to work for me.

When I login to the box via the VB console and do an "ipconfig" I
noticed that eth0 didn't have an ipv4 address. After doing an "/etc/
init.d/networking restart" the interface got an ipv4 address and
things started working.

I've very new to vagrant and was just trying the getting started
guide..... and had also just installed VB 4.0.8 for the first time.
Maybe it's an issue with this version of VB?

I'm also happy to help debug/diagnose if anyone has any pointers.

Cheers,
Matt

TomDV

unread,
Jun 10, 2011, 7:56:54 AM6/10/11
to Vagrant
I'm also running into this.
Any updates on this one?

Mitchell Hashimoto

unread,
Jun 10, 2011, 11:08:20 AM6/10/11
to vagra...@googlegroups.com
Tom,

This should be fixed with the latest lucid32/lucid64 boxes that I created last week. How recent are your boxes?

Also, you may want to try adding this to your config: `config.ssh.max_tries = 30` and seeing if that helps.

Best,
Mitchell

Boris Gordon

unread,
Jun 12, 2011, 4:46:16 AM6/12/11
to vagra...@googlegroups.com
The problem exists for lucid32 and lucid64 boxes downloaded today. Setting max_tries >= 30 doesn't help.

Boris Gordon

unread,
Jun 12, 2011, 2:20:39 AM6/12/11
to Vagrant
I am having the same problem with only using gui boot and manually
restarting networking with 'sudo /etc/init.d/networking restart'
fixing anything. Increasing max_tries didn't work.

I have tried recent lucid32 and lucid64 boxes and will try to
redownload again though it looks like there's a problem. Is it
possible they got overwritten?

regards
Boris Gordon

On Jun 11, 1:08 am, Mitchell Hashimoto <mitchell.hashim...@gmail.com>
wrote:

Boris Gordon

unread,
Jun 12, 2011, 2:21:43 AM6/12/11
to Vagrant
I am having this problem as well, config.ssh.max_tries = 30 or 50
doesn't help. Downloaded boxes today.

On Jun 11, 1:08 am, Mitchell Hashimoto <mitchell.hashim...@gmail.com>
wrote:

Tom De Vylder

unread,
Jun 12, 2011, 8:18:58 PM6/12/11
to vagra...@googlegroups.com
I'm still experiencing the problem with the following boxes on http://vagrantbox.es:

- lucid32.box
- lucid64.box
- squeeze64.box
- talifun-ubuntu-11.04-server-amd64.box
- sl6-64-nochef.box
- ...

And the ones from http://files.vagrantup.com too:
- lucid32.box
- lucid64.box

All of them have been (re)downloaded less then 3 days ago.

Kind regards,
Tom

Tom Taylor

unread,
Jun 15, 2011, 7:40:38 AM6/15/11
to vagra...@googlegroups.com
I had this problem. Rolling back to Virtualbox 4.0.2 (the last build I haven't had stability issues with) solved it.

sebastian_a

unread,
Jun 15, 2011, 9:38:57 AM6/15/11
to Vagrant
Having the same problem. Any idea for this?

Boris Gordon

unread,
Jun 15, 2011, 10:07:42 PM6/15/11
to vagra...@googlegroups.com
Tom, when did you download the base boxes that were giving you trouble but work with 4.0.2 ?

janjaapdriessen

unread,
Jun 17, 2011, 7:39:37 AM6/17/11
to Vagrant
I experienced the same problem: OSX, VB 4.0.8, vagrant 0.7.5 and a
recent lucid32 box. I found out that the SSH command succeeds after
approximately 20 seconds, which led me to suspect a DNS issue. The /
etc/resolv.conf of the lucid32 box points to some comcast addresses,
which are not accessible for everybody.
If you change the resolv.conf to 8.8.8.8 everything works like a
charm. I can imagine Mitchell couldn't reproduce the problem, as his
machines probably have access to that DNS server.

My solution: start lucid32 in gui mode, login and change the /etc/
resolv.conf to 8.8.8.8. After this, you can ssh into the machine
without the 20 seconds delay.
If this fixes your problems, the real solution would be for Mitchell
to build a new lucid32 box with a resolv.conf that points to a public
DNS server.

HTH,

Jan-Jaap

Mitchell Hashimoto

unread,
Jun 17, 2011, 2:32:20 PM6/17/11
to vagra...@googlegroups.com
Jan-Jaap,

This certainly helps! Perhaps part of the postinstall process of building the boxes I should change the DNS to Google's (8.8.8.8), which should work for everyone. Good catch!

Best,
Mitchell
 

HTH,

Jan-Jaap

Rafael Chacon

unread,
Jun 18, 2011, 9:26:46 AM6/18/11
to Vagrant
I don't know if is the best approach. But I add to command to dhclient
to the /etc/rc.local and then every time that I restart the VM the
network is properly configured and I'm able to do ssh.

I noticed that dhclient it's not in /etc/init.d... maybe this is
causing the problem in the box.... It's the first time that I'm using
vagrant and virtualbox so I'm not quite sure if dhclient it's executed
elsewhere...

Greetings!

Rafael Chacon

unread,
Jun 18, 2011, 9:06:29 AM6/18/11
to Vagrant
Hello all,

I'm facing the same problem. But I'm not having problem with the DNS,
when the VM starts it seems that the network it's not configured. I
need to run dhclient and then I'm able to do ssh.

How I do force the execution of the dhclient in the Vagrantfile? So I
don't have to do it each time that I restart the VM.

Thanks in advanced.

On 17 juin, 20:32, Mitchell Hashimoto <mitchell.hashim...@gmail.com>
wrote:
> Jan-Jaap,
>
> On Fri, Jun 17, 2011 at 4:39 AM, janjaapdriessen
> <janjaapdries...@gmail.com>wrote:

Olivier Raginel

unread,
Jun 18, 2011, 6:03:45 PM6/18/11
to vagra...@googlegroups.com
On Sat, Jun 18, 2011 at 06:26:46AM -0700, Rafael Chacon wrote:
> I don't know if is the best approach. But I add to command to dhclient
> to the /etc/rc.local and then every time that I restart the VM the
> network is properly configured and I'm able to do ssh.
>
> I noticed that dhclient it's not in /etc/init.d... maybe this is
> causing the problem in the box.... It's the first time that I'm using
> vagrant and virtualbox so I'm not quite sure if dhclient it's executed
> elsewhere...

dhclient should be started by ifup when it brings the interface up, so
it should be set to auto and dhcp in /etc/network/interfaces. Something
along those lines:
auto eth0
iface eth0 inet dhcp

--
Babar.

Boris Gordon

unread,
Jun 21, 2011, 3:54:32 PM6/21/11
to vagra...@googlegroups.com
On a new machine the same combination of latest vagrant/virtualbox/lucid base boxes is working. Very strange.

Hedge Hog

unread,
Jun 30, 2011, 11:12:06 PM6/30/11
to vagra...@googlegroups.com
On Sat, Jun 18, 2011 at 11:06 PM, Rafael Chacon <rafael...@gmail.com> wrote:
> Hello all,
>
> I'm facing the same problem. But I'm not having problem with the DNS,
> when the VM starts it seems that the network it's not configured. I
> need to run dhclient and then I'm able to do ssh.
>

The ssh issue might be connected to a dns issue or maybe the network
setup is triggering some thing else that ssh doesn't like.

I've set out one diagnosed case in issue #391[0]

Could others please indicate if they see the same things.
Note the SSH symptom shown is the same for multiple hosts on with one
IP and multiple redirects to one port so it shouldn't matter if you
have use hostbased networking or port redirection in your VM.

Hopefully this narrows down what the source of this is.

HTH?

[0]: https://github.com/mitchellh/vagrant/issues/391

--
πόλλ' οἶδ ἀλώπηξ, ἀλλ' ἐχῖνος ἓν μέγα
[The fox knows many things, but the hedgehog knows one big thing.]
  Archilochus, Greek poet (c. 680 BC – c. 645 BC)
http://hedgehogshiatus.com

Hedge Hog

unread,
Jul 1, 2011, 12:48:47 AM7/1/11
to vagra...@googlegroups.com
On Fri, Jul 1, 2011 at 1:12 PM, Hedge Hog <hedgeho...@gmail.com> wrote:
> On Sat, Jun 18, 2011 at 11:06 PM, Rafael Chacon <rafael...@gmail.com> wrote:
>> Hello all,
>>
>> I'm facing the same problem. But I'm not having problem with the DNS,
>> when the VM starts it seems that the network it's not configured. I
>> need to run dhclient and then I'm able to do ssh.
>>
>
> The ssh issue might be connected to a dns issue or maybe the network
> setup is triggering some thing else that ssh doesn't like.
>
> I've set out one diagnosed case in issue #391[0]
>
> Could others please indicate if they see the same things.
> Note the SSH symptom shown is the same for multiple hosts on with one
> IP and multiple redirects to one port so it shouldn't matter if you
> have use hostbased networking or port redirection in your VM.
>
> Hopefully this narrows down what the source of this is.
>

OK I've been able to reproduce the following:

1) `vagrant up` then continuously query `lsof -i :2222`
2) As soon as you see lsof show _one_ established connection (TCP
localhost:44716->localhost:2222 (ESTABLISHED)) , issue `ssh
vag...@127.0.0.1 -p 2222 -i vagrant` and you will be connected.
3) `vagrant reload` and now lsof will show two connections to 2222,
and you won't be able to ssh to your VM. Period. You have to
`vagrant halt`, then repeat step 1)

HTH

Hedge Hog

unread,
Jul 1, 2011, 6:15:06 AM7/1/11
to vagra...@googlegroups.com
On Fri, Jul 1, 2011 at 2:48 PM, Hedge Hog <hedgeho...@gmail.com> wrote:
> On Fri, Jul 1, 2011 at 1:12 PM, Hedge Hog <hedgeho...@gmail.com> wrote:
>> On Sat, Jun 18, 2011 at 11:06 PM, Rafael Chacon <rafael...@gmail.com> wrote:
>>> Hello all,
>>>
>>> I'm facing the same problem. But I'm not having problem with the DNS,
>>> when the VM starts it seems that the network it's not configured. I
>>> need to run dhclient and then I'm able to do ssh.
>>>
>>
>> The ssh issue might be connected to a dns issue or maybe the network
>> setup is triggering some thing else that ssh doesn't like.
>>
>> I've set out one diagnosed case in issue #391[0]
>>
>> Could others please indicate if they see the same things.
>> Note the SSH symptom shown is the same for multiple hosts on with one
>> IP and multiple redirects to one port so it shouldn't matter if you
>> have use hostbased networking or port redirection in your VM.
>>
>> Hopefully this narrows down what the source of this is.
>>
>
> OK I've been able to reproduce the following:
>
> 1) `vagrant up` then continuously query `lsof -i :2222`
> 2) As soon as you see lsof show _one_ established connection (TCP
> localhost:44716->localhost:2222 (ESTABLISHED)) , issue `ssh
> vag...@127.0.0.1 -p 2222 -i vagrant` and you will be connected.
> 3) `vagrant reload` and now lsof will show two connections to 2222,
> and you won't be able to ssh to your VM.  Period.  You have to
> `vagrant halt`, then repeat step 1)

Hmm, this strategy also only succeeds intermittently.
Puzzled.

Hedge Hog

unread,
Jul 3, 2011, 3:35:22 AM7/3/11
to vagra...@googlegroups.com
On Wed, Jun 22, 2011 at 5:54 AM, Boris Gordon <em...@boris.com.au> wrote:
> On a new machine the same combination of latest vagrant/virtualbox/lucid
> base boxes is working. Very strange.
>

One more data point, on versions that do/don't work:

https://github.com/mitchellh/vagrant/issues/353#issuecomment-1326421

> On Sun, Jun 19, 2011 at 8:03 AM, Olivier Raginel <bab...@gmail.com> wrote:
>>
>> On Sat, Jun 18, 2011 at 06:26:46AM -0700, Rafael Chacon wrote:
>> > I don't know if is the best approach. But I add to command to dhclient
>> > to the /etc/rc.local and then every time that I restart the VM the
>> > network is properly configured and I'm able to do ssh.
>> >
>> > I noticed that dhclient it's not in /etc/init.d... maybe this is
>> > causing the problem in the box.... It's the first time that I'm using
>> > vagrant and virtualbox so I'm not quite sure if dhclient it's executed
>> > elsewhere...
>>
>> dhclient should be started by ifup when it brings the interface up, so
>> it should be set to auto and dhcp in /etc/network/interfaces. Something
>> along those lines:
>> auto eth0
>> iface eth0 inet dhcp
>>
>> --
>> Babar.
>
>

--

Mitchell Hashimoto

unread,
Jul 3, 2011, 2:42:29 PM7/3/11
to vagra...@googlegroups.com
Hedge,

Thanks for all your work on this. Hopefully this leads to a solution.

In the meantime, I've uploaded new lucid32/lucid64 boxes with routine upgrades. I also added `UseDNS no` to the sshd_config which should've been there from the beginning. This should also help some people access SSH more readily.

Best,
Mitchell

Hedge Hog

unread,
Jul 3, 2011, 8:10:01 PM7/3/11
to vagra...@googlegroups.com
On Mon, Jul 4, 2011 at 4:42 AM, Mitchell Hashimoto
<mitchell....@gmail.com> wrote:
> Hedge,
> Thanks for all your work on this. Hopefully this leads to a solution.

Pleasure, sorry if the tone sometimes seems on-edge. The more you see
the potential of something the more frustrating any hurdle is :)
And vagrant has the potential!
I'm beginning to think that what Oracle/Virtualbox (i.e. not the gem)
put out as patch version increment releases should probably be minor
version increment releases :(

Best wishes.

Mitchell Hashimoto

unread,
Jul 9, 2011, 8:26:00 PM7/9/11
to vagra...@googlegroups.com
Again, I've updated the boxes, and would appreciate any reports on the status of those.

Best,
Mitchell

Norbert Hartl

unread,
Jul 14, 2011, 5:44:18 AM7/14/11
to vagra...@googlegroups.com
Hi,

starting to use vagrant I just noticed the problem while doing the "getting started" :) I downloaded lucid64 yesterday and I have the same effect like it is described. Vagrant just hangs because the virtual machine has no ip address assigned. Logging in on the console and doing /etc/init.d/networking restart or killall dhclient3 && dhclient3 solves the problem meaning an ip address is assigned then.
The workaround with pre-up sleep 2 is present in my configuration but it doesn't help. From the task tracker entries I noticed one difference in my image. Someone propposed a fix by removing /etc/udev/rules.d/70-persistent-net.rules. In my case this is a directory and not a file. 
To other workaround works as well: vagrant up, vagrant halt --force, vagrant up

I downgraded virtualbox to 4.0.4 and the vagrant gem to 0.7.5. I'm not complete sure if any of those is necessary because dealing with the fact was confusing enough.

That's for now,

Norbert
Reply all
Reply to author
Forward
0 new messages