{"id":231,"date":"2019-05-05T11:57:27","date_gmt":"2019-05-05T09:57:27","guid":{"rendered":"https:\/\/www.tobanet.de\/s\/?p=231"},"modified":"2019-05-17T15:48:05","modified_gmt":"2019-05-17T13:48:05","slug":"vagrant-cheat-sheet","status":"publish","type":"post","link":"https:\/\/www.tobanet.de\/s\/2019\/05\/vagrant-cheat-sheet\/","title":{"rendered":"Vagrant cheat sheet"},"content":{"rendered":"\n<p>A quick overview of the most useful vagrant commands.<\/p>\n\n\n\n<p>Hint: &#8220;ve&#8221; means vagrant environment &#8211; the virtual machine(s) you run.<\/p>\n\n\n\n<table id=\"tablepress-1\" class=\"tablepress tablepress-id-1\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Command<\/th><th class=\"column-2\">Remark<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">vagrant up<\/td><td class=\"column-2\">start ve<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">vagrant halt<\/td><td class=\"column-2\">stop ve<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">vagrant reload<\/td><td class=\"column-2\">reload Vagrantfile, restart ve<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">vagrant destroy<\/td><td class=\"column-2\">destroy ve<\/td>\n<\/tr>\n<tr class=\"row-6\">\n\t<td class=\"column-1\">vagrant status<\/td><td class=\"column-2\">show status of ve(s)<\/td>\n<\/tr>\n<tr class=\"row-7\">\n\t<td class=\"column-1\">vagrant box list<\/td><td class=\"column-2\">show local baseboxes<\/td>\n<\/tr>\n<tr class=\"row-8\">\n\t<td class=\"column-1\">vagrant box add http:\/\/local.example.com\/vagrant\/box.json --box-version 2019.05.04<\/td><td class=\"column-2\">explicitly install a box from the given location and version<\/td>\n<\/tr>\n<tr class=\"row-9\">\n\t<td class=\"column-1\">vagrant box update<\/td><td class=\"column-2\">update all baseboxes currently installed<\/td>\n<\/tr>\n<tr class=\"row-10\">\n\t<td class=\"column-1\">vagrant box update --box prefix\/boxname<\/td><td class=\"column-2\">update just the given basebox<\/td>\n<\/tr>\n<tr class=\"row-11\">\n\t<td class=\"column-1\">vagrant box prune<\/td><td class=\"column-2\">remove outdated baseboxes<\/td>\n<\/tr>\n<tr class=\"row-12\">\n\t<td class=\"column-1\">vagrant box prune --name prefix\/boxname<\/td><td class=\"column-2\">remove just the given outdated baseboxes<\/td>\n<\/tr>\n<tr class=\"row-13\">\n\t<td class=\"column-1\">vagrant box remove prefix\/boxname<\/td><td class=\"column-2\">remove all cached instances of the given basebox<\/td>\n<\/tr>\n<tr class=\"row-14\">\n\t<td class=\"column-1\">vagrant box remove prefix\/boxname --box-version 2019.05.04<\/td><td class=\"column-2\">remove just the given basebox and version<\/td>\n<\/tr>\n<tr class=\"row-15\">\n\t<td class=\"column-1\">vagrant up --provision ve<\/td><td class=\"column-2\">provision the ve with all provisioners (again)<\/td>\n<\/tr>\n<tr class=\"row-16\">\n\t<td class=\"column-1\">vagrant up --provision-with ansible ve<\/td><td class=\"column-2\">provision the ve with ansible (again)<\/td>\n<\/tr>\n<tr class=\"row-17\">\n\t<td class=\"column-1\">vagrant reload --provision ve<\/td><td class=\"column-2\">reload Vagrantfile, restart the ve and provision it again<\/td>\n<\/tr>\n<tr class=\"row-18\">\n\t<td class=\"column-1\">vagrant provision ve<\/td><td class=\"column-2\">provision the running ve without restart<\/td>\n<\/tr>\n<tr class=\"row-19\">\n\t<td class=\"column-1\">vagrant provision --provision-with-ansible ve<\/td><td class=\"column-2\">provision the running ve with ansible and without restart<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-1 from cache -->\n\n\n\n<h3 class=\"wp-block-heading\">How to return to a previous version of a vagrant basebox<\/h3>\n\n\n\n<ol class=\"wp-block-list\"><li>remove any vagrant environment based on the basebox you want to remove: <br><tt><code>vagrant destroy<\/code><\/tt><\/li><li>remove the basebox: <br><tt><code>vagrant box remove prefix\/basebox --box-version xyz<\/code><\/tt><\/li><li>if you already pruned the previous basebox you have to download it again: <br><tt><code>vagrant box add http:\/\/local.example.com\/vagrant\/basebox.json --box-version xyz<\/code><\/tt><\/li><li>check if it is there: <br><tt><code>vagrant box list<\/code><\/tt><\/li><li>create a new vagrant environment: <br><tt><code>vagrant up<\/code><\/tt><\/li><\/ol>\n","protected":false},"excerpt":{"rendered":"<p>A quick overview of the most useful vagrant commands. Hint: &#8220;ve&#8221; means vagrant environment &#8211; the virtual machine(s) you run. How to return to a previous version of a vagrant basebox remove any vagrant environment based on the basebox you want to remove: vagrant destroy remove the basebox: vagrant box remove prefix\/basebox &#8211;box-version xyz if you already pruned the previous basebox you have to download it again: vagrant box add http:\/\/local.example.com\/vagrant\/basebox.json &#8211;box-version xyz check if it is there: vagrant box&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.tobanet.de\/s\/2019\/05\/vagrant-cheat-sheet\/\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[25],"class_list":["post-231","post","type-post","status-publish","format-standard","hentry","category-virtualization","tag-vagrant"],"_links":{"self":[{"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/posts\/231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/comments?post=231"}],"version-history":[{"count":2,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":253,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/posts\/231\/revisions\/253"}],"wp:attachment":[{"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tobanet.de\/s\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}