Kitchen test how to use local vm.box












5















Every time I run



kitchen test


it downloads a new vm box. Is there a way to make it re-use a locally downloaded box?



Here is my .kitchen.yml file.



---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true

platforms:
- name: ubuntu-12.04

suites:
- name: default
run_list:
- recipe[my-rails-server::default]
attributes:


Terminal output:



Downloading Chef  for ubuntu...       
downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&p=ubuntu&pv=12.04&m=x86_64
to file /tmp/install.sh.1121/metadata.txt
trying wget...
url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
md5 21524287ed5631eb1c092ba7b589e968
sha256 7a0a898b3682462620de80230c7a73730dde7131ca069e1d926f6faf07e4fa2f
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
to file /tmp/install.sh.1121/chef_11.10.0-1.ubuntu.12.04_amd64.deb
trying wget...
Checksum compare with sha256sum succeeded.
Installing Chef









share|improve this question

























  • platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

    – HamTheAstroChimp
    Dec 4 '15 at 14:44


















5















Every time I run



kitchen test


it downloads a new vm box. Is there a way to make it re-use a locally downloaded box?



Here is my .kitchen.yml file.



---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true

platforms:
- name: ubuntu-12.04

suites:
- name: default
run_list:
- recipe[my-rails-server::default]
attributes:


Terminal output:



Downloading Chef  for ubuntu...       
downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&p=ubuntu&pv=12.04&m=x86_64
to file /tmp/install.sh.1121/metadata.txt
trying wget...
url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
md5 21524287ed5631eb1c092ba7b589e968
sha256 7a0a898b3682462620de80230c7a73730dde7131ca069e1d926f6faf07e4fa2f
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
to file /tmp/install.sh.1121/chef_11.10.0-1.ubuntu.12.04_amd64.deb
trying wget...
Checksum compare with sha256sum succeeded.
Installing Chef









share|improve this question

























  • platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

    – HamTheAstroChimp
    Dec 4 '15 at 14:44
















5












5








5


1






Every time I run



kitchen test


it downloads a new vm box. Is there a way to make it re-use a locally downloaded box?



Here is my .kitchen.yml file.



---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true

platforms:
- name: ubuntu-12.04

suites:
- name: default
run_list:
- recipe[my-rails-server::default]
attributes:


Terminal output:



Downloading Chef  for ubuntu...       
downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&p=ubuntu&pv=12.04&m=x86_64
to file /tmp/install.sh.1121/metadata.txt
trying wget...
url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
md5 21524287ed5631eb1c092ba7b589e968
sha256 7a0a898b3682462620de80230c7a73730dde7131ca069e1d926f6faf07e4fa2f
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
to file /tmp/install.sh.1121/chef_11.10.0-1.ubuntu.12.04_amd64.deb
trying wget...
Checksum compare with sha256sum succeeded.
Installing Chef









share|improve this question
















Every time I run



kitchen test


it downloads a new vm box. Is there a way to make it re-use a locally downloaded box?



Here is my .kitchen.yml file.



---
driver_plugin: vagrant
driver_config:
require_chef_omnibus: true

platforms:
- name: ubuntu-12.04

suites:
- name: default
run_list:
- recipe[my-rails-server::default]
attributes:


Terminal output:



Downloading Chef  for ubuntu...       
downloading https://www.opscode.com/chef/metadata?v=&prerelease=false&p=ubuntu&pv=12.04&m=x86_64
to file /tmp/install.sh.1121/metadata.txt
trying wget...
url https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
md5 21524287ed5631eb1c092ba7b589e968
sha256 7a0a898b3682462620de80230c7a73730dde7131ca069e1d926f6faf07e4fa2f
downloaded metadata file looks valid...
downloading https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/12.04/x86_64/chef_11.10.0-1.ubuntu.12.04_amd64.deb
to file /tmp/install.sh.1121/chef_11.10.0-1.ubuntu.12.04_amd64.deb
trying wget...
Checksum compare with sha256sum succeeded.
Installing Chef






chef test-kitchen






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 12 '14 at 2:17







markhorrocks

















asked Feb 11 '14 at 9:11









markhorrocksmarkhorrocks

50083380




50083380













  • platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

    – HamTheAstroChimp
    Dec 4 '15 at 14:44





















  • platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

    – HamTheAstroChimp
    Dec 4 '15 at 14:44



















platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

– HamTheAstroChimp
Dec 4 '15 at 14:44







platforms: - name: ubuntu-12.04 driver: box: ubuntu-12.04 box_url: file:///home/user/doenloads/ubuntu-12.04.box

– HamTheAstroChimp
Dec 4 '15 at 14:44














4 Answers
4






active

oldest

votes


















2














If by "downloads a new VM box", you mean destroys and creates one, yes, that's what kitchen test does. If you want to persist the instance, just run



kitchen converge


If you mean that Vagrant is downloading a new box from the Internet, then that's likely a bug in Vagrant.






share|improve this answer
























  • Yes, Vagrant downloads a new box every time I run kitchen test.

    – markhorrocks
    Feb 11 '14 at 22:16











  • Can you update your question with the output?

    – sethvargo
    Feb 11 '14 at 22:40











  • Q updated with terminal output.

    – markhorrocks
    Feb 12 '14 at 2:17






  • 2





    That's downloading Chef, not the Ubuntu box

    – sethvargo
    Feb 12 '14 at 2:55











  • ok, thanks. it takes ages on my slow connection.

    – markhorrocks
    Feb 12 '14 at 5:51





















11














Test Kitchen creates its own Vagrantfile, based on .kitchen.yml config.



Therefore you have to specify your box (which should be already available for Vagrant, check vagrant box list) in .kitchen.yml. In your example it would be:



platforms:
- name: ubuntu-12.04
driver:
box: centos-6.5-x86_64-minimal


And kitchen will use box available for Vagrant, without downloading it.



You can also specify other Vagrant options, e.g.



- name: centos-vagrant
driver:
provider: parallels
box: centos-6.5-x86_64-minimal
customize:
memsize: 1024
cpus: 2


You can see more examples eg. in my Vagrant cookbooks lemp-server or or Opscode's yum.






share|improve this answer
























  • Thanks marcin-r it was the driver/box line that I was missing

    – jaygooby
    Feb 26 '14 at 10:49













  • The OP updated the original question, but that's what I was looking for. Thanks!

    – Lucas Pottersky
    Aug 21 '14 at 14:02



















0














Use the following command



exec kitchen converge ubuntu


converge will regex of instances






share|improve this answer































    0














    Use the following definition in your kitchen.yml to disable box updates



    platforms:
    - name: centos-7
    driver:
    box: bento/centos-7
    box_check_update: false


    where the box is a locally available vagrant box in your host. Run the following command to get a list of available boxes:



    $ vagrant box list
    bento/centos-6.7 (virtualbox, 2.2.7)
    bento/centos-7 (virtualbox, 201808.24.0)





    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21697438%2fkitchen-test-how-to-use-local-vm-box%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2














      If by "downloads a new VM box", you mean destroys and creates one, yes, that's what kitchen test does. If you want to persist the instance, just run



      kitchen converge


      If you mean that Vagrant is downloading a new box from the Internet, then that's likely a bug in Vagrant.






      share|improve this answer
























      • Yes, Vagrant downloads a new box every time I run kitchen test.

        – markhorrocks
        Feb 11 '14 at 22:16











      • Can you update your question with the output?

        – sethvargo
        Feb 11 '14 at 22:40











      • Q updated with terminal output.

        – markhorrocks
        Feb 12 '14 at 2:17






      • 2





        That's downloading Chef, not the Ubuntu box

        – sethvargo
        Feb 12 '14 at 2:55











      • ok, thanks. it takes ages on my slow connection.

        – markhorrocks
        Feb 12 '14 at 5:51


















      2














      If by "downloads a new VM box", you mean destroys and creates one, yes, that's what kitchen test does. If you want to persist the instance, just run



      kitchen converge


      If you mean that Vagrant is downloading a new box from the Internet, then that's likely a bug in Vagrant.






      share|improve this answer
























      • Yes, Vagrant downloads a new box every time I run kitchen test.

        – markhorrocks
        Feb 11 '14 at 22:16











      • Can you update your question with the output?

        – sethvargo
        Feb 11 '14 at 22:40











      • Q updated with terminal output.

        – markhorrocks
        Feb 12 '14 at 2:17






      • 2





        That's downloading Chef, not the Ubuntu box

        – sethvargo
        Feb 12 '14 at 2:55











      • ok, thanks. it takes ages on my slow connection.

        – markhorrocks
        Feb 12 '14 at 5:51
















      2












      2








      2







      If by "downloads a new VM box", you mean destroys and creates one, yes, that's what kitchen test does. If you want to persist the instance, just run



      kitchen converge


      If you mean that Vagrant is downloading a new box from the Internet, then that's likely a bug in Vagrant.






      share|improve this answer













      If by "downloads a new VM box", you mean destroys and creates one, yes, that's what kitchen test does. If you want to persist the instance, just run



      kitchen converge


      If you mean that Vagrant is downloading a new box from the Internet, then that's likely a bug in Vagrant.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Feb 11 '14 at 17:34









      sethvargosethvargo

      19.6k772132




      19.6k772132













      • Yes, Vagrant downloads a new box every time I run kitchen test.

        – markhorrocks
        Feb 11 '14 at 22:16











      • Can you update your question with the output?

        – sethvargo
        Feb 11 '14 at 22:40











      • Q updated with terminal output.

        – markhorrocks
        Feb 12 '14 at 2:17






      • 2





        That's downloading Chef, not the Ubuntu box

        – sethvargo
        Feb 12 '14 at 2:55











      • ok, thanks. it takes ages on my slow connection.

        – markhorrocks
        Feb 12 '14 at 5:51





















      • Yes, Vagrant downloads a new box every time I run kitchen test.

        – markhorrocks
        Feb 11 '14 at 22:16











      • Can you update your question with the output?

        – sethvargo
        Feb 11 '14 at 22:40











      • Q updated with terminal output.

        – markhorrocks
        Feb 12 '14 at 2:17






      • 2





        That's downloading Chef, not the Ubuntu box

        – sethvargo
        Feb 12 '14 at 2:55











      • ok, thanks. it takes ages on my slow connection.

        – markhorrocks
        Feb 12 '14 at 5:51



















      Yes, Vagrant downloads a new box every time I run kitchen test.

      – markhorrocks
      Feb 11 '14 at 22:16





      Yes, Vagrant downloads a new box every time I run kitchen test.

      – markhorrocks
      Feb 11 '14 at 22:16













      Can you update your question with the output?

      – sethvargo
      Feb 11 '14 at 22:40





      Can you update your question with the output?

      – sethvargo
      Feb 11 '14 at 22:40













      Q updated with terminal output.

      – markhorrocks
      Feb 12 '14 at 2:17





      Q updated with terminal output.

      – markhorrocks
      Feb 12 '14 at 2:17




      2




      2





      That's downloading Chef, not the Ubuntu box

      – sethvargo
      Feb 12 '14 at 2:55





      That's downloading Chef, not the Ubuntu box

      – sethvargo
      Feb 12 '14 at 2:55













      ok, thanks. it takes ages on my slow connection.

      – markhorrocks
      Feb 12 '14 at 5:51







      ok, thanks. it takes ages on my slow connection.

      – markhorrocks
      Feb 12 '14 at 5:51















      11














      Test Kitchen creates its own Vagrantfile, based on .kitchen.yml config.



      Therefore you have to specify your box (which should be already available for Vagrant, check vagrant box list) in .kitchen.yml. In your example it would be:



      platforms:
      - name: ubuntu-12.04
      driver:
      box: centos-6.5-x86_64-minimal


      And kitchen will use box available for Vagrant, without downloading it.



      You can also specify other Vagrant options, e.g.



      - name: centos-vagrant
      driver:
      provider: parallels
      box: centos-6.5-x86_64-minimal
      customize:
      memsize: 1024
      cpus: 2


      You can see more examples eg. in my Vagrant cookbooks lemp-server or or Opscode's yum.






      share|improve this answer
























      • Thanks marcin-r it was the driver/box line that I was missing

        – jaygooby
        Feb 26 '14 at 10:49













      • The OP updated the original question, but that's what I was looking for. Thanks!

        – Lucas Pottersky
        Aug 21 '14 at 14:02
















      11














      Test Kitchen creates its own Vagrantfile, based on .kitchen.yml config.



      Therefore you have to specify your box (which should be already available for Vagrant, check vagrant box list) in .kitchen.yml. In your example it would be:



      platforms:
      - name: ubuntu-12.04
      driver:
      box: centos-6.5-x86_64-minimal


      And kitchen will use box available for Vagrant, without downloading it.



      You can also specify other Vagrant options, e.g.



      - name: centos-vagrant
      driver:
      provider: parallels
      box: centos-6.5-x86_64-minimal
      customize:
      memsize: 1024
      cpus: 2


      You can see more examples eg. in my Vagrant cookbooks lemp-server or or Opscode's yum.






      share|improve this answer
























      • Thanks marcin-r it was the driver/box line that I was missing

        – jaygooby
        Feb 26 '14 at 10:49













      • The OP updated the original question, but that's what I was looking for. Thanks!

        – Lucas Pottersky
        Aug 21 '14 at 14:02














      11












      11








      11







      Test Kitchen creates its own Vagrantfile, based on .kitchen.yml config.



      Therefore you have to specify your box (which should be already available for Vagrant, check vagrant box list) in .kitchen.yml. In your example it would be:



      platforms:
      - name: ubuntu-12.04
      driver:
      box: centos-6.5-x86_64-minimal


      And kitchen will use box available for Vagrant, without downloading it.



      You can also specify other Vagrant options, e.g.



      - name: centos-vagrant
      driver:
      provider: parallels
      box: centos-6.5-x86_64-minimal
      customize:
      memsize: 1024
      cpus: 2


      You can see more examples eg. in my Vagrant cookbooks lemp-server or or Opscode's yum.






      share|improve this answer













      Test Kitchen creates its own Vagrantfile, based on .kitchen.yml config.



      Therefore you have to specify your box (which should be already available for Vagrant, check vagrant box list) in .kitchen.yml. In your example it would be:



      platforms:
      - name: ubuntu-12.04
      driver:
      box: centos-6.5-x86_64-minimal


      And kitchen will use box available for Vagrant, without downloading it.



      You can also specify other Vagrant options, e.g.



      - name: centos-vagrant
      driver:
      provider: parallels
      box: centos-6.5-x86_64-minimal
      customize:
      memsize: 1024
      cpus: 2


      You can see more examples eg. in my Vagrant cookbooks lemp-server or or Opscode's yum.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Feb 25 '14 at 23:02









      Marcin RMarcin R

      1,09576




      1,09576













      • Thanks marcin-r it was the driver/box line that I was missing

        – jaygooby
        Feb 26 '14 at 10:49













      • The OP updated the original question, but that's what I was looking for. Thanks!

        – Lucas Pottersky
        Aug 21 '14 at 14:02



















      • Thanks marcin-r it was the driver/box line that I was missing

        – jaygooby
        Feb 26 '14 at 10:49













      • The OP updated the original question, but that's what I was looking for. Thanks!

        – Lucas Pottersky
        Aug 21 '14 at 14:02

















      Thanks marcin-r it was the driver/box line that I was missing

      – jaygooby
      Feb 26 '14 at 10:49







      Thanks marcin-r it was the driver/box line that I was missing

      – jaygooby
      Feb 26 '14 at 10:49















      The OP updated the original question, but that's what I was looking for. Thanks!

      – Lucas Pottersky
      Aug 21 '14 at 14:02





      The OP updated the original question, but that's what I was looking for. Thanks!

      – Lucas Pottersky
      Aug 21 '14 at 14:02











      0














      Use the following command



      exec kitchen converge ubuntu


      converge will regex of instances






      share|improve this answer




























        0














        Use the following command



        exec kitchen converge ubuntu


        converge will regex of instances






        share|improve this answer


























          0












          0








          0







          Use the following command



          exec kitchen converge ubuntu


          converge will regex of instances






          share|improve this answer













          Use the following command



          exec kitchen converge ubuntu


          converge will regex of instances







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 7 '14 at 12:23









          bhaskarbhaskar

          132




          132























              0














              Use the following definition in your kitchen.yml to disable box updates



              platforms:
              - name: centos-7
              driver:
              box: bento/centos-7
              box_check_update: false


              where the box is a locally available vagrant box in your host. Run the following command to get a list of available boxes:



              $ vagrant box list
              bento/centos-6.7 (virtualbox, 2.2.7)
              bento/centos-7 (virtualbox, 201808.24.0)





              share|improve this answer




























                0














                Use the following definition in your kitchen.yml to disable box updates



                platforms:
                - name: centos-7
                driver:
                box: bento/centos-7
                box_check_update: false


                where the box is a locally available vagrant box in your host. Run the following command to get a list of available boxes:



                $ vagrant box list
                bento/centos-6.7 (virtualbox, 2.2.7)
                bento/centos-7 (virtualbox, 201808.24.0)





                share|improve this answer


























                  0












                  0








                  0







                  Use the following definition in your kitchen.yml to disable box updates



                  platforms:
                  - name: centos-7
                  driver:
                  box: bento/centos-7
                  box_check_update: false


                  where the box is a locally available vagrant box in your host. Run the following command to get a list of available boxes:



                  $ vagrant box list
                  bento/centos-6.7 (virtualbox, 2.2.7)
                  bento/centos-7 (virtualbox, 201808.24.0)





                  share|improve this answer













                  Use the following definition in your kitchen.yml to disable box updates



                  platforms:
                  - name: centos-7
                  driver:
                  box: bento/centos-7
                  box_check_update: false


                  where the box is a locally available vagrant box in your host. Run the following command to get a list of available boxes:



                  $ vagrant box list
                  bento/centos-6.7 (virtualbox, 2.2.7)
                  bento/centos-7 (virtualbox, 201808.24.0)






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 13 '18 at 23:32









                  ShanimShanim

                  163




                  163






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f21697438%2fkitchen-test-how-to-use-local-vm-box%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Xamarin.iOS Cant Deploy on Iphone

                      Glorious Revolution

                      Dulmage-Mendelsohn matrix decomposition in Python