vagrant up 时间过长怎么让VirtualBox以服务方式运行,不出现VirtualBox界面

在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。
问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
按照官方文档进行安装 vagrant,一直卡在 vagrant up;操作系统: whidows 7
我的操作:
vagrant box add firstBox ./virtualbox.box
==& box: Box file was not detected as metadata. Adding it directly...
==& box: Adding box 'firstBox' (v0) for provider:
box: Unpacking necessary files from: file://C:/Users/liumeng/vagrant_get
ting_started/virtualbox.box
box: Progress: 100% (Rate: 687M/s, Estimated time remaining: --:--:--)
==& box: Successfully added box 'firstBox' (v0) for 'virtualbox'!
vagrant init fistBox
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
vagrant box list
$ vagrant box list
firstBox (virtualbox, 0)
vagrant up
// 一直不动,没有任何提示
大家有遇到这个问题吗?
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
Ctrl+C结束重新启动试试,还不行可以参考楼上的办法.
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:
在 SegmentFault,学习技能、解决问题
每个月,我们帮助 1000 万的开发者解决各种各样的技术问题。并助力他们在技术能力、职业生涯、影响力上获得提升。因为windows 7 64bit ,vagrant 的版本和VirtualBox 不匹配。vagrant up 后没有任何反映。问题 版本 VirtualBox 5.1.22 + vagrant 2.0.1没有问题版本 VirtualBox 5.1.22 + vagrant 1.9.5
阅读(...) 评论()vagrant up 启动虚拟机失败
Bringing machine 'default' up with 'virtualbox' provider...==& default: Box 'box-title' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: &= 0==& default: Box file was not detected as metadata. Adding it directly...==& default: Adding box 'box-title' (v0) for provider: virtualbox
default: An error occurred while downloading the remote file. The errormessage, if any, is reproduced below. Please fix this error and tryagain.Couldn't open file /D:/box/box-title
Copyright (C) 2018 imooc.com All Rights Reserved | 京ICP备 号-2Vagrant+Virtualbox 打造统一的部署环境添加之后 vagrant就有拥有一个名字叫做centos65的虚拟机3.初始化环境cd /vagrant/centos ##切换目录,随意
vagrant init centos65 ##为centos65初始化一个环境
执行命令后,/vagrant/centos目录下会有一个叫Vagrantfile的文件简单介绍一下这个配置文件:config.vm.network "private_network", ip: "192.168.33.10"
打开这段配置后,虚拟机会拥有一个为192.168.33.10的IP,宿主可以通过ssh访问到这个虚拟机。config.vm.synced_folder "../data", "/vagrant_data"
vagrant可以为虚拟机提供一个映射目录,这样可以很简便地为虚拟机与宿主之间共享文件config.vm.network "forwarded_port", guest: 80, host: 8080
打开这段注释后,表示将宿主的8080端口的TCP请求转发到虚拟机的80端口中config.vm.forwarded_port 80, 8080, protocol: "udp"
默认是转发TCP的请求,如果需要转发UDP的,要加上protoco4.启动虚拟机cd /vagrant/centos/centos65-x86_64.box
vagrant up
出现以下界面则表示成功了4收藏分享举报文章被以下专栏收录{&debug&:false,&apiRoot&:&&,&paySDK&:&https:\u002F\u002Fpay.zhihu.com\u002Fapi\u002Fjs&,&wechatConfigAPI&:&\u002Fapi\u002Fwechat\u002Fjssdkconfig&,&name&:&production&,&instance&:&column&,&tokens&:{&X-XSRF-TOKEN&:null,&X-UDID&:null,&Authorization&:&oauth c3cef7c66aa9e6a1e3160e20&}}{&database&:{&Post&:{&&:{&isPending&:false,&contributes&:[{&sourceColumn&:{&lastUpdated&:,&description&:&&,&permission&:&COLUMN_PUBLIC&,&memberId&:1777436,&contributePermission&:&COLUMN_PUBLIC&,&translatedCommentPermission&:&all&,&canManage&:true,&intro&:&&,&urlToken&:&c_&,&id&:19914,&imagePath&:&4b70deef7&,&slug&:&c_&,&applyReason&:&0&,&name&:&劲秋的技术小八卦&,&title&:&劲秋的技术小八卦&,&url&:&https:\u002F\u002Fzhuanlan.zhihu.com\u002Fc_&,&commentPermission&:&COLUMN_ALL_CAN_COMMENT&,&canPost&:true,&created&:,&state&:&COLUMN_NORMAL&,&followers&:2,&avatar&:{&id&:&4b70deef7&,&template&:&https:\u002F\u002Fpic3.zhimg.com\u002F{id}_{size}.jpg&},&activateAuthorRequested&:false,&following&:false,&imageUrl&:&https:\u002F\u002Fpic3.zhimg.com\u002F4b70deef7_l.jpg&,&articlesCount&:1},&state&:&accepted&,&targetPost&:{&titleImage&:&&,&lastUpdated&:,&imagePath&:&&,&permission&:&ARTICLE_PUBLIC&,&topics&:[708],&summary&:&可能大家都有遇到过,同一套代码,在你的电脑上出问题,但在我的电脑上却不会出问题。其实这都是因为部署环境的差异造成的。Vagrant+ Virtualbox就是解决这种问题的其中一套解决方案。1. 安装Vagrant和VitualBox首先Vagrant和Virtualbox的下载安装是很简单…&,&copyPermission&:&ARTICLE_COPYABLE&,&translatedCommentPermission&:&all&,&likes&:0,&origAuthorId&:0,&publishedTime&:&T12:43:15+08:00&,&sourceUrl&:&&,&urlToken&:,&id&:1123172,&withContent&:false,&slug&:,&bigTitleImage&:false,&title&:&Vagrant+Virtualbox 打造统一的部署环境&,&url&:&\u002Fp\u002F&,&commentPermission&:&ARTICLE_ALL_CAN_COMMENT&,&snapshotUrl&:&&,&created&:,&comments&:0,&columnId&:0,&content&:&&,&parentId&:0,&state&:&ARTICLE_PUBLISHED&,&imageUrl&:&&,&author&:{&bio&:&生活不可能像你想的那么美好,但也不会像你想的那么糟。&,&isFollowing&:false,&hash&:&044fdcd14f9dcd9fec03&,&uid&:44,&isOrg&:false,&slug&:&gantrylau&,&isFollowed&:false,&description&:&&,&name&:&刘剑秋&,&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fgantrylau&,&avatar&:{&id&:&v2-cdbed4ea6ddbb40c55ec571ec79db631&,&template&:&https:\u002F\u002Fpic4.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false},&memberId&:1777436,&excerptTitle&:&&,&voteType&:&ARTICLE_VOTE_CLEAR&},&id&:478135}],&title&:&Vagrant+Virtualbox 打造统一的部署环境&,&author&:&gantrylau&,&content&:&可能大家都有遇到过,同一套代码,在你的电脑上出问题,但在我的电脑上却不会出问题。其实这都是因为部署环境的差异造成的。Vagrant+ Virtualbox就是解决这种问题的其中一套解决方案。\u003Ch2\u003E1. 安装Vagrant和VitualBox\u003C\u002Fh2\u003E\u003Cp\u003E首先Vagrant和Virtualbox的下载安装是很简单的\u003C\u002Fp\u003E\u003Cp\u003EVagrant的下载地址:\u003Ca href=\&http:\u002F\u002Flink.zhihu.com\u002F?target=https%3A\u002F\u002Fwww.vagrantup.com\u002F\& class=\& wrap external\& target=\&_blank\& rel=\&nofollow noreferrer\&\u003EVagrant by HashiCorp\u003C\u002Fa\u003E\u003C\u002Fp\u003E\u003Cp\u003EVirtualbox的下载地址:\u003Ca href=\&http:\u002F\u002Flink.zhihu.com\u002F?target=https%3A\u002F\u002Fwww.virtualbox.org\u002F\& class=\& wrap external\& target=\&_blank\& rel=\&nofollow noreferrer\&\u003EOracle VM VirtualBox\u003C\u002Fa\u003E\u003C\u002Fp\u003E\u003Cp\u003E下载好直接安装就可以,此外还要下载官方封装好的镜像\u003C\u002Fp\u003E\u003Cp\u003Evagrantbox镜像的下载地址:\u003Ca href=\&http:\u002F\u002Flink.zhihu.com\u002F?target=http%3A\u002F\u002Fwww.vagrantbox.es\u002F\& class=\& wrap external\& target=\&_blank\& rel=\&nofollow noreferrer\&\u003EA list of base boxes for Vagrant\u003C\u002Fa\u003E\u003C\u002Fp\u003E\u003Ch2\u003E2. 添加镜像到Vagrant\u003C\u002Fh2\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Evagrant box add centos65 \u002Fvagrant\u002Fcentos\u002Fcentos65-x86_64.box\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E添加之后 vagrant就有拥有一个名字叫做centos65的虚拟机\u003Cbr\u003E\u003C\u002Fp\u003E\u003Ch1\u003E3.初始化环境\u003C\u002Fh1\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Ecd \u002Fvagrant\u002Fcentos ##切换目录,随意\nvagrant init centos65 ##为centos65初始化一个环境\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E执行命令后,\u002Fvagrant\u002Fcentos目录下会有一个叫Vagrantfile的文件\u003C\u002Fp\u003E\u003Cp\u003E简单介绍一下这个配置文件:\u003C\u002Fp\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Econfig.vm.network \&private_network\&, ip: \&192.168.33.10\&\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E打开这段配置后,虚拟机会拥有一个为192.168.33.10的IP,宿主可以通过ssh访问到这个虚拟机。\u003C\u002Fp\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Econfig.vm.synced_folder \&..\u002Fdata\&, \&\u002Fvagrant_data\&\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003Evagrant可以为虚拟机提供一个映射目录,这样可以很简便地为虚拟机与宿主之间共享文件\u003C\u002Fp\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Econfig.vm.network \&forwarded_port\&, guest: 80, host: 8080\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E打开这段注释后,表示将宿主的8080端口的TCP请求转发到虚拟机的80端口中\u003C\u002Fp\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Econfig.vm.forwarded_port 80, 8080, protocol: \&udp\&\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E默认是转发TCP的请求,如果需要转发UDP的,要加上protoco\u003Cbr\u003E\u003C\u002Fp\u003E\u003Ch1\u003E4.启动虚拟机\u003C\u002Fh1\u003E\u003Cdiv class=\&highlight\&\u003E\u003Cpre\u003E\u003Ccode class=\&language-text\&\u003E\u003Cspan\u003E\u003C\u002Fspan\u003Ecd \u002Fvagrant\u002Fcentos\u002Fcentos65-x86_64.box\nvagrant up\n\u003C\u002Fcode\u003E\u003C\u002Fpre\u003E\u003C\u002Fdiv\u003E\u003Cp\u003E出现以下界面则表示成功了\u003Cbr\u003E\u003C\u002Fp\u003E\u003Cfigure\u003E\u003Cnoscript\u003E\u003Cimg src=\&https:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_b.jpg\& data-rawwidth=\&768\& data-rawheight=\&537\& class=\&origin_image zh-lightbox-thumb\& width=\&768\& data-original=\&https:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_r.jpg\&\u003E\u003C\u002Fnoscript\u003E\u003Cimg src=\&data:image\u002Fsvg+utf8,&svg%20xmlns='http:\u002F\u002Fwww.w3.org\u002FFsvg'%20width='768'%20height='537'&&\u002Fsvg&\& data-rawwidth=\&768\& data-rawheight=\&537\& class=\&origin_image zh-lightbox-thumb lazy\& width=\&768\& data-original=\&https:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_r.jpg\& data-actualsrc=\&https:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_b.jpg\&\u003E\u003C\u002Ffigure\u003E&,&updated&:new Date(&T04:43:15.000Z&),&canComment&:false,&commentPermission&:&anyone&,&commentCount&:3,&collapsedCount&:0,&likeCount&:4,&state&:&published&,&isLiked&:false,&slug&:&&,&isTitleImageFullScreen&:false,&rating&:&none&,&titleImage&:&&,&links&:{&comments&:&\u002Fapi\u002Fposts\u002F2Fcomments&},&reviewers&:[],&topics&:[{&url&:&https:\u002F\u002Fwww.zhihu.com\u002Ftopic\u002F&,&id&:&&,&name&:&软件开发&}],&adminClosedComment&:false,&titleImageSize&:{&width&:0,&height&:0},&href&:&\u002Fapi\u002Fposts\u002F&,&excerptTitle&:&&,&tipjarState&:&inactivated&,&annotationAction&:[],&sourceUrl&:&&,&pageCommentsCount&:3,&hasPublishingDraft&:false,&snapshotUrl&:&&,&publishedTime&:&T12:43:15+08:00&,&url&:&\u002Fp\u002F&,&lastestLikers&:[{&bio&:&码弱,金字塔底层&,&isFollowing&:false,&hash&:&850c9d0826a4abcff59723&,&uid&:086700,&isOrg&:false,&slug&:&wucanheng&,&isFollowed&:false,&description&:&&,&name&:&canzhatian&,&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fwucanheng&,&avatar&:{&id&:&da8e974dc&,&template&:&https:\u002F\u002Fpic4.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false},{&bio&:&IT&,&isFollowing&:false,&hash&:&cfef2f7bd6febf1d4458&,&uid&:311200,&isOrg&:false,&slug&:&hjshang-shan-ruo-shui&,&isFollowed&:false,&description&:&要啥没啥……&,&name&:&HJ上善若水&,&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fhjshang-shan-ruo-shui&,&avatar&:{&id&:&ef8493fbb8e7ec62cefb5&,&template&:&https:\u002F\u002Fpic1.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false},{&bio&:&&,&isFollowing&:false,&hash&:&12a7f6d061&,&uid&:075600,&isOrg&:false,&slug&:&fake-wukong&,&isFollowed&:false,&description&:&&,&name&:&六耳&,&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Ffake-wukong&,&avatar&:{&id&:&v2-2dc814e95&,&template&:&https:\u002F\u002Fpic3.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false},{&bio&:&在美国&,&isFollowing&:false,&hash&:&7e322ae8dab9a30d3bb0&,&uid&:656100,&isOrg&:false,&slug&:&hu-la-la-94-88&,&isFollowed&:false,&description&:&&,&name&:&呼啦啦&,&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fhu-la-la-94-88&,&avatar&:{&id&:&da8e974dc&,&template&:&https:\u002F\u002Fpic4.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false}],&summary&:&\u003Cimg src=\&http:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_200x112.png\& data-rawwidth=\&768\& data-rawheight=\&537\& class=\&origin_image inline-img zh-lightbox-thumb\& data-original=\&http:\u002F\u002Fpic2.zhimg.com\u002F3bfe5eeadfbd879_r.png\&\u003E可能大家都有遇到过,同一套代码,在你的电脑上出问题,但在我的电脑上却不会出问题。其实这都是因为部署环境的差异造成的。Vagrant+ Virtualbox就是解决这种问题的其中一套解决方案。1. 安装Vagrant和VitualBox首先Vagrant和Virtualbox的下载安装是很简单…&,&reviewingCommentsCount&:0,&meta&:{&previous&:null,&next&:null},&annotationDetail&:null,&commentsCount&:3,&likesCount&:4,&FULLINFO&:true}},&User&:{&gantrylau&:{&isFollowed&:false,&name&:&刘剑秋&,&headline&:&&,&avatarUrl&:&https:\u002F\u002Fpic4.zhimg.com\u002Fv2-cdbed4ea6ddbb40c55ec571ec79db631_s.jpg&,&isFollowing&:false,&type&:&people&,&slug&:&gantrylau&,&bio&:&生活不可能像你想的那么美好,但也不会像你想的那么糟。&,&hash&:&044fdcd14f9dcd9fec03&,&uid&:44,&isOrg&:false,&description&:&&,&badge&:{&identity&:null,&bestAnswerer&:null},&profileUrl&:&https:\u002F\u002Fwww.zhihu.com\u002Fpeople\u002Fgantrylau&,&avatar&:{&id&:&v2-cdbed4ea6ddbb40c55ec571ec79db631&,&template&:&https:\u002F\u002Fpic4.zhimg.com\u002F{id}_{size}.jpg&},&isOrgWhiteList&:false,&isBanned&:false}},&Comment&:{},&favlists&:{}},&me&:{},&global&:{&experimentFeatures&:{&ge3&:&ge3_9&,&ge2&:&ge2_1&,&searchSectionStyle&:&loosen&,&androidPassThroughPush&:&all&,&newMore&:&new&,&nwebQAGrowth&:&experiment&,&nwebFeedAd&:&experiment&,&qawebRelatedReadingsContentControl&:&open&,&marketTabBanner&:&market_tab_banner_show&,&liveStore&:&ls_a2_b2_c1_f2&,&qawebThumbnailAbtest&:&new&,&nwebSearch&:&nweb_search_heifetz&,&searchHybridTabs&:&without-tabs&,&enableVoteDownReasonMenu&:&enable&,&showVideoUploadAttention&:&true&,&isOffice&:&false&,&enableTtsPlay&:&post&,&newQuestionDiversion&:&pause&,&wechatShareModal&:&wechat_share_modal_show&,&newLiveFeedMediacard&:&old&,&hybridZhmoreVideo&:&no&,&recommendationAbtest&:&new&,&nwebGrowthPeople&:&default&,&qrcodeLogin&:&qrcode&,&androidDbFollowRecommendHide&:&open&,&isShowUnicomFreeEntry&:&unicom_free_entry_off&,&newMobileColumnAppheader&:&new_header&,&androidDbCommentWithRepinRecord&:&open&,&feedHybridTopicRecomButtonIcon&:&yes&,&androidDbRecommendAction&:&open&,&zcmLighting&:&zcm&,&androidDbFeedHashTagStyle&:&button&,&appStoreRateDialog&:&close&,&topWeightSearch&:&new_top_search&,&default&:&None&,&isNewNotiPanel&:&no&,&androidDbRepinSelection&:&open&,&nwebRelatedAdvert&:&default&,&androidProfilePanel&:&panel_b&,&nwebWriteAnswer&:&experiment&}},&columns&:{&next&:{}},&columnPosts&:{},&columnSettings&:{&colomnAuthor&:[],&uploadAvatarDetails&:&&,&contributeRequests&:[],&contributeRequestsTotalCount&:0,&inviteAuthor&:&&},&postComments&:{},&postReviewComments&:{&comments&:[],&newComments&:[],&hasMore&:true},&favlistsByUser&:{},&favlistRelations&:{},&promotions&:{},&switches&:{&couldSetPoster&:false},&draft&:{&titleImage&:&&,&titleImageSize&:{},&isTitleImageFullScreen&:false,&canTitleImageFullScreen&:false,&title&:&&,&titleImageUploading&:false,&error&:&&,&content&:&&,&draftLoading&:false,&globalLoading&:false,&pendingVideo&:{&resource&:null,&error&:null}},&drafts&:{&draftsList&:[],&next&:{}},&config&:{&userNotBindPhoneTipString&:{}},&recommendPosts&:{&articleRecommendations&:[],&columnRecommendations&:[]},&env&:{&edition&:{&baidu&:false,&yidianzixun&:false,&qqnews&:false},&isAppView&:false,&appViewConfig&:{&content_padding_top&:128,&content_padding_bottom&:56,&content_padding_left&:16,&content_padding_right&:16,&title_font_size&:22,&body_font_size&:16,&is_dark_theme&:false,&can_auto_load_image&:true,&app_info&:&OS=iOS&},&isApp&:false,&userAgent&:{&ua&:&Mozilla\u002F5.0 (compatible, MSIE 11, Windows NT 6.3; Trident\u002F7.0; rv:11.0) like Gecko&,&browser&:{&name&:&IE&,&version&:&11&,&major&:&11&},&engine&:{&version&:&7.0&,&name&:&Trident&},&os&:{&name&:&Windows&,&version&:&8.1&},&device&:{},&cpu&:{}}},&message&:{&newCount&:0},&pushNotification&:{&newCount&:0}}

我要回帖

更多关于 vagrant up 时间过长 的文章

 

随机推荐