Can you perform a vagrant provision from inside the VM?












0















Usually you have to run vagrant provision from outside your VM to create the VM to begin with. I then do a vagrant ssh to inspect the resultant VM.



If I wish to make small tweaks to the VM (using chef zero recipes in my case), I have to either switch to an other tab that is on my physical host, or exit the SSH session. it would be nice if you could do this run-and-inspect inside the previously created VM.



Why I'm asking: I have too many terminal tabs open for development and am looking for ways to prune, and avoid mental context switching (not to mention trying to figure out which tab is which).










share|improve this question



























    0















    Usually you have to run vagrant provision from outside your VM to create the VM to begin with. I then do a vagrant ssh to inspect the resultant VM.



    If I wish to make small tweaks to the VM (using chef zero recipes in my case), I have to either switch to an other tab that is on my physical host, or exit the SSH session. it would be nice if you could do this run-and-inspect inside the previously created VM.



    Why I'm asking: I have too many terminal tabs open for development and am looking for ways to prune, and avoid mental context switching (not to mention trying to figure out which tab is which).










    share|improve this question

























      0












      0








      0








      Usually you have to run vagrant provision from outside your VM to create the VM to begin with. I then do a vagrant ssh to inspect the resultant VM.



      If I wish to make small tweaks to the VM (using chef zero recipes in my case), I have to either switch to an other tab that is on my physical host, or exit the SSH session. it would be nice if you could do this run-and-inspect inside the previously created VM.



      Why I'm asking: I have too many terminal tabs open for development and am looking for ways to prune, and avoid mental context switching (not to mention trying to figure out which tab is which).










      share|improve this question














      Usually you have to run vagrant provision from outside your VM to create the VM to begin with. I then do a vagrant ssh to inspect the resultant VM.



      If I wish to make small tweaks to the VM (using chef zero recipes in my case), I have to either switch to an other tab that is on my physical host, or exit the SSH session. it would be nice if you could do this run-and-inspect inside the previously created VM.



      Why I'm asking: I have too many terminal tabs open for development and am looking for ways to prune, and avoid mental context switching (not to mention trying to figure out which tab is which).







      vagrant vagrant-provision






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 31 '18 at 22:56









      Sridhar-SarnobatSridhar-Sarnobat

      8,08585358




      8,08585358
























          1 Answer
          1






          active

          oldest

          votes


















          1














          No, you can not run a vagrant provision from inside the same vagrant machine.
          Vagrant is running on your host and provisioning the VM according to the specified vagrantfile. Any changes that you want to have applied during the provisioning must somehow come from the vagrantfile.



          What you can do is modify a running vagrant machine in any way you want from inside the vagrant machine, and then export the VM using vagrant package to a new vagrant box which then can be used as base for new vagrant VMs.



          PS: Not sure how you're dev environment looks like, but I suggest you look into terminal multiplexers like GNU screen or tmux, that might be able to help you with your "tab issues".






          share|improve this answer
























          • Thanks for the multiple suggestions.

            – Sridhar-Sarnobat
            Jan 3 at 19:18











          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%2f53991998%2fcan-you-perform-a-vagrant-provision-from-inside-the-vm%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          No, you can not run a vagrant provision from inside the same vagrant machine.
          Vagrant is running on your host and provisioning the VM according to the specified vagrantfile. Any changes that you want to have applied during the provisioning must somehow come from the vagrantfile.



          What you can do is modify a running vagrant machine in any way you want from inside the vagrant machine, and then export the VM using vagrant package to a new vagrant box which then can be used as base for new vagrant VMs.



          PS: Not sure how you're dev environment looks like, but I suggest you look into terminal multiplexers like GNU screen or tmux, that might be able to help you with your "tab issues".






          share|improve this answer
























          • Thanks for the multiple suggestions.

            – Sridhar-Sarnobat
            Jan 3 at 19:18
















          1














          No, you can not run a vagrant provision from inside the same vagrant machine.
          Vagrant is running on your host and provisioning the VM according to the specified vagrantfile. Any changes that you want to have applied during the provisioning must somehow come from the vagrantfile.



          What you can do is modify a running vagrant machine in any way you want from inside the vagrant machine, and then export the VM using vagrant package to a new vagrant box which then can be used as base for new vagrant VMs.



          PS: Not sure how you're dev environment looks like, but I suggest you look into terminal multiplexers like GNU screen or tmux, that might be able to help you with your "tab issues".






          share|improve this answer
























          • Thanks for the multiple suggestions.

            – Sridhar-Sarnobat
            Jan 3 at 19:18














          1












          1








          1







          No, you can not run a vagrant provision from inside the same vagrant machine.
          Vagrant is running on your host and provisioning the VM according to the specified vagrantfile. Any changes that you want to have applied during the provisioning must somehow come from the vagrantfile.



          What you can do is modify a running vagrant machine in any way you want from inside the vagrant machine, and then export the VM using vagrant package to a new vagrant box which then can be used as base for new vagrant VMs.



          PS: Not sure how you're dev environment looks like, but I suggest you look into terminal multiplexers like GNU screen or tmux, that might be able to help you with your "tab issues".






          share|improve this answer













          No, you can not run a vagrant provision from inside the same vagrant machine.
          Vagrant is running on your host and provisioning the VM according to the specified vagrantfile. Any changes that you want to have applied during the provisioning must somehow come from the vagrantfile.



          What you can do is modify a running vagrant machine in any way you want from inside the vagrant machine, and then export the VM using vagrant package to a new vagrant box which then can be used as base for new vagrant VMs.



          PS: Not sure how you're dev environment looks like, but I suggest you look into terminal multiplexers like GNU screen or tmux, that might be able to help you with your "tab issues".







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 3 at 11:46









          su_lisu_li

          1246




          1246













          • Thanks for the multiple suggestions.

            – Sridhar-Sarnobat
            Jan 3 at 19:18



















          • Thanks for the multiple suggestions.

            – Sridhar-Sarnobat
            Jan 3 at 19:18

















          Thanks for the multiple suggestions.

          – Sridhar-Sarnobat
          Jan 3 at 19:18





          Thanks for the multiple suggestions.

          – Sridhar-Sarnobat
          Jan 3 at 19:18




















          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%2f53991998%2fcan-you-perform-a-vagrant-provision-from-inside-the-vm%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

          Mossoró

          Error while reading .h5 file using the rhdf5 package in R

          Pushsharp Apns notification error: 'InvalidToken'