0

I am trying to setup my test-kitchen setup with lxc. Lxc is working fine on my machine and i have tested it. When i try to do kitchen create i am getting following error.

-----> Starting Kitchen (v1.6.0)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ClientError
>>>>>> Message: Could not load the 'lxc' driver from the load path. Please ensure that your driver is installed as a gem or included in your Gemfile if using Bundler.
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

My .kitche.yml file is

---
driver:
  name: lxc

provisioner:
  name: chef_zero

platforms:
  - name: test-container
    driver_config:
      username: ubuntu
      password: ubuntu

suites:
  - name: default
    run_list:
    attributes:

This is what i did to setup things.

  1. Install chefdk.
  2. Go to a dir and run kitchen init --driver=kitchen-lxc --create-gemfile
  3. Run kitchen create

Also my test-container lxc was present at this point of time.

==> I have also run chef gem install kitchen-lxc as mentioned in one of answers.

I have no idea why this error is coming. Any pointer in right direction will be very helpful.

shivams
  • 2,597
  • 6
  • 25
  • 47

1 Answers1

4

You need to install the kitchen-lxc driver library. If you've install this all via ChefDK (which you should): chef gem install kitchen-lxc.

That said, I'm not sure how up-to-date the kitchen-lxc driver is. You might want to check out kitchen-docker instead.

coderanger
  • 52,400
  • 4
  • 52
  • 75
  • I have install kitchen-lxc and still getting same error. – shivams Mar 31 '16 at 22:50
  • Make sure you install it into the same Ruby environment that `kitchen` is using. Unfortunately debugging this via comments is probably impractical. The easiest solution is to make sure you're using the version installed via ChefDK and remove any other copies of test kitchen. – coderanger Mar 31 '16 at 22:59
  • I am testing this on a newly installed machine. It has only chefdk installed apart from basic system utilities. – shivams Mar 31 '16 at 23:02
  • How did you install `kitchen-lxc`? – coderanger Mar 31 '16 at 23:08
  • as coderanger said, make sure you install lxc driver using `chef gem install kitchen-lxc` – mr.buttons Apr 01 '16 at 04:41
  • @coderanger I have edited my question. Please check. – shivams Apr 01 '16 at 06:10
  • You probably don't mean to be using a Gemfile or interacting with Bundler at all. Please remove the Gemfile and try again. – coderanger Apr 01 '16 at 12:16
  • It is still failing. Also do i need to provide some image path or something like that. I have seen on internet that box_url is given. Do i also need to provide something like that in lxc? – shivams Apr 01 '16 at 20:00