Hi all, I believe I've resolved the issue that I was having (similar to
this thread) and was hoping to get some feedback from someone. This thread
seemed to resolve my problem, but I wanted to try and really pinpoint the
error I saw. It seems pretty clear that a properly configured network is
essential to creating a reliable .box file (e.g. this wiki
page<https://github.com/mitchellh/vagrant/wiki/%60vagrant-up%60-hangs-at-%22Waiting-for-VM-to-boot.-This-can-take-a-few-minutes%22>).
Here's what I experienced:
VBoxManage version: 4.3.6r91406
Vagrant version: 1.4.3
CentOS version: 6.4 (Final)
When I run 'vagrant up', I get this output:
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] 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.
At this point, 'vagrant ssh' does not work, however, I can login to the VM
with the UI. When I login, I can see that eth0 and eth1 come up with the
same IP address (192.168.50.102), although different MAC addresses (eth0
has 08:00:27:60:FC:47 and eth1 08:00:27:67:F8:71) . Next, I took a look at
/etc/sysconfig/network-scripts/ .
Contents of ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
IPV6INIT="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="56f45b3e-..."
Contents of ifcfg-eth1
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.50.102
NETMASK=255.255.255.0
DEVICE=eth1
PEERDNS=no
#VAGRANT=END
I can resolve this one of 2 ways:
1) Simply running "sudo service network restart" from the UI. This
properly configures the network and from then on I'm able to run 'vagrant
halt', 'vagrant ssh', etc.
-or-
2) By fixing the network configuration re-packaging (so that anyone using
my .box file can run without issues). To achieve that, I basically
followed Alvaro's earlier
email<https://groups.google.com/d/msg/vagrant-up/GGtZSzHMLUQ/6B43VRZeYw0J>on
this thread, however I did a few things differently (in error). In any
case, I published a box file that I believe is configured properly by doing
the following :
1.
As root or with sudo :
1.
rm /etc/udev/rules.d/70-persistent-net.rules
2.
chkconfig NetworkManager off
3.
edit /etc/sysconfig/network-scripts/
1.
Edit ifcfg-eth0
1.
Remove UUID // per Alvaro, but now I'm thinking this wasn't
necessary
2.
Set NM_CONTROLLED="no"
2.
Edit ifcfg-eth1
1.
Set NM_CONTROLLED="no" // Used the form with double quotes.
Does this matter?
2.
Then, shutdown the VM cleanly and run “vagrant package” to create the
.box file.
In Alvaro's email, the instructions say to just remove the eth1 config file
and let Vagrant create it. Is that the correct solution, I didn’t follow
that as I was concerned Vagrant would not create the ifcfg-eth1 file with
NM_CONTROLLED="no". However, one would think that running "sudo chkconfig
NetworkManager off" would mean NM_CONTROLLED is ignored, right?
I appreciate any feedback and thanks in advance!
On Friday, February 14, 2014 5:26:14 AM UTC-5, Peter Halliday wrote:
>
> and then restarted the firewall and it still works - even after reboot
>
> I did notice that before I restarted the firewall, iptables -L did not
> list ssh and actually listed mdns or something
> It's fixed now and iptables -L lists:
>
> ACCEPT tcp -- anywhere anywhere state NEW
> tcp dpt:ssh
>
> I restored from the snapshot i took before i started messing with stuff
> and iptables -L in the broken configuration lists
>
> ACCEPT udp -- anywhere 224.0.0.251 state NEW
> udp dpt:mdns
>
> I then just ran
>
> system-config-firewall
>
> and performed the following sequence to fix the iptables config
>
> disable
> apply
> enable
> apply
>
> I'm going to leave it at that and rebuild my base box :)
>
>
> On Friday, 14 February 2014 11:16:40 UTC+1, Peter Halliday wrote:
>>
>> correction i just got it to work by disabling the firewall :s
>>
>> On Friday, 14 February 2014 10:53:06 UTC+1, Peter Halliday wrote:
>>>
>>> fedora 17 - I have also tried
>>>
>>> systemctl disable NetworkManager.service
>>>
>>> instead of chkconfig
>>>
>>> but it doesn't make a difference.
>>>
>>> This doesn't seem to be a vagrant problem - I noticed that the original
>>> VM won't accept connections either.
>>>
>>> I manually added a a forwarded port from 2222 to 22 and then tried
>>>
>>> ssh localhost -p 2222
>>>
>>> but it just hangs
>>>
>>> I verified that sshd is running and can connect from inside the VM to
>>> itself with ssh
>>> I also checked the firewall which is on but allowing ssh on port 22 (I
>>> also tried disabling the firewall just to be sure)
>>>
>>> Also whereas earlier i did get it to respond after messing with the
>>> network settings in virtual box, I can no longer reproduce that either :s
>>>
>>> On Friday, 14 February 2014 02:09:57 UTC+1, Alvaro Miranda Aguilera
>>> wrote:
>>>>
>>>>
>>>> On Fri, Feb 14, 2014 at 12:03 PM, Peter Halliday <[email protected]>wrote:
>>>>
>>>>> p2p1
>>>>
>>>>
>>>>
>>>> hey, that could be the reason..
>>>>
>>>> what version of fedora are you using?
>>>>
>>>>
>>>>
>>>>
>>>>
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.