{"id":385,"date":"2018-02-05T22:34:36","date_gmt":"2018-02-05T21:34:36","guid":{"rendered":"http:\/\/blog.chen-hongyi.com\/?p=385"},"modified":"2018-02-05T23:43:18","modified_gmt":"2018-02-05T22:43:18","slug":"%e5%9c%a8macbook-pro-2008-late-%e4%b8%8a%e8%bf%90%e8%a1%8cvagrant-ubuntu-14-box-%e5%90%af%e5%8a%a8%e7%89%b9%e5%88%ab%e6%85%a2%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/chen-hongyi.com\/?p=385","title":{"rendered":"\u5728macbook pro 2008 late \u4e0a\u8fd0\u884cVagrant + Ubuntu 14 Box \u542f\u52a8\u7279\u522b\u6162\u7684\u95ee\u9898"},"content":{"rendered":"<p>\u540c\u6837\u7684box\u5728thinkpad xbuntu\u4e0a\u8fd0\u884c\u5f88\u597d. \u653e\u5230\u5bb6\u91cc\u7684mbpro \u4e0a\u542f\u52a8\u5c31\u7279\u522b\u7684\u6162. vagarnt\u8bd5\u56fe\u542f\u52a8\u865a\u62df\u673a,\u6700\u540e\u8d85\u65f6\u653e\u5f03\u4e86. \u5982\u679c\u6253\u5f00gui\u89c2\u770bvbox\u8f93\u51fa\u7684\u8bdd,\u53ef\u4ee5\u770b\u5230\u7cfb\u7edf\u542f\u52a8\u65f6\u5019,\u5361\u5728\u91cc\u7f51\u5361\u542f\u52a8\u90a3\u91cc\u4e86.<br \/>\n\u663e\u793a <\/p>\n<p><code>cloud-init-nonet[4.54]: waiting 10 seconds for network device<br \/>\ncloud-init-nonet[14.57]: waiting 120 seconds for network device<br \/>\ncloud-init-nonet[134.57]: gave up waiting for a network device<\/code><\/p>\n<p>\u867d\u7136\u6700\u540evbox\u80fd\u8d77\u6765,\u4f46\u662fvagrant\u5df2\u7ecf\u6b47\u83dc\u4e86. <\/p>\n<p>vbox\u8d77\u6765\u540e,\u7528vagrant\u8eab\u4efd\u767b\u5f55(\u7528\u6237\u540d\u548c\u5bc6\u7801\u90fd\u662fvagrant), \u770b\u5230  \/etc\/network\/interfaces.d \u4e0b\u9762\u6709eth0. \u5185\u5bb9\u5982\u4e0b:<\/p>\n<p><code>auto eth0<br \/>\niface eth0 inet dhcp<\/code><\/p>\n<p>\u60f3\u5fc5\u5c31\u662f\u8fd9\u4e2adhcp\u62d6\u6162\u4e86\u542f\u52a8\u8fc7\u7a0b.<\/p>\n<p>&#8211;\u5f85\u7eed&#8211;<br \/>\n\u7b2c\u4e00\u6b21\u8bd5\u56fe\u89e3\u51b3<br \/>\n\u65e2\u7136\u7cfb\u7edf\u80fd\u8d77\u6765,\u6211\u4e5f\u4e0d\u662fdhcp\u90a3\u5c31\u522b\u7b49\u90a3\u4e48\u4e45\u4e86. \u901a\u8fc7\u4fee\u6539 failsafe\u7684\u6587\u4ef6\u6765\u7f29\u77ed\u7b49\u5f85\u65f6\u95f4. failsafe \u4f4d\u4e8e<br \/>\n\/etc\/init\/failsafe.conf  (<a href=\"https:\/\/askubuntu.com\/questions\/565083\/waiting-60-more-seconds-for-network-configuration\">\u6765\u6e90<\/a>, <a href=\"http:\/\/blog.csdn.net\/mountzf\/article\/details\/52098767\">\u6765\u6e902<\/a>) . \u4f46\u662f\u4f3c\u4e4e\u65e0\u6548.<\/p>\n<p>\u53e6\u5916\u4e00\u62db, \u957fvagrant \u7684 \u7b49\u5f85\u65f6\u95f4 (<a href=\"https:\/\/serverfault.com\/questions\/586059\/vagrant-error-connection-timeout-retrying\">\u6765\u6e90<\/a>), \u5728Vagrantfile\u91cc\u9762\u52a0\u4e0a\u4e00\u53e5<br \/>\n(\u9ed8\u8ba4300s)<br \/>\n<code>config.vm.boot_timeout = 600 <\/code><\/p>\n<p>&#8211;\u5f85\u7eed&#8211;<br \/>\n\u8bd5\u56fe\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898, \u770b\u5230<a href=\"https:\/\/dmsimard.com\/2014\/05\/02\/no-network-on-ubuntu-14-04-cloud-image-with-cloud-init\/\">\u8fd9\u91cc<\/a>\u6709\u7c7b\u4f3c\u7684\u95ee\u9898.\u4ed6\u8bf4\u5220\u6389eth0. \u6211\u5c1d\u8bd5\u4e86,\u4e0d\u884c.\u56e0\u4e3avagrant\u9700\u8981\u8fd9\u5757\u7f51\u5361\u8fdb\u884c\u901a\u8baf. \u5728NAT\u6a21\u5f0f\u4e0b,\u5b83\u4f1a\u88abvagrant\u8d4b\u4e88\u4e00\u4e2a 10.0.2.15 \u7684\u5730\u5740\u8fdb\u884c\u901a\u8baf. \u65e2\u7136dhcp\u5931\u8d25\u540e,\u4f1a\u8d4b\u4e88\u8fd9\u4e2aip,\u4e3a\u4f55\u4e0d\u5c31\u5199\u5728\u914d\u7f6e\u91cc\u5462.<br \/>\n\u6240\u4ee5,\u7b2c\u4e8c\u6b21\u5c1d\u8bd5\u4fee\u6539\u4e3a\u56fa\u5b9a\u5730\u5740<\/p>\n<p><code>auto eth0<br \/>\n#iface eth0 inet dhcp<br \/>\niface eth0 inet static<br \/>\naddress xxx.xxx.xxx.xxx<br \/>\nnetmask xxx.xxx.xxx.xxx<br \/>\ngateway xxx.xxx.xxx.xxx<\/code><br \/>\n\u867d\u7136\u4e5f\u80fd\u542f\u52a8,\u4f46\u662f\u7b49\u5f85\u65f6\u95f4\u8fd8\u662f\u90a3\u4e48\u957f. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u6837\u7684box\u5728thinkpad xbuntu\u4e0a\u8fd0\u884c\u5f88\u597d. \u653e\u5230\u5bb6\u91cc\u7684mbpro  &hellip; <a href=\"https:\/\/chen-hongyi.com\/?p=385\">\u7ee7\u7eed\u9605\u8bfb <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-385","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385"}],"version-history":[{"count":3,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":388,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions\/388"}],"wp:attachment":[{"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chen-hongyi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}