Question

I'm trying to use LXC to run test-kitchen. When I use following .kitchen.yml

driver:
  name: vagrant

provisioner:
  name: chef_solo
platforms:
   - name: ubuntu-12.04
     driver:
       box: precise-lxc
       provider: lxc

kitchen-converge fails with following output:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider=lxc ----
STDOUT: 
STDERR: The `lxc` package does not seem to be installed or is not accessible on the PATH.
---- End output of vagrant up --no-provision --provider=lxc ----
Ran vagrant up --no-provision --provider=lxc returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

I can successfully run sudo which lxc-create, I have changed my user to 'NOPASSWD' in /etc/sudoers. If I run vagrant up in .kitchen/kitchen-vagrant/default-ubuntu-1204 VM starts normally, I can vagrant ssh into it and can see it running with lxc-ls on host system.

I have tried to dive into vagrant-lxc code and commented out temporarily ensure_lxc_installed! call in lib/vagrant-lxc/provider.rb. kitchen converge failed with following message:

-----> Starting Kitchen (v1.2.1)
-----> Creating <default-ubuntu-1204>...
   Bringing machine 'default' up with 'lxc' provider...
   ==> default: HandleBoxUrl middleware is deprecated. Use HandleBox instead.
   ==> default: This is a bug with the provider. Please contact the creator       
   ==> default: of the provider you use to fix this.
   ==> default: Importing base box 'precise-lxc'...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #create action: [Expected process to exit with [0], but received '1'
---- Begin output of vagrant up --no-provision --provider=lxc ----
STDOUT: Bringing machine 'default' up with 'lxc' provider...
==> default: HandleBoxUrl middleware is deprecated. Use HandleBox instead.
==> default: This is a bug with the provider. Please contact the creator
==> default: of the provider you use to fix this.
==> default: Importing base box 'precise-lxc'...
STDERR: There was an error executing ["sudo", "rm", "/usr/share/lxc/templates/lxc-vagrant-tmp-default-ubuntu-1204_default_1399314523513_48531"]

For more information on the failure, enable detailed logging by setting
the environment variable VAGRANT_LOG to DEBUG.
---- End output of vagrant up --no-provision --provider=lxc ----
Ran vagrant up --no-provision --provider=lxc returned 1]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Environment:

  • Linux Mint 16, kernel 3.11.0-20
  • vagrant 1.5.4
  • vagrant-lxc 0.8
  • test-kitchen 1.2.1
  • lxc 1.0.0~alpha1-0ubuntu14.1
  • sudo 1.8.6p3-0ubuntu3.1

Output of kitchen diagnose --all https://gist.github.com/AlexeyDemidov/11544964

Was it helpful?

Solution

I have replaced sudo_wrapper call to 'which lxc-create' in plugin source with simple puts sudo which lxc-create and got output telling me that sudo requires tty. Commenting out line 'Defaults requiretty' in /etc/sudoers solved this problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top