Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

/sbin/ip does not exist #300

Closed
atykhonov opened this issue Jun 13, 2014 · 5 comments
Closed

/sbin/ip does not exist #300

atykhonov opened this issue Jun 13, 2014 · 5 comments

Comments

@atykhonov
Copy link

Hi!

I just recently got a chance to try vagrant-lxc.

$ cat Vagrantfile
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"
  config.vm.box_url = "http://bit.ly/vagrant-lxc-precise64-2013-10-23"
    config.vm.provider :lxc do |lxc|
    lxc.customize 'network.type', 'veth'
    lxc.customize 'network.hwaddr', '00:14:2e:6e:10:ac'
    lxc.customize 'network.flags', 'up'
    lxc.customize 'network.link', 'br0'
  end
end
$ vagrant --version
Vagrant 1.3.5
# uname -a
Linux demi 3.12.13-gentoo #2 SMP Thu Apr 24 13:04:29 EEST 2014 x86_64 Intel(R) Core(TM) i5-2540M CPU @ 2.60GHz GenuineIntel GNU/Linux

Gentoo Linux is on board.

vagrant init precise64 http://bit.ly/vagrant-lxc-precise64-2013-10-23
vagrant up --provider=lxc

I get the error:

DEBUG subprocess: stderr: lxc-attach: No such file or directory - failed to exec '/sbin/ip'
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 32000
DEBUG subprocess: Exit status: 255
 INFO retryable: Retryable exception raised: #<Vagrant::LXC::Errors::ExecuteError: There was an error executing ["sudo", "lxc-attach", "--name", "qlxc_default_1402618705115_81388", "--namespaces", "NETWORK", "--", "/sbin/ip", "-4", "addr", "show", "scope", "global", "eth0"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.>
 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-attach", "--name", "qlxc_default_1402618705115_81388", "--namespaces", "NETWORK", "--", "/sbin/ip", "-4", "addr", "show", "scope", "global", "eth0"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: lxc-attach: No such file or directory - failed to exec '/sbin/ip'
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 255
 INFO retryable: Retryable exception raised: #<Vagrant::LXC::Errors::ExecuteError: There was an error executing ["sudo", "lxc-attach", "--name", "qlxc_default_1402618705115_81388", "--namespaces", "NETWORK", "--", "/sbin/ip", "-4", "addr", "show", "scope", "global", "eth0"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.>
 INFO subprocess: Starting process: ["/usr/bin/sudo", "lxc-attach", "--name", "qlxc_default_1402618705115_81388", "--namespaces", "NETWORK", "--", "/sbin/ip", "-4", "addr", "show", "scope", "global", "eth0"]
DEBUG subprocess: Selecting on IO
DEBUG subprocess: stderr: lxc-attach: No such file or directory - failed to exec '/sbin/ip'
DEBUG subprocess: Waiting for process to exit. Remaining to timeout: 31999
DEBUG subprocess: Exit status: 255
 INFO retryable: Retryable exception raised: #<Vagrant::LXC::Errors::ExecuteError: There was an error executing ["sudo", "lxc-attach", "--name", "qlxc_default_1402618705115_81388", "--namespaces", "NETWORK", "--", "/sbin/ip", "-4", "addr", "show", "scope", "global", "eth0"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.>

I fixed that on my PC by means of: ln -s /bin/ip /sbin/ip

@fgrehm
Copy link
Owner

fgrehm commented Jun 13, 2014

@atykhonov Did it work? Weird that you had to symlink that, lxc-attach should have used /sbin/ip inside the container, not on your host machine oO

@atykhonov
Copy link
Author

@fgrehm yes, it did work.

lxc-attach should have used /sbin/ip inside the container

I understand in the same way, but yes something is strange...

@fpletz
Copy link
Contributor

fpletz commented Jun 13, 2014

lxc-attach should have used /sbin/ip inside the container

lxc-attach is called with --namespaces NETWORK, so only the network namespace is applied to the process. I think by adding MOUNT the /sbin/ip from the container should be used.

@fgrehm
Copy link
Owner

fgrehm commented Jun 23, 2014

😲 😲 😲 😲 😲

@fpletz you are right! that code has been around since the projects early days and I never noticed that it was an issue. I'll fix this on the next alpha. Thanks for the heads up!

@fgrehm fgrehm added this to the v1.0.0 milestone Jul 22, 2014
@fgrehm fgrehm closed this as completed in 752fa9b Jul 25, 2014
fgrehm added a commit that referenced this issue Jul 25, 2014
@fgrehm
Copy link
Owner

fgrehm commented Jul 25, 2014

This was fixed on master, expect a new release by next week at most.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants