{"id":17,"date":"2020-05-17T16:34:42","date_gmt":"2020-05-17T07:34:42","guid":{"rendered":"http:\/\/software.satoshis.jp\/?p=17"},"modified":"2024-11-05T01:00:30","modified_gmt":"2024-11-04T16:00:30","slug":"virtualboxvagrant%e3%81%a7%e3%81%8a%e6%89%8b%e8%bb%bd%e3%81%aa%e9%96%8b%e7%99%ba%e7%92%b0%e5%a2%83%e3%82%92%e6%a7%8b%e7%af%89","status":"publish","type":"post","link":"https:\/\/software.satoshis.jp\/?p=17","title":{"rendered":"VirtualBox+Vagrant\u3067\u304a\u624b\u8efd\u306a\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9"},"content":{"rendered":"<h2>\u6982\u8981<\/h2>\n<p>Web\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3059\u308b\u3068\u304d\u3001Web\u30a2\u30d7\u30ea\u6bce\u306b\u3044\u308d\u3044\u308d\u3068\u74b0\u5883\u304c\u7570\u306a\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u5408\u308f\u305b\u305f\u30b5\u30fc\u30d0\u30fc\u3092\u7528\u610f\u3059\u308b\u306e\u306f\u624b\u9593\u304c\u304b\u304b\u308b\u3002<\/p>\n<p>\u305d\u308c\u3092\u89e3\u6c7a\u3059\u308b\u306e\u304cVirtualBox+Vagrant\u3002<\/p>\n<p>ViatualBox\u306fOracle\u304c\u63d0\u4f9b\u3059\u308b\u4eee\u60f3\u74b0\u5883\u3002\u30db\u30b9\u30c8OS\u4e0a\u3067\u5225\u306eOS\uff08\u30b2\u30b9\u30c8OS\uff09\u3092\u5b9f\u884c\u3067\u304d\u308b\u3002<\/p>\n<p>\u4e00\u822c\u7684\u306b\u30b5\u30fc\u30d0\u30fc\u3067\u7528\u3044\u308bOS\u3068\u3057\u3066\u306f\u3001Linux\u7cfb\u306eCentOS\u304c\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u591a\u3044\u3002<\/p>\n<p>\u624b\u5143\u306eMacOSX\u306bVirtualBox+Vagrant\u3092\u69cb\u7bc9\u3057\u3066\u307f\u305f\u306e\u3067\u3001\u305d\u306e\u624b\u9806\u3092\u30e1\u30e2\u3057\u3068\u304f\u3002<\/p>\n<h2>VirtualBox\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>\u3053\u3061\u3089\u2192<a href=\"https:\/\/www.virtualbox.org\/wiki\/Downloads\" target=\"_blank\" rel=\"noopener noreferrer\">Downloads &#8211; Oracle VM Virtulbox<\/a>\u00a0\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3002<\/p>\n<p>\u305d\u308c\u3060\u3051\u3002<\/p>\n<h2>Vagrant\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h2>\n<p>Mac\u306e\u5834\u5408\u306fbrew\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u304b\u3082\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ brew cask install vagrant\r\n<\/pre>\n<p>Windows\u306e\u5834\u5408\u306f\u3001<a href=\"https:\/\/www.vagrantup.com\/\" target=\"_blank\" rel=\"noopener\">Vagrant<\/a>\u306b\u884c\u3063\u3066\u3001Windows\u7248\u30d0\u30a4\u30ca\u30ea\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30b2\u30b9\u30c8OS\u306e\u8ffd\u52a0<\/h2>\n<p>VirtualBox\u3068Vagrant\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u308f\u3063\u305f\u3089\u3001\u4eee\u60f3\u74b0\u5883\u3092\u4f7f\u3048\u308b\u6e96\u5099\u304c\u3067\u304d\u305f\u3002<\/p>\n<p>\u6b21\u306f\u30b2\u30b9\u30c8OS\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<p>\u30b2\u30b9\u30c8OS\u306fBox\u30d5\u30a1\u30a4\u30eb\u3068\u3044\u3046\u5f62\u5f0f\u3067\u7ba1\u7406\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u3059\u3067\u306b\u591a\u304f\u306e\u4eba\u9054\u304cBox\u30d5\u30a1\u30a4\u30eb\u3092\u7528\u610f\u3057\u3066\u304f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u308c\u3092\u4f7f\u3046\u306e\u304c\u7c21\u5358\u3002\u5143\u6c17\u304c\u3042\u308b\u306a\u3089\u81ea\u5206\u3067\u4f5c\u308b\u3053\u3068\u3082\u53ef\u80fd\u3060\u3051\u3069\u3002<\/p>\n<p><a href=\"https:\/\/app.vagrantup.com\/boxes\/search\">https:\/\/app.vagrantup.com\/boxes\/search<\/a>\u00a0\u306b\u3055\u307e\u3056\u307e\u306aBox\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>\u4eca\u56de\u306f\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067Laravel\u3092\u4f7f\u3063\u305fWeb\u30a2\u30d7\u30ea\u3092\u4f5c\u308a\u305f\u3044\u306e\u3067\u3001\u300claravel\/homestead\u300d\u3092\u4f7f\u3046\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vagrant box add laravel\/homestead\r\n==&gt; box: Loading metadata for box &#039;laravel\/homestead&#039;\r\nbox: URL: https:\/\/vagrantcloud.com\/laravel\/homestead\r\nThis box can work with multiple providers! The providers that it\r\ncan work with are listed below. Please review the list and choose\r\nthe provider you will be working with.\r\n\r\n1) hyperv\r\n2) parallels\r\n3) virtualbox\r\n4) vmware_desktop\r\n\r\nEnter your choice: 3\r\n==&gt; box: Adding box &#039;laravel\/homestead&#039; (v9.5.1) for provider: virtualbox\r\nbox: Downloading: https:\/\/vagrantcloud.com\/laravel\/boxes\/homestead\/versions\/9.5.1\/providers\/virtualbox.box\r\nDownload redirected to host: vagrantcloud-files-production.s3.amazonaws.com\r\nbox: Calculating and comparing box checksum...\r\n==&gt; box: Successfully added box &#039;laravel\/homestead&#039; (v9.5.1) for &#039;virtualbox&#039;!\r\n<\/pre>\n<p>Box\u30a4\u30e1\u30fc\u30b8\u306e\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u306b\u5c11\u3005\u6642\u9593\u304c\u304b\u304b\u308b\u3051\u3069\u3001\u30b3\u30de\u30f3\u30c91\u884c\u3067\u30b2\u30b9\u30c8OS\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u5b8c\u4e86\u3057\u3066\u3057\u307e\u3046\u3002<br \/>\n\u4fbf\u5229\uff01<\/p>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u305f\u3053\u3068\u3092\u30b3\u30de\u30f3\u30c9\u3067\u78ba\u8a8d\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vagrant box list\r\nlaravel\/homestead (virtualbox, 9.5.1)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Box\u304c\u8ffd\u52a0\u3055\u308c\u305f\u3051\u3069\u3001\u6700\u521d\u306b\u521d\u671f\u5316\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u521d\u671f\u5316\u3059\u308b\u3068Vagrantfile\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u3089\u308c\u308b\u3002<\/p>\n<p>\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u306e\u8a2d\u5b9a\u306a\u3069\u304c\u66f8\u304b\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u30d5\u30a9\u30eb\u30c0\u3092\u5206\u3051\u3066\u7ba1\u7406\u3059\u308b\u306e\u304c\u3088\u3055\u305d\u3046\u306a\u306e\u3067\u3001\u5148\u306b\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3057\u3066\u3001\u305d\u306e\u4e2d\u3067\u521d\u671f\u5316\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ mkdir laravel\r\n$ cd laravel\r\n$ vagrant init laravel\/homestead\r\nA `Vagrantfile` has been placed in this directory. You are now\r\nready to `vagrant up` your first virtual environment! Please read\r\nthe comments in the Vagrantfile as well as documentation on\r\n`vagrantup.com` for more information on using Vagrant.\r\n<\/pre>\n<p>Vagrantfile\u304c\u4f5c\u3089\u308c\u305f\u306e\u3067\u3001\u3053\u308c\u3092\u5c11\u3057\u7de8\u96c6\u3059\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vi Vagrantfile\r\n<\/pre>\n<p>\u30cf\u30a4\u30e9\u30a4\u30c8\u3057\u3066\u3044\u308b\u884c\u306e\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u5916\u3059\u3002<\/p>\n<pre class=\"brush: plain; highlight: [5,14]; title: ; notranslate\" title=\"\">\r\n  # Create a forwarded port mapping which allows access to a specific port\r\n  # within the machine from a port on the host machine. In the example below,\r\n  # accessing &quot;localhost:8080&quot; will access port 80 on the guest machine.\r\n  # NOTE: This will enable public access to the opened port\r\n  config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080\r\n\r\n  # Create a forwarded port mapping which allows access to a specific port\r\n  # within the machine from a port on the host machine and only allow access\r\n  # via 127.0.0.1 to disable public access\r\n  # config.vm.network &quot;forwarded_port&quot;, guest: 80, host: 8080, host_ip: &quot;127.0.0.1&quot;\r\n\r\n  # Create a private network, which allows host-only access to the machine\r\n  # using a specific IP.\r\n  config.vm.network &quot;private_network&quot;, ip: &quot;192.168.33.10&quot;\r\n<\/pre>\n<h2>\u30b2\u30b9\u30c8OS\u306e\u8d77\u52d5<\/h2>\n<p>\u30b2\u30b9\u30c8OS\u3092\u8d77\u52d5\u3059\u308b\u306e\u3082\u30b3\u30de\u30f3\u30c9\u4e00\u767a\uff01<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vagrant up\r\nBringing machine &#039;default&#039; up with &#039;virtualbox&#039; provider...\r\n==&gt; default: Checking if box &#039;laravel\/homestead&#039; version &#039;9.5.1&#039; is up to date...\r\n==&gt; default: Clearing any previously set network interfaces...\r\n==&gt; default: Preparing network interfaces based on configuration...\r\n    default: Adapter 1: nat\r\n    default: Adapter 2: hostonly\r\n==&gt; default: Forwarding ports...\r\n    default: 80 (guest) =&gt; 8080 (host) (adapter 1)\r\n    default: 22 (guest) =&gt; 2222 (host) (adapter 1)\r\n==&gt; default: Booting VM...\r\n==&gt; default: Waiting for machine to boot. This may take a few minutes...\r\n    default: SSH address: 127.0.0.1:2222\r\n    default: SSH username: vagrant\r\n    default: SSH auth method: private key\r\n    default: Warning: Connection reset. Retrying...\r\n    default: Warning: Remote connection disconnect. Retrying...\r\n    default:\r\n    default: Vagrant insecure key detected. Vagrant will automatically replace\r\n    default: this with a newly generated keypair for better security.\r\n    default:\r\n    default: Inserting generated public key within guest...\r\n    default: Removing insecure key from the guest if it&#039;s present...\r\n    default: Key inserted! Disconnecting and reconnecting using new SSH key...\r\n==&gt; default: Machine booted and ready!\r\n==&gt; default: Checking for guest additions in VM...\r\n    default: The guest additions on this VM do not match the installed version of\r\n    default: VirtualBox! In most cases this is fine, but in rare cases it can\r\n    default: prevent things such as shared folders from working properly. If you see\r\n    default: shared folder errors, please make sure the guest additions within the\r\n    default: virtual machine match the version of VirtualBox you have installed on\r\n    default: your host and reload your VM.\r\n    default:\r\n    default: Guest Additions Version: 6.0.0 r127566\r\n    default: VirtualBox Version: 6.1\r\n==&gt; default: Configuring and enabling network interfaces...\r\n==&gt; default: Mounting shared folders...\r\n    default: \/vagrant =&gt; (\u4f5c\u696d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\/laravel\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>ssh\u3067\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u307f\u308b\u3002<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n$ vagrant ssh\r\nWelcome to Ubuntu 18.04.4 LTS (GNU\/Linux 4.15.0-96-generic x86_64)\r\n\r\nThanks for using\r\n _                               _                 _\r\n| |                             | |               | |\r\n| |__   ___  _ __ ___   ___  ___| |_ ___  __ _  __| |\r\n| &#039;_ \\ \/ _ \\| &#039;_ ` _ \\ \/ _ \\\/ __| __\/ _ \\\/ _` |\/ _` |\r\n| | | | (_) | | | | | |  __\/\\__ \\ ||  __\/ (_| | (_| |\r\n|_| |_|\\___\/|_| |_| |_|\\___||___\/\\__\\___|\\__,_|\\__,_|\r\n\r\n* Homestead v10.8.0\r\n* Settler v9.5.1 (Virtualbox, Parallels, Hyper-V, VMware)\r\n\r\n0 packages can be updated.\r\n0 updates are security updates.\r\n\r\n\r\nvagrant@vagrant:~$\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981 Web\u30a2\u30d7\u30ea\u3092\u69cb\u7bc9\u3059\u308b\u3068\u304d\u3001Web\u30a2\u30d7\u30ea\u6bce\u306b\u3044\u308d\u3044\u308d\u3068\u74b0\u5883\u304c\u7570\u306a\u308b\u306e\u3067\u3001\u305d\u308c\u306b\u5408\u308f\u305b\u305f\u30b5\u30fc\u30d0\u30fc\u3092\u7528\u610f\u3059\u308b\u306e\u306f\u624b\u9593\u304c\u304b\u304b\u308b\u3002 \u305d\u308c\u3092\u89e3\u6c7a\u3059\u308b\u306e\u304cVirtualBox+Vagrant\u3002 Viatua &#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,4],"class_list":["post-17","post","type-post","status-publish","format-standard","hentry","category-tools","tag-vagrant","tag-virtualbox"],"nelio_content":{"autoShareEndMode":"never","automationSources":{"useCustomSentences":false,"customSentences":[]},"efiAlt":"","efiUrl":"","followers":[1],"highlights":[],"isAutoShareEnabled":true,"networkImageIds":[],"permalinkQueryArgs":[],"series":[],"suggestedReferences":[]},"views":1226,"_links":{"self":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=17"}],"version-history":[{"count":6,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions"}],"predecessor-version":[{"id":468,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/17\/revisions\/468"}],"wp:attachment":[{"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=17"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=17"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/software.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}