Hanging at Configuring and enabling network interfaces...

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Hanging at Configuring and enabling network interfaces...

Just Anidiot
I'm trying to start a virtualbox guest linux system with two network interfaces, one a NAT and the other a host-only with a static IP.  The golden master the box comes from already has this in place (except for the desired IP address).

If I don't define any networks in the Vagrantfile, it gets only one interface (NAT). 

I then tried to define both, but it appears the NAT one is created automatically by vagrant.

I then reduced the configuration down to

config.vm.box = "RHEL6_x86_64"
config.vm.network :private_network, ip: "192.168.56.30"

However that hangs at:
Configuring and enabling network interfaces...

Google turned up some mention of specifying :adapter that isn't in the documentation, so I changed the to
 config.vm.network :private_network, ip: "192.168.56.30", :adapter => 1

But that was unable to figure out when the box had finished booting up.  Then it occurred to me that maybe the adapter number was off so I changed it to adapter 2

It got a little further:
Configuring and enabling network interfaces...

but it hangs there now.

I am unable to "vagrant ssh" or ssh -p 2222 localhost.  It doesn't seem that eth1 gets an IP address.

Looking through the debug log  I think the relevant section is below

DEBUG guest: Trying: redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /etc/redhat-release (sudo=false)
DEBUG ssh: stdout: Red Hat Enterprise Linux Server release 6.4 (Santiago)

DEBUG ssh: Exit status: 0
 INFO guest: Detected: redhat!
 INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x007f0cb0811be0>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007f0cb08d90f0>]]
 INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
 INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-3626-31pu98 to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR    : [ipv6_test_device_status] Missing parameter 'device' (arg 1)

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: Device eth1 does not seem to be present, delaying initialization.

DEBUG ssh: Exit status: 1
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1 2> /dev/null>
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...


It continues the keep-alive until I destory the box.
According to the Virtualbox GUI, there are two network adapters. However as I said above I am unable to ssh to the box. 

What might I be doing wrong?

Thanks in advance.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Hanging at Configuring and enabling network interfaces...

Just Anidiot
On Tuesday, May 28, 2013 12:25:09 PM UTC-4, Just Anidiot wrote:
I'm trying to start a virtualbox guest linux system with two network interfaces, one a NAT and the other a host-only with a static IP.  The golden master the box comes from already has this in place (except for the desired IP address).


So I think I'm running into this  https://bugzilla.redhat.com/show_bug.cgi?id=192084 so-called notabug bug.  Google turned up info that lots of people do the following before they export their .box file:

rm /etc/udev/rules.d/70-persistent-net.rules
mkdir /etc/udev/rules.d/70-persistent-net.rules
rm /lib/udev/rules.d/75-persistent-net-generator.rules
rm -rf /dev/.udev/
sed -i "/^HWADDR/d" /etc/sysconfig/network-scripts/ifcfg-Auth_eth0

I've done that, re-exported my box, rm it from vagrant and re-imported it.  Then vagrant up.

with the following stuff in the Vagrantfile

  config.vm.box = "RHEL6_x86_64"
  config.vm.network :private_network, ip: "192.168.56.3", :adapter => 2
  config.vm.provider "virtualbox" do |v|
    v.gui = true
  end

This brings up a box that has the NAT on eth0 and on eth1 it gets 192.168.56.x where x is obviously from dhcp instead of the assigned value.
On the guest I can do the following:

$> /sbin/ifdown eth1
Device state: 3 (disconnected)
$> /sbin/ifup eth1
Active connection state: activated
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/2

However that sets eth0 to 192.168.56.3 and because it is on the wrong adapter I can no longer ssh to the box (or even vagrant ssh).

Is there a way to fix this?

Oh and here's the relevant section of the debug log:

 INFO guest: Detected: redhat!
 INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x00000002029e58>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007fe0c079a998>]]
 INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
 INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-24693-s6c4um to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR    : [ipv6_test_device_status] Missing parameter 'device' (arg 1)

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-network-entry_1 (sudo=true)
DEBUG ssh: Exit status: 0


Thanks in advance.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Hanging at Configuring and enabling network interfaces...

Just Anidiot
In reply to this post by Just Anidiot
I'm thinking at this point the only solution is to figure out the HWADDR of each adapter, add that to the files in /etc/sysconfig/network-scripts and do a "service NetworkManager restart" that should fix the eth0 and eth1 mixup (I haven't tested it yet) but I don't know if vagrant will stay connected when the network restarts.  It's late so I'll try this tomorrow.

On Tuesday, May 28, 2013 12:25:09 PM UTC-4, Just Anidiot wrote:
I'm trying to start a virtualbox guest linux system with two network interfaces, one a NAT and the other a host-only with a static IP.  The golden master the box comes from already has this in place (except for the desired IP address).

If I don't define any networks in the Vagrantfile, it gets only one interface (NAT). 

I then tried to define both, but it appears the NAT one is created automatically by vagrant.

I then reduced the configuration down to

config.vm.box = "RHEL6_x86_64"
config.vm.network :private_network, ip: "192.168.56.30"

However that hangs at:
Configuring and enabling network interfaces...

Google turned up some mention of specifying :adapter that isn't in the documentation, so I changed the to
 config.vm.network :private_network, ip: "192.168.56.30", :adapter => 1

But that was unable to figure out when the box had finished booting up.  Then it occurred to me that maybe the adapter number was off so I changed it to adapter 2

It got a little further:
Configuring and enabling network interfaces...

but it hangs there now.

I am unable to "vagrant ssh" or ssh -p 2222 localhost.  It doesn't seem that eth1 gets an IP address.

Looking through the debug log  I think the relevant section is below

DEBUG guest: Trying: redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /etc/redhat-release (sudo=false)
DEBUG ssh: stdout: Red Hat Enterprise Linux Server release 6.4 (Santiago)

DEBUG ssh: Exit status: 0
 INFO guest: Detected: redhat!
 INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x007f0cb0811be0>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007f0cb08d90f0>]]
 INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
 INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-3626-31pu98 to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR    : [ipv6_test_device_status] Missing parameter 'device' (arg 1)

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: Device eth1 does not seem to be present, delaying initialization.

DEBUG ssh: Exit status: 1
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1 2> /dev/null>
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...


It continues the keep-alive until I destory the box.
According to the Virtualbox GUI, there are two network adapters. However as I said above I am unable to ssh to the box. 

What might I be doing wrong?

Thanks in advance.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Hanging at Configuring and enabling network interfaces...

Just Anidiot


On Tuesday, May 28, 2013 10:52:30 PM UTC-4, Just Anidiot wrote:
I'm thinking at this point the only solution is to figure out the HWADDR of each adapter, add that to the files in /etc/sysconfig/network-scripts and do a "service NetworkManager restart" that should fix the eth0 and eth1 mixup (I haven't tested it yet) but I don't know if vagrant will stay connected when the network restarts.  It's late so I'll try this tomorrow.


So I wrote a script and I've added to the vagrantfile
 config.vm.provision :shell,  :inline => "sudo /vagrant/fix_network.pl"

However vagrant up dies:

[default] Running provisioner: shell...
[default] Running: inline script
sudo
:
sorry, you must have a tty to run sudo

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

The vagrant user is in the sudoers file and for it requiretty has been turned off. 
If I do
vagrant ssh -- sudo /vagrant/fix_network.pl
it works just fine.  So therefore it looks like to me vagrant up is using some other user to sudo or something else is horribly wrong.

Can someone please help?

 
On Tuesday, May 28, 2013 12:25:09 PM UTC-4, Just Anidiot wrote:
I'm trying to start a virtualbox guest linux system with two network interfaces, one a NAT and the other a host-only with a static IP.  The golden master the box comes from already has this in place (except for the desired IP address).

If I don't define any networks in the Vagrantfile, it gets only one interface (NAT). 

I then tried to define both, but it appears the NAT one is created automatically by vagrant.

I then reduced the configuration down to

config.vm.box = "RHEL6_x86_64"
config.vm.network :private_network, ip: "192.168.56.30"

However that hangs at:
Configuring and enabling network interfaces...

Google turned up some mention of specifying :adapter that isn't in the documentation, so I changed the to
 config.vm.network :private_network, ip: "192.168.56.30", :adapter => 1

But that was unable to figure out when the box had finished booting up.  Then it occurred to me that maybe the adapter number was off so I changed it to adapter 2

It got a little further:
Configuring and enabling network interfaces...

but it hangs there now.

I am unable to "vagrant ssh" or ssh -p 2222 localhost.  It doesn't seem that eth1 gets an IP address.

Looking through the debug log  I think the relevant section is below

DEBUG guest: Trying: redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /etc/redhat-release (sudo=false)
DEBUG ssh: stdout: Red Hat Enterprise Linux Server release 6.4 (Santiago)

DEBUG ssh: Exit status: 0
 INFO guest: Detected: redhat!
 INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x007f0cb0811be0>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007f0cb08d90f0>]]
 INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
 INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-3626-31pu98 to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR    : [ipv6_test_device_status] Missing parameter 'device' (arg 1)

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: Device eth1 does not seem to be present, delaying initialization.

DEBUG ssh: Exit status: 1
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1 2> /dev/null>
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...


It continues the keep-alive until I destory the box.
According to the Virtualbox GUI, there are two network adapters. However as I said above I am unable to ssh to the box. 

What might I be doing wrong?

Thanks in advance.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Hanging at Configuring and enabling network interfaces...

Adam Fields


On May 29, 2013, at 10:32 PM, Just Anidiot <[hidden email]> wrote:



On Tuesday, May 28, 2013 10:52:30 PM UTC-4, Just Anidiot wrote:
I'm thinking at this point the only solution is to figure out the HWADDR of each adapter, add that to the files in /etc/sysconfig/network-scripts and do a "service NetworkManager restart" that should fix the eth0 and eth1 mixup (I haven't tested it yet) but I don't know if vagrant will stay connected when the network restarts.  It's late so I'll try this tomorrow.


So I wrote a script and I've added to the vagrantfile
 config.vm.provision :shell,  :inline => "sudo /vagrant/fix_network.pl"


The shell provisioner already runs as root, so you can just omit the sudo.

However vagrant up dies:

[default] Running provisioner: shell...
[default] Running: inline script
sudo
:
sorry, you must have a tty to run sudo

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

chmod +x /tmp/vagrant-shell && /tmp/vagrant-shell

The vagrant user is in the sudoers file and for it requiretty has been turned off. 
If I do
vagrant ssh -- sudo /vagrant/fix_network.pl
it works just fine.  So therefore it looks like to me vagrant up is using some other user to sudo or something else is horribly wrong.

Can someone please help?

 
On Tuesday, May 28, 2013 12:25:09 PM UTC-4, Just Anidiot wrote:
I'm trying to start a virtualbox guest linux system with two network interfaces, one a NAT and the other a host-only with a static IP.  The golden master the box comes from already has this in place (except for the desired IP address).

If I don't define any networks in the Vagrantfile, it gets only one interface (NAT). 

I then tried to define both, but it appears the NAT one is created automatically by vagrant.

I then reduced the configuration down to

config.vm.box = "RHEL6_x86_64"
config.vm.network :private_network, ip: "192.168.56.30"

However that hangs at:
Configuring and enabling network interfaces...

Google turned up some mention of specifying :adapter that isn't in the documentation, so I changed the to
 config.vm.network :private_network, ip: "192.168.56.30", :adapter => 1

But that was unable to figure out when the box had finished booting up.  Then it occurred to me that maybe the adapter number was off so I changed it to adapter 2

It got a little further:
Configuring and enabling network interfaces...

but it hangs there now.

I am unable to "vagrant ssh" or ssh -p 2222 localhost.  It doesn't seem that eth1 gets an IP address.

Looking through the debug log  I think the relevant section is below

DEBUG guest: Trying: redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /etc/redhat-release (sudo=false)
DEBUG ssh: stdout: Red Hat Enterprise Linux Server release 6.4 (Santiago)

DEBUG ssh: Exit status: 0
 INFO guest: Detected: redhat!
 INFO guest: Full guest chain: [[:redhat, #<VagrantPlugins::GuestRedHat::Guest:0x007f0cb0811be0>], [:linux, #<VagrantPlugins::GuestLinux::Guest:0x007f0cb08d90f0>]]
 INFO guest: Execute capability: configure_networks (redhat)
DEBUG guest: Searching for cap: configure_networks
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: configure_networks in redhat
DEBUG ssh: Checking whether SSH is ready...
DEBUG ssh: Re-using SSH connection.
 INFO ssh: SSH is ready!
 INFO guest: Execute capability: network_scripts_dir (redhat)
DEBUG guest: Searching for cap: network_scripts_dir
DEBUG guest: Checking in: redhat
DEBUG guest: Found cap: network_scripts_dir in redhat
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: touch /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/sysconfig/network-scripts/ifcfg-eth1 > /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-ifcfg-eth1 > /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: rm /tmp/vagrant-ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Uploading: /tmp/vagrant20130528-3626-31pu98 to /tmp/vagrant-network-entry_1
DEBUG ssh: Re-using SSH connection.
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: ERROR    : [ipv6_test_device_status] Missing parameter 'device' (arg 1)

DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: stdout: Device eth1 does not seem to be present, delaying initialization.

DEBUG ssh: Exit status: 1
 INFO retryable: Retryable exception raised: #<Vagrant::Errors::VagrantError: The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/sbin/ifup eth1 2> /dev/null>
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifdown eth1 2> /dev/null (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: cat /tmp/vagrant-network-entry_1 >> /etc/sysconfig/network-scripts/ifcfg-eth1 (sudo=true)
DEBUG ssh: Exit status: 0
DEBUG ssh: Re-using SSH connection.
 INFO ssh: Execute: /sbin/ifup eth1 2> /dev/null (sudo=true)
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...
DEBUG ssh: Sending SSH keep-alive...


It continues the keep-alive until I destory the box.
According to the Virtualbox GUI, there are two network adapters. However as I said above I am unable to ssh to the box. 

What might I be doing wrong?

Thanks in advance.

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Hanging at Configuring and enabling network interfaces...

edkb
This post has NOT been accepted by the mailing list yet.
Hmm. Bit old'er but not sure if you've figured it out yet. Device eth1 does not seem to be present, delaying initialization. Looks like your NIC's may be getting shuffled around and this is a generic error, not not 100% convinced it's fully related to the other error. Try this old post for an in depth investigation including a look into the proc ans sys filesystems where they're defined. Device eth1 does not seem to be present, delaying initialization. Regards,