{"id":196,"date":"2017-10-31T23:16:47","date_gmt":"2017-10-31T15:16:47","guid":{"rendered":"https:\/\/chenbing.name\/?p=196"},"modified":"2020-05-22T15:04:46","modified_gmt":"2020-05-22T07:04:46","slug":"%e8%a7%a3%e5%86%b3windows10%e5%ae%89%e8%a3%85vagrant2-0%e7%9a%84%e4%b8%80%e5%a0%86%e5%9d%91","status":"publish","type":"post","link":"https:\/\/chenbing.name\/blog\/196\/","title":{"rendered":"\u89e3\u51b3windows10\u5b89\u88c5vagrant2.0\u7684\u4e00\u5806\u5751"},"content":{"rendered":"<h2 id=\"vagrant2.0\u5b89\u88c5\u53ca\u4f7f\u7528\u9047\u5230\u7684\u5751\u53ca\u89e3\u51b3\u529e\u6cd5\"><span class=\"ez-toc-section\" id=\"vagrant20%E5%AE%89%E8%A3%85%E5%8F%8A%E4%BD%BF%E7%94%A8%E9%81%87%E5%88%B0%E7%9A%84%E5%9D%91%E5%8F%8A%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95\"><\/span>vagrant2.0\u5b89\u88c5\u53ca\u4f7f\u7528\u9047\u5230\u7684\u5751\u53ca\u89e3\u51b3\u529e\u6cd5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6478\u7d22\u534a\u5929\uff0c\u51e0\u6b32\u653e\u5f03\uff0c\u7ec8\u4e8e\u89e3\u51b3\u3002<\/p>\n<h3 id=\"\u9996\u5148\uff0c\u5b89\u88c5\u7684\u9047\u5230\u7684\u5751\"><span class=\"ez-toc-section\" id=\"%E9%A6%96%E5%85%88%EF%BC%8C%E5%AE%89%E8%A3%85%E7%9A%84%E9%81%87%E5%88%B0%E7%9A%84%E5%9D%91\"><\/span>\u9996\u5148\uff0c\u5b89\u88c5\u7684\u9047\u5230\u7684\u5751<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u540e\u9762\u8fd8\u6709\u4f7f\u7528\u7684\u5751<\/p>\n<h3 id=\"\u4e00\u3001\u5171\u4eab\u76ee\u5f55\u7684\u8bbe\u7f6e\u4e0d\u6210\u529f\"><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E5%85%B1%E4%BA%AB%E7%9B%AE%E5%BD%95%E7%9A%84%E8%AE%BE%E7%BD%AE%E4%B8%8D%E6%88%90%E5%8A%9F\"><\/span>\u4e00\u3001\u5171\u4eab\u76ee\u5f55\u7684\u8bbe\u7f6e\u4e0d\u6210\u529f<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3 id=\"\u9519\u8bef\u4e00\uff1a\"><span class=\"ez-toc-section\" id=\"%E9%94%99%E8%AF%AF%E4%B8%80%EF%BC%9A\"><\/span>\u9519\u8bef\u4e00\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<div>\n<pre><code>failed: No such file or directory (2)<\/code><\/pre>\n<\/div>\n<p>\u542f\u52a8\u62a5\u5171\u4eab\u76ee\u5f55\u8bbe\u7f6e\u51fa\u9519\uff0c\u5171\u4eab\u76ee\u5f55\u8bbe\u7f6e\u4e0d\u6210\u529f\u3002<\/p>\n<h4 id=\"\u539f\u56e0\uff1a\"><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E5%9B%A0%EF%BC%9A\"><\/span>\u539f\u56e0\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u65e0\u6cd5\u8bc6\u522bVagrantfile\u6587\u4ef6\u4e2d\u7684windows\u76ee\u5f55\u3002<\/p>\n<h4 id=\"\u89e3\u51b3\u529e\u6cd5\uff1a\"><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95%EF%BC%9A\"><\/span>\u89e3\u51b3\u529e\u6cd5\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u9700\u8981\u5b89\u88c5cygwin\uff0c\u4f7f\u7528\u66ff\u4ee3cmd\u3002<\/p>\n<hr>\n<h3 id=\"\u9519\u8bef\u4e8c\uff1a\"><span class=\"ez-toc-section\" id=\"%E9%94%99%E8%AF%AF%E4%BA%8C%EF%BC%9A\"><\/span>\u9519\u8bef\u4e8c\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5171\u4eab\u6587\u4ef6\u5939\u8bbe\u7f6e\u540e\u542f\u52a8vagrant\uff0c\u62a5\u9519\uff1a<\/p>\n<blockquote>\n<p>Vagrant was unable to mount VirtualBox shared folders. This is usually <br \/>\n  because the filesystem &#8220;vboxsf&#8221; is not available. This filesystem is <br \/>\n  made available via the VirtualBox Guest Additions and kernel module. <br \/>\n  Please verify that these guest additions are properly installed in the <br \/>\n  guest. This is not a bug in Vagrant and is usually caused by a faulty <br \/>\n  Vagrant box. For context, the command attempted was: <br \/>\n  mount -t vboxsf -o uid=1000,gid=1000 vagrant \/vagrant <br \/>\n  The error output from the command was: <br \/>\n  mount: unknown filesystem type &#8216;vboxsf&#8217;<\/p>\n<\/blockquote>\n<p>\u4f53\u5f0f\uff0c\u6302\u8f7d\u6587\u4ef6\u5939\u51fa\u9519\u3002<\/p>\n<h4 id=\"\u539f\u56e0\uff1a\"><span class=\"ez-toc-section\" id=\"%E5%8E%9F%E5%9B%A0%EF%BC%9A-2\"><\/span>\u539f\u56e0\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u9700\u8981\u5b89\u88c5VirtualBox\u7cfb\u7edf\u7684\u589e\u5f3a\u529f\u80fd\u8f6f\u4ef6VBoxGuestAdditions.iso<\/p>\n<h4 id=\"\u89e3\u51b3\u529e\u6cd5\uff1a\"><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3%E5%8A%9E%E6%B3%95%EF%BC%9A-2\"><\/span>\u89e3\u51b3\u529e\u6cd5\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h5 id=\"1.windows\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff08\u4eb2\u6d4b\uff09\"><span class=\"ez-toc-section\" id=\"1windows%E7%B3%BB%E7%BB%9F%E5%A4%84%E7%90%86%E6%96%B9%E6%A1%88%EF%BC%88%E4%BA%B2%E6%B5%8B%EF%BC%89\"><\/span>1.windows\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff08\u4eb2\u6d4b\uff09<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>\u5173\u95ed\u865a\u62df\u673a<\/p>\n<div>\n<pre><code>vagrant halt # \u5173\u95ed\u865a\u62df\u673a<\/code><\/pre>\n<\/div>\n<p>\u6253\u5f00VirtualBox\u7ba1\u7406\u9762\u677f\uff0c\u6253\u5f00vagrant\u4f7f\u7528\u7684\u865a\u62df\u673a\u201c\u8bbe\u7f6e\u201d\u529f\u80fd\uff0c\u5728\u201c\u5b58\u50a8\u201d\u9879\u76ee\u91cc\u6dfb\u52a0\u865a\u62df\u5149\u9a71\uff0c\u540c\u65f6\u865a\u62df\u5149\u9a71\u9009\u62e9VirtualBox\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684VBoxGuestAdditions.iso \u955c\u50cf\u6302\u8f7d\u3002 <br \/>\n<img decoding=\"async\" src=\"https:\/\/img.chenbing.name\/uploads\/2017\/11\/3f92f4df8c50ffaf77178ab46391e12e_eda8073f-b4c6-4245-aad8-f8fd8e19856c.png\" alt=\"\" title=\"\"><\/p>\n<p>\u7136\u540e\uff0c\u5728cygwin\u4e2d\u4f7f\u7528<\/p>\n<div>\n<pre><code>vagrant up<\/code><\/pre>\n<\/div>\n<p>\u91cd\u542f\u865a\u62df\u673a\uff0c\u5c31\u4e0d\u4f1a\u518d\u62a5\u8fd9\u4e2a\u9519\u8bef\u4e86\u3002<\/p>\n<h5 id=\"2.ubuntu\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff1a\"><span class=\"ez-toc-section\" id=\"2ubuntu%E7%B3%BB%E7%BB%9F%E5%A4%84%E7%90%86%E6%96%B9%E6%A1%88%EF%BC%9A\"><\/span>2.ubuntu\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<div>\n<pre><code>sudo apt-get update\nsudo apt-get install virtualbox-guest-utils<\/code><\/pre>\n<\/div>\n<p>\u4ee5\u4e0a\u4e24\u6761\u4ee3\u7801\uff0cubuntu\u7cfb\u7edf\u5c31\u5904\u7406\u597d\u4e86\u3002<\/p>\n<h5 id=\"3.centos\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff08linux\u53camac\u7248\uff09\"><span class=\"ez-toc-section\" id=\"3centos%E7%B3%BB%E7%BB%9F%E5%A4%84%E7%90%86%E6%96%B9%E6%A1%88%EF%BC%88linux%E5%8F%8Amac%E7%89%88%EF%BC%89\"><\/span>3.centos\u7cfb\u7edf\u5904\u7406\u65b9\u6848\uff08linux\u53camac\u7248\uff09<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<div>\n<pre><code>sudo yum update\nsudo yum install gcc\nsudo yum install kernel-devel\n\nexit #\u9000\u51fa\u865a\u62df\u673a\nvagrant halt # \u5173\u95ed\u865a\u62df\u673a<\/code><\/pre>\n<\/div>\n<p>\u7136\u540e\uff1a <br \/>\n\u52a0\u8f7d VBoxGuestAdditions.iso \u955c\u50cf\u5e76\u6302\u8f7d <br \/>\n\u8be5\u955c\u50cf\u4f4d\u4e8eVirtualBox\u5b89\u88c5\u6587\u4ef6\u5939\u4e0b\uff0c\u53ef\u4ee5\u5168\u6587\u4ef6\u641c\u7d22<\/p>\n<div>\n<pre><code>sudo find \/ -name VBoxGuestAdditions.iso <\/code><\/pre>\n<\/div>\n<p>\u5c06CD\u8fdb\u884c\u6302\u8f7d<\/p>\n<div>\n<pre><code>mount \/dev\/cdrom \/cdrom    #(\u8be5cdrom\u6587\u4ef6\u5939\u9700\u518d\/\u76ee\u5f55\u4e0b\u5148\u884c\u521b\u5efa)<\/code><\/pre>\n<\/div>\n<p>\u8fdb\u5165cdrom\u5e76\u8fd0\u884c\u76f8\u5173\u7a0b\u5e8f\u3002<\/p>\n<div>\n<pre><code>cd \/cdrom; \nsh .\/VBoxLinuxAdditions.run<\/code><\/pre>\n<\/div>\n<p>\u7b49\u5f85\u7a0b\u5e8f\u5b89\u88c5\u5b8c\u6bd5\uff0cVirtualBox\u589e\u5f3a\u529f\u80fd\u8f6f\u4ef6\u5c31\u5728\u7cfb\u7edf\u4e2d\u5b89\u88c5\u5b8c\u6bd5<\/p>\n<hr>\n<h3 id=\"windows\u4e0b\u4f7f\u7528\u7684\u5751\"><span class=\"ez-toc-section\" id=\"windows%E4%B8%8B%E4%BD%BF%E7%94%A8%E7%9A%84%E5%9D%91\"><\/span>windows\u4e0b\u4f7f\u7528\u7684\u5751<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4 id=\"\u5728windows\u4e0b\uff0c\u4f60\u9700\u8981\u5728cmd\u548ccygwin\u4e24\u4e2a\u5de5\u5177\u4e2d\u5207\u6362\u4f7f\u7528\u3002\"><span class=\"ez-toc-section\" id=\"%E5%9C%A8windows%E4%B8%8B%EF%BC%8C%E4%BD%A0%E9%9C%80%E8%A6%81%E5%9C%A8cmd%E5%92%8Ccygwin%E4%B8%A4%E4%B8%AA%E5%B7%A5%E5%85%B7%E4%B8%AD%E5%88%87%E6%8D%A2%E4%BD%BF%E7%94%A8%E3%80%82\"><\/span>\u5728windows\u4e0b\uff0c\u4f60\u9700\u8981\u5728cmd\u548ccygwin\u4e24\u4e2a\u5de5\u5177\u4e2d\u5207\u6362\u4f7f\u7528\u3002<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h5 id=\"1.cmd\u4e0b\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u5171\u4eab\u6587\u4ef6\u5939\uff0c\u5219\u4f7f\u7528\u65e0\u6cd5\u4f7f\u7528vagrant up\u547d\u4ee4\u3002\"><span class=\"ez-toc-section\" id=\"1cmd%E4%B8%8B%EF%BC%8C%E5%A6%82%E6%9E%9C%E8%AE%BE%E7%BD%AE%E4%BA%86%E5%85%B1%E4%BA%AB%E6%96%87%E4%BB%B6%E5%A4%B9%EF%BC%8C%E5%88%99%E4%BD%BF%E7%94%A8%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8vagrant_up%E5%91%BD%E4%BB%A4%E3%80%82\"><\/span>1.cmd\u4e0b\uff0c\u5982\u679c\u8bbe\u7f6e\u4e86\u5171\u4eab\u6587\u4ef6\u5939\uff0c\u5219\u4f7f\u7528\u65e0\u6cd5\u4f7f\u7528vagrant up\u547d\u4ee4\u3002<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<h5 id=\"2.\u5728cjgwin\u4e2d\uff0c\u53c8\u65e0\u6cd5\u4f7f\u7528vagrant box add \u6dfb\u52a0\u672c\u5730box.\"><span class=\"ez-toc-section\" id=\"2%E5%9C%A8cjgwin%E4%B8%AD%EF%BC%8C%E5%8F%88%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8vagrant_box_add_%E6%B7%BB%E5%8A%A0%E6%9C%AC%E5%9C%B0box\"><\/span>2.\u5728cjgwin\u4e2d\uff0c\u53c8\u65e0\u6cd5\u4f7f\u7528vagrant box add \u6dfb\u52a0\u672c\u5730box.<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<h5 id=\"\u53ea\u6709\u5207\u6362\u4f7f\u7528\uff0c\u86cb\u75bc\u3002\"><span class=\"ez-toc-section\" id=\"%E5%8F%AA%E6%9C%89%E5%88%87%E6%8D%A2%E4%BD%BF%E7%94%A8%EF%BC%8C%E8%9B%8B%E7%96%BC%E3%80%82\"><\/span>\u53ea\u6709\u5207\u6362\u4f7f\u7528\uff0c\u86cb\u75bc\u3002<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p><wiz_tmp_tag id=\"wiz-table-range-border\" contenteditable=\"false\" style=\"display: none;\"><\/p>\n<div id=\"wiz-table-col-line\" style=\"display: none;\"><\/div>\n<div id=\"wiz-table-row-line\" style=\"display: none;\"><\/div>\n<div id=\"wiz-table-range-border_start\" style=\"display: none;\">\n<div id=\"wiz-table-range-border_start_top\"><\/div>\n<div id=\"wiz-table-range-border_start_right\"><\/div>\n<div id=\"wiz-table-range-border_start_bottom\"><\/div>\n<div id=\"wiz-table-range-border_start_left\"><\/div>\n<div id=\"wiz-table-range-border_start_dot\"><\/div>\n<\/div>\n<div id=\"wiz-table-range-border_range\" style=\"display: none;\">\n<div id=\"wiz-table-range-border_range_top\"><\/div>\n<div id=\"wiz-table-range-border_range_right\"><\/div>\n<div id=\"wiz-table-range-border_range_bottom\"><\/div>\n<div id=\"wiz-table-range-border_range_left\"><\/div>\n<div id=\"wiz-table-range-border_range_dot\"><\/div>\n<\/div>\n<p><\/wiz_tmp_tag><\/p>\n","protected":false},"excerpt":{"rendered":"<p>vagrant2.0\u5b89\u88c5\u53ca\u4f7f\u7528\u9047\u5230\u7684\u5751\u53ca\u89e3\u51b3\u529e\u6cd5 \u6478\u7d22\u534a\u5929\uff0c\u51e0\u6b32\u653e\u5f03\uff0c\u7ec8\u4e8e\u89e3\u51b3\u3002 \u9996\u5148\uff0c\u5b89\u88c5\u7684\u9047\u5230\u7684\u5751 \u540e\u9762\u8fd8\u6709\u4f7f\u7528\u7684\u5751 \u4e00\u3001\u5171\u4eab\u76ee\u5f55\u7684\u8bbe\u7f6e\u4e0d\u6210\u529f \u9519\u8bef\u4e00\uff1a failed: No such file or directory (2) \u542f\u52a8\u62a5\u5171\u4eab\u76ee\u5f55\u8bbe\u7f6e\u51fa\u9519\uff0c\u5171\u4eab\u76ee\u5f55\u8bbe\u7f6e\u4e0d\u6210\u529f\u3002 \u539f\u56e0\uff1a \u65e0\u6cd5\u8bc6\u522bVagrantfile\u6587\u4ef6\u4e2d\u7684windows\u76ee\u5f55\u3002 \u89e3\u51b3\u529e\u6cd5\uff1a &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[91,4],"tags":[39],"class_list":["post-196","post","type-post","status-publish","format-standard","hentry","category-tech_tool","category-skill","tag-vagrant2-0"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/posts\/196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/comments?post=196"}],"version-history":[{"count":1,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/posts\/196\/revisions"}],"predecessor-version":[{"id":710,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/posts\/196\/revisions\/710"}],"wp:attachment":[{"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/media?parent=196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/categories?post=196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chenbing.name\/blog\/wp-json\/wp\/v2\/tags?post=196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}