fgrehm/vagrant-lxc

/sbin/ip does not exist

Closed this issue · 5 comments

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

@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

@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...

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.

😲 😲 😲 😲 😲

@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!

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