{"id":2437,"date":"2018-07-11T02:21:42","date_gmt":"2018-07-10T17:21:42","guid":{"rendered":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/?page_id=2437"},"modified":"2023-07-20T19:04:04","modified_gmt":"2023-07-20T10:04:04","slug":"kusanagi-for-vagrant","status":"publish","type":"page","link":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/cloud\/kusanagi-for-vagrant\/","title":{"rendered":"KUSANAGI for Vagrant"},"content":{"rendered":"<h2>Notable features<\/h2>\n<ul>\n<li>Install KUSANAGI without depending on the OS<\/li>\n<li>Easily set up KUSANAGI environment<\/li>\n<li>Set up KUSANAGI on a local PC<\/li>\n<li>Focus on development\/verification without worrying about affecting other developers<\/li>\n<\/ul>\n<h2>Install outline<\/h2>\n<ol>\n<li>Install VirtualBox<\/li>\n<li>Install Vagrant<\/li>\n<li>Install the KUSANAGI Vagrant Box<\/li>\n<\/ol>\n<p><strong><small>*This guide was written for Windows, but can also be used for MacOS and others<\/small><\/strong><\/p>\n<style type=\"text\/css\">\ndiv.be_infobox {\nborder: 4px double #ddd;\nmargin: 2em 0;\npadding: 2em;\n}\n<\/style>\n<div class=\"be_infobox\">\n<h2>The following conditions will cause the installation to fail<\/h2>\n<ul>\n<li>The host PC\u2019s CPU does not support hardware-assisted virtualization. PC\u2019s built after 2008 typically do, however it is commonly disabled in the BIOS. Confirm that VT is not set to \u2018Disable\u2019 in the BIOS settings. Some older PC\u2019s may not have hardware-assisted virtualization at all, in which case you would need to switch to a newer PC that does.<\/li>\n<li>The username includes Japanese characters (on Windows). Create an account using only alphabet characters and try running <code>vagrant up<\/code><\/li>\n<li>Vagrant Box files take some time to download during the first <code>vagrant up<\/code>. Without enough bandwidth, there is a good chance that the download will fail, so be sure to use a connection with sufficient bandwidth.<\/li>\n<li>Security settings in Mac OS High Sierra and later will block VirtualBox by default. <strong>Check System Preference -&gt; Security&amp;Privacy settings<\/strong> If Oracle America, Inc. is blocked, so allow it.<\/li>\n<\/ul>\n<\/div>\n<h2>Installing VirtualBox<\/h2>\n<ol>\n<li>Download VirtualBox for Windows from: <a href=\"http:\/\/www.oracle.com\/technetwork\/server-storage\/virtualbox\/downloads\/index.html\">http:\/\/www.oracle.com\/technetwork\/server-storage\/virtualbox\/downloads\/index.html<\/a><\/li>\n<li>Double-click on the downloaded file to start the installer. Click OK throughout installation.<\/li>\n<li>After installation, this icon will appear:<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-4682\" src=\"https:\/\/kusanagi.tokyo\/kusanagi8\/wp-content\/uploads\/2018\/05\/vbicon.png\" alt=\"\" width=\"82\" height=\"92\" \/><\/p>\n<h2>Installing Vagrant<\/h2>\n<ol>\n<li>Download Vagrant for Windows(64bit) from: <a href=\"https:\/\/www.vagrantup.com\/downloads.html\">https:\/\/www.vagrantup.com\/downloads.html<\/a><\/li>\n<li>Double-click the downloaded file to start the installer, and click OK throughout the installation.<\/li>\n<li>Restart your PC.<\/li>\n<li>After installation, run <code>vagrant --version<\/code> from the command prompt and the following version information will be displayed.<\/li>\n<\/ol>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2440 aligncenter\" style=\"max-width: 98%;\" src=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-en.png\" alt=\"\" width=\"475\" height=\"225\" srcset=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-en.png 475w, https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-en-300x142.png 300w\" sizes=\"auto, (max-width: 475px) 100vw, 475px\" \/><\/p>\n<h2>Installing the KUSANAGI Vagrant Box<\/h2>\n<h3>Launch the command prompt:<\/h3>\n<p>Execute the following commands:<\/p>\n<ol>\n<li><code>mkdir kusanagi<\/code>(Create a directory with name of your choice, i which the Vagrantfile will be created)<\/li>\n<li><code>cd kusanagi<\/code> (Move to the new directory)<\/li>\n<li><code>vagrant init primestrategy\/kusanagi<\/code>(Create Vagrantfile)<\/li>\n<\/ol>\n<p>Leave the command prompt open.<\/p>\n<h3>Edit the Vagrantfile<\/h3>\n<p>Open the Vagrantfile in an editor and make the changes below.<br \/>\nThis allows you to set the SSH connection port, and enable communication between the host OS and guest OS.<\/p>\n<p>1. To modify the vagrantfile.<\/p>\n<p>Before:<\/p>\n<pre>\r\n# config.vm.network \"private_network\", ip: \"192.168.33.10\"\r\n<\/pre>\n<p>After:<\/p>\n<pre>\r\nconfig.vm.network \"private_network\", ip: \"192.168.33.10\"\r\nconfig.vm.provider \"virtualbox\" do |vb|\r\n  vb.customize [\"modifyvm\", :id, \"--memory\", \"1024\"]\r\nend\r\n<\/pre>\n<p>*This configuration sets the memory to &#8220;1024&#8221;. To increase the memory setting, please confirming the memory capacity in your computer. <\/p>\n<p>2. Save the Vagrantfile.<\/p>\n<h2>Launch the virtual machine<\/h2>\n<p>Execute <code>vagrant up<\/code> from the command prompt. If there is a problem, make sure that your current directory is the same directory as the one that the Vargrantfile is in.<\/p>\n<p>Once the virtual machine has launched, use an SSH client to log in as a guest with the following info:<br \/>\nPort number: 22<br \/>\nUser name: vagrant<br \/>\nPassword: vagrant<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2019\/04\/poderosa.png\" alt=\"\" width=\"332\" height=\"559\" class=\"aligncenter size-full wp-image-2751\" srcset=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2019\/04\/poderosa.png 332w, https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2019\/04\/poderosa-178x300.png 178w\" sizes=\"auto, (max-width: 332px) 100vw, 332px\" \/><\/p>\n<h2>KUSANAGI initialization and provisioning<\/h2>\n<p>After successfully logging in, the screen below will be displayed.<br \/>\nYou are logged is as a &#8216;vagrant&#8217; user right after SSH login, so use <code>$ sudo su -<\/code> to switch to &#8216;root&#8217; user.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-2444 alignnone\" src=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-kusanagi.png\" alt=\"\" width=\"699\" height=\"329\" srcset=\"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-kusanagi.png 699w, https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-content\/uploads\/2018\/07\/vagrant-v-kusanagi-300x141.png 300w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/p>\n<p>Read the following document for the initialization procedure:<\/p>\n<p><input type=\"button\" value=\"KUSANAGI Initialization\"  onclick=\"location.href='https:\/\/kusanagi.tokyo\/en-kusanagi8\/document\/kusanagi-init\/'\" \/><\/p>\n<p>After running <code>kusanagi provision<\/code> as in the instructions above, adding the following code to the hosts file on the host OS(Windows) will allow you to view a KUSANAGI site built on the guest OS from a browser on the host OS.<\/p>\n<pre>192.168.33.10 {FQDN name set during kusanagi provisioning}\r\n<\/pre>\n<p>*Microsoft Edge isn&#8217;t able to access FQDN that you set up on provisioning. Please use another browser to access. Reference: <a href=\"https:\/\/answers.microsoft.com\/en-us\/insider\/forum\/insider_internet-insider_spartan\/edge-not-displaying-sites-hosted-in-vagrant\/41a34b7b-7d79-4866-acf3-739a9efd1680\" target=\"_blank\" rel=\"noopener noreferrer\">Edge\u00a0not\u00a0displaying\u00a0sites\u00a0hosted\u00a0in\u00a0vagrant<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Notable features Install KUSANAGI without depending on the OS Easily set up KUSANAGI environment Set up KUSANAGI on a local PC Focus on development\/verification without worrying about affecting other developers Install outline Install VirtualBox Install Vagrant Install the KUSANAGI Vagrant Box *This guide was written for Windows, but can also be used for MacOS and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":49,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-2437","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/pages\/2437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/comments?post=2437"}],"version-history":[{"count":13,"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/pages\/2437\/revisions"}],"predecessor-version":[{"id":3779,"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/pages\/2437\/revisions\/3779"}],"up":[{"embeddable":true,"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/pages\/49"}],"wp:attachment":[{"href":"https:\/\/kusanagi.tokyo\/en-kusanagi8\/wp-json\/wp\/v2\/media?parent=2437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}