Running Vagrant inside a virtual machine with CentOS 6.6, but it failed to ssh to guest machine

434 views
Skip to first unread message

zhz shi

unread,
Jun 26, 2015, 12:34:03 AM6/26/15
to vagra...@googlegroups.com
Hi All,

I have a virtual machine running CentOS 6.6 and I installed vagrant 1.7.2 and VirtualBox 4.3 on it. I'm trying to use vagrant to run guest machine with ubuntu or some other OS, but during the 'vagrant up' phase, vagrant always failed to ssh to the guest machine. 

Logs I got is:

$ vagrant up                                                                                                                                                                                                                                                            [2/47]
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: vagrant-base_default_1435292165676_93887
==> 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: 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: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
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.


If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

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.

-------------------

Seems the guest machine is running:
$ vagrant status
Current machine states:

default                   running (virtualbox)

-----------

Does anybody here have any idea what's the problem is? 

Thanks a lot for any help.

BR, zhz

Alvaro Miranda Aguilera

unread,
Jun 29, 2015, 1:17:05 AM6/29/15
to vagra...@googlegroups.com
hello

Can you confirm the following:

Host OS and bit (like 32/64)
Guest VM OS and bit (like 32/64)

if you are trying this

Host + Virtualbox => VM + Virtualbox => new VM

I am afraid that won't work on the last part if 64 bits since 64 bits
need hardware assisted virtualization that is not available on nested
virtualization

you may have some luck with virtualbox 32 bit + guest 32 bit but I can
tell you will work for sure, you need to test.

Having said that, why you need virtualbox inside a VM?

if you can explain, I will be more than happy to give you ideas how to
attack that problem

Thanks
alvaro
> --
> 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 vagrant-up+...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/vagrant-up/3d57f5fd-5627-4635-a6f5-a33952dac591%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Ulaga nathan

unread,
Aug 20, 2015, 2:59:57 AM8/20/15
to Vagrant
I am trying this setup just to mimic a enviroment.. i knew its complex but please let me know does it work ?
 
Hi,
I am getting trouble with this setup.i have a ubuntu14.04 Vagrant-VM running on my windows8 machine... i have packaged it as a vagrant BOX. now in the Vagrant-VM i am running test kitchen/vagrant/virtualbox combination.. There by using test kitchen am trying to spin up a new VM using the existing BOX in the BOX_URL defined in kithen.yml. I also passed network paramters in kithchen.yml.. Now kitchen create command causing action failed error by throwing waiting for ssh service 127.0.0.1 on port 2222..

Question :

1) Why testkitchen is not using my ip address defined in kitchen.yml and going with 127.0.0.1 and port 2222 which are part of the existing BOX. how to pass new network parameter for sandbox created by test kitchen??

dragon788

unread,
Aug 20, 2015, 10:59:31 AM8/20/15
to Vagrant
Ulaga, I'm afraid it will work, but the only way I've gotten it to work is using Vagrant + VMware Workstation and the paid Vagrant/VMware plugin. Virtualbox does NOT support nesting very well.

pixel fairy

unread,
Aug 20, 2015, 6:00:01 PM8/20/15
to Vagrant
If your host is linux, you can also use the libvirt plugin, which does enable nesting. for some reason, virtualbox 5 on linux does not enable nesting even though it uses kvm.
Reply all
Reply to author
Forward
0 new messages