{"id":165,"date":"2023-01-02T06:31:01","date_gmt":"2023-01-02T06:31:01","guid":{"rendered":"http:\/\/cloudkul.com\/blog\/?p=165"},"modified":"2024-12-26T11:17:21","modified_gmt":"2024-12-26T11:17:21","slug":"vagrant-implementation","status":"publish","type":"post","link":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/","title":{"rendered":"Vagrant Implementation&#8230;.!!!"},"content":{"rendered":"<p>In the last blog, we discussed <a href=\"https:\/\/cloudkul.com\/blog\/virtualization-with-vagrant\/\">Vagrant, why should we adopt<\/a> it in our working environment &amp; what is the main difference between docker &amp; vagrant.<\/p>\n<p>Here, in this blog, I will provide a very simple way that you can follow to get your <a href=\"https:\/\/webkul.com\/blog\/setup-magento-1-9-0-1-using-vagrant\/\">vagrant machine up and running<\/a>, Today let&#8217;s implement it:<\/p>\n<p>Firstly the question is, how to install vagrants?<\/p>\n<h2>Steps to install Vagrant<\/h2>\n<p>Open the terminal then go to the root user by typing:<\/p>\n<pre class=\"brush:shell\">sudo -s<\/pre>\n<p>then you have to install VirtualBox by typing:<\/p>\n<pre class=\"brush:shell\">sudo apt-get install virtualbox virtualbox-dkms<\/pre>\n<p>Installing Vagrant:<\/p>\n<pre class=\"brush:shell\">sudo apt-get install vagrant<\/pre>\n<p>Now check the version of your vagrant application by typing:<\/p>\n<pre class=\"brush:shell\">vagrant -v<\/pre>\n<p>the output should be \u201cvagrant 1.7.4\u201d<\/p>\n<p><span style=\"color: #000000;\"><strong><span style=\"text-decoration: underline;\">Note<\/span>:- \u201cIf you get the lower version of Vagrant then upgrade it to 1.7.4, otherwise, your Vagrant file will not work perfectly\u201d<\/strong><\/span><\/p>\n<p>To get the latest version, you need to download its updated package on the mentioned site below:<\/p>\n<p><span style=\"color: #000000;\"><strong><a style=\"color: #000000;\" href=\"https:\/\/www.vagrantup.com\/downloads.html\">https:\/\/www.vagrantup.com\/downloads.html<\/a><\/strong><\/span><\/p>\n<p>I am using Ubuntu 14.04. So I have downloaded the Debian package and now let&#8217;s install the updated package by typing:<\/p>\n<div>\n<div id=\"highlighter_594890\" class=\"syntaxhighlighter shell\">\n<pre class=\"brush:shell\">sudo dpkg -i \u201cpackage_name_what_you_have_downloaded.\u201d\n<\/pre>\n<p><span style=\"line-height: 1.5;\">Now check the version:<\/span><\/p>\n<pre class=\"brush:shell\">Vagrant -v<\/pre>\n<p>The output should be 1.7.4<\/p>\n<p>Now let&#8217;s get the vagrant box from its official site: <span style=\"color: #000000;\"><strong><a style=\"color: #000000;\" href=\"http:\/\/www.vagrantbox.es\/\">http:\/\/www.vagrantbox.es\/<\/a><\/strong><\/span><\/p>\n<p>Now copy the URL of the box which you want to download then hit the command on the terminal:<\/p>\n<pre class=\"brush:shell\">vagrant box add \u201cbox_name\u201d \u201cbox_URL_what_you_copied_from_its_site\u201d<\/pre>\n<p>After downloading this box, you will have to come back to your user.<\/p>\n<p><span style=\"color: #000000;\"><b><u>Note<\/u>:-\u00a0<strong> If you create your machine from the root user, then you will not get the UI of your machine in VirtualBox.<\/strong><\/b><\/span><\/p>\n<p>Now let&#8217;s create a directory in which you will create your\u00a0machine by typing:<\/p>\n<pre class=\"brush:shell\">mkdir -p \u201cdirectory_name\u201d<\/pre>\n<p>Now we will enter in the directory &#8216;what you just made&#8217; by typing:<\/p>\n<pre class=\"brush:shell\">cd \u201cdirectry_name\u201d<\/pre>\n<p>Let&#8217;s initialize the vagrant by typing:<\/p>\n<pre class=\"brush:shell\">vagrant init<\/pre>\n<p>Now check your directory by typing the &#8220;ls&#8221; command, you will see a file named Vagrantfile.<\/p>\n<p>Just open it with your editor, I will open it with nano editor by typing:<\/p>\n<pre class=\"brush:shell\">nano Vagrantfile\n<\/pre>\n<p><span style=\"line-height: 1.5;\">Now search the line named <\/span><b style=\"line-height: 1.5;\">config.vm.box = \u201cbase\u201d <\/b><span style=\"line-height: 1.5;\">and change that <\/span><b style=\"line-height: 1.5;\">base<\/b><span style=\"line-height: 1.5;\"> word with your <\/span><b style=\"line-height: 1.5;\">box_name<\/b><span style=\"line-height: 1.5;\"> that you gave at the time of downloading the vagrant box.<\/span><\/p>\n<p>Now in the next line, add your username &amp; password by typing:<\/p>\n<pre class=\"brush:shell\">config.ssh.username=\u201cvagrant\u201d\n\nconfig.ssh.password=\u201cvagrant\u201d<\/pre>\n<p><span style=\"color: #000000;\"><strong>Note:- You can keep your username &amp; password by your choice, I kept vagrant because it is default&#8230; \ud83d\ude42<\/strong><\/span><\/p>\n<h2>Now let&#8217;s give the IP address to your\u00a0machine.<\/h2>\n<p>Find out the line <b>\u201cconfig.vm.network public_network&#8221;, <\/b>firstly uncomment this line and then modify this line and it should be like this:<\/p>\n<p>config.vm.network &#8220;public_network&#8221;, ip: \u201cYOUR_IP_ADDRESS\u201d<\/p>\n<p>Now save this file and exit&#8230;!!!<\/p>\n<p>Now let&#8217;s get your vagrant box up by typing:<\/p>\n<pre class=\"brush:shell\">vagrant up<\/pre>\n<p>After getting it up, access your\u00a0machine by typing:<\/p>\n<pre class=\"brush:shell\">vagrant ssh<\/pre>\n<p>and now check your virtual box, you will get the GUI of your\u00a0machine there. Similarly, you can create your machine in just a few steps how much you want&#8230;.:)<\/p>\n<p>Now if you want to destroy your\u00a0box, hit the command:<\/p>\n<pre class=\"brush:shell\">vagrant destroy<\/pre>\n<p>To halt your\u00a0machine type:<\/p>\n<pre class=\"brush:shell\">vagrant halt\n<\/pre>\n<p><span style=\"line-height: 1.5;\">Restart your machine type:<\/span><\/p>\n<pre class=\"brush:shell\">vagrant reload<\/pre>\n<p>To check your currently running\u00a0machines, type:<\/p>\n<pre class=\"brush:shell\">VBoxManage list runningvms<\/pre>\n<p>Check the total number of\u00a0machines that you have in your system type:<\/p>\n<pre class=\"brush:shell\">VBoxmanage list vms<\/pre>\n<h2>Now let&#8217;s talk about the backup of your\u00a0machine box.<\/h2>\n<p>Yes, You can take a backup of your machine for the future.<\/p>\n<p>If your os gets corrupted, reinstalled, or upgraded, then your machine will not get corrupted and You will not lose your pre-installed application.<\/p>\n<p>For this, you just need to take a backup of your machine by typing:<\/p>\n<p>Firstly shut down the\u00a0machine.<\/p>\n<p>To do that go to the directory in which you initialized your vagrant machine and then shut down the machine by typing:<\/p>\n<pre class=\"brush:shell\">vagrant halt<\/pre>\n<p>Now copy the name of your vagrant machine.<\/p>\n<p>To know the name of your\u00a0machine type:<\/p>\n<pre class=\"brush:shell\">VBoxManage list vms<\/pre>\n<p>It will show the name and UID of your VM machine.<\/p>\n<p>Now copy the name of your vagrant machine whose you want to take backup and then type:<\/p>\n<pre class=\"brush:shell\">vagrant package \u2013base \u201cvagrant_machine_name\u201d --output \u201cpath_to_the_box_where_you_want_to_keep_it.box\u201d<\/pre>\n<p>After this command, you&#8217;ll have a backup box of your virtual machine. Store it locally or in the cloud, then specify its path in your Vagrant file to use it again.<\/p>\n<p>Let&#8217;s discuss how to <a href=\"https:\/\/cloudkul.com\/blog\/lets-use-windows-through-vagrant-2\/\">use Windows through Vagrant<\/a>.<\/p>\n<h3 style=\"text-align: center;\"><span style=\"color: #000000;\"><strong><a href=\"http:\/\/cloudkul.com\/contact\/\" target=\"_blank\" rel=\"noopener\">FOR ANY TYPE OF QUERY OR HELP, KINDLY CONTACT US<\/a><\/strong><\/span><\/h3>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In the last blog, we discussed Vagrant, why should we adopt it in our working <a class=\"text-primary\" title=\"read more\" href=\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":4,"featured_media":324,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[1],"tags":[7,9,8],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Vagrant Implementation....!!! - Cloudkul<\/title>\n<meta name=\"description\" content=\"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vagrant Implementation....!!! - Cloudkul\" \/>\n<meta property=\"og:description\" content=\"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudkul\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-02T06:31:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-26T11:17:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/11\/Vagrant-Implementation.png\" \/>\n\t<meta property=\"og:image:width\" content=\"848\" \/>\n\t<meta property=\"og:image:height\" content=\"422\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prashant Arora\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\",\"url\":\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\",\"name\":\"Vagrant Implementation....!!! - Cloudkul\",\"isPartOf\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\"},\"datePublished\":\"2023-01-02T06:31:01+00:00\",\"dateModified\":\"2024-12-26T11:17:21+00:00\",\"author\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822\"},\"description\":\"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vagrant Implementation&#8230;.!!!\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#website\",\"url\":\"https:\/\/cloudkul.com\/blog\/\",\"name\":\"Cloudkul\",\"description\":\"Host your eCommerce Store on AWS with Optimized Performance\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudkul.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822\",\"name\":\"Prashant Arora\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g\",\"caption\":\"Prashant Arora\"},\"url\":\"https:\/\/cloudkul.com\/blog\/author\/prashant089\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Vagrant Implementation....!!! - Cloudkul","description":"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/","og_locale":"en_US","og_type":"article","og_title":"Vagrant Implementation....!!! - Cloudkul","og_description":"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant","og_url":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/","og_site_name":"Cloudkul","article_published_time":"2023-01-02T06:31:01+00:00","article_modified_time":"2024-12-26T11:17:21+00:00","og_image":[{"width":848,"height":422,"url":"https:\/\/cloudkul.com\/blog\/wp-content\/uploads\/2015\/11\/Vagrant-Implementation.png","type":"image\/png"}],"author":"Prashant Arora","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/","url":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/","name":"Vagrant Implementation....!!! - Cloudkul","isPartOf":{"@id":"https:\/\/cloudkul.com\/blog\/#website"},"datePublished":"2023-01-02T06:31:01+00:00","dateModified":"2024-12-26T11:17:21+00:00","author":{"@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822"},"description":"With the help of Vagrant, you can create and maintain virtual machine environments in a single workflow. Learn how to install vagrant","breadcrumb":{"@id":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudkul.com\/blog\/vagrant-implementation\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/cloudkul.com\/blog\/vagrant-implementation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Vagrant Implementation&#8230;.!!!"}]},{"@type":"WebSite","@id":"https:\/\/cloudkul.com\/blog\/#website","url":"https:\/\/cloudkul.com\/blog\/","name":"Cloudkul","description":"Host your eCommerce Store on AWS with Optimized Performance","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudkul.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/0f130d5c45f7a843f035c2b26dfd8822","name":"Prashant Arora","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ffd3d12ef1ac706011cfd6f835707402?s=96&d=https%3A%2F%2Fs.gravatar.com%2Favatar%2F6148c37469011bc2f8e491ca8f5de495%3Fs%3D80&r=g","caption":"Prashant Arora"},"url":"https:\/\/cloudkul.com\/blog\/author\/prashant089\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/165"}],"collection":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/comments?post=165"}],"version-history":[{"count":23,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/165\/revisions"}],"predecessor-version":[{"id":19254,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/posts\/165\/revisions\/19254"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media\/324"}],"wp:attachment":[{"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/media?parent=165"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/categories?post=165"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudkul.com\/blog\/wp-json\/wp\/v2\/tags?post=165"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}