在windows中使用vagrant

妙音 posted @ 2015年11月13日 21:02 in vagrant with tags vagrant;virtualbox , 6475 阅读
  • 介绍
vagrant封装linux开发环境,可以统一团队成员的开发环境。封装后,可以linux/windows/mac上运行.
  • 环境
以win8安装vagrant为例子。vagrant需要virtualbox提供虚拟化支持,因此先安装virtualbox。
  • 安装
https://www.vagrantup.com/downloads.html
  • vagrant镜像
vagrant镜像下载地址
 
http://www.vagrantbox.es/
 
以centos-7.0为例子,下载地址
 
https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.1.0/centos-7.0-x86_64.box
  • 新建目录
D:\vagrant\centos
 
下载后的centos-7.0-x86_64.box放到此目录
  • 添加box
D:\vagrant\centos>vagrant box add --name centos7 .\centos-7.0-x86_64.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'centos7' (v0) for provider:
    box: Unpacking necessary files from: file://D:/vagrant/centos/centos-7.0-x86
_64.box
    box: Progress: 100% (Rate: 48.1M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'centos7' (v0) for 'virtualbox'!
  • 查看box列表
D:\vagrant\centos>vagrant box list
centos7            (virtualbox, 0)
  • 初始化工作目录
D:\vagrant\centos>vagrant init centos7
  • 启动
D:\vagrant\centos>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Mounting shared folders...
    default: /vagrant => D:/vagrant/centos
==> default: Machine already provisioned. Run `vagrant provision` or use the `--
provision`
==> default: flag to force provisioning. Provisioners marked to run always will
still run.
  • 安装ssh工具
 
启动之后,登录系统需要ssh,windows没有ssh,可以安装copssh。安装后,再将ssh.exe路径配置到环境变量中。
 
https://www.itefix.net/content/copssh-free-edition
  • 登录
D:\vagrant\centos>vagrant ssh
cygwin warning:
  MS-DOS style path detected: D:/vagrant/centos/.vagrant/machines/default/virtua
lbox/private_key
  Preferred POSIX equivalent is: /cygdrive/d/vagrant/centos/.vagrant/machines/de
fault/virtualbox/private_key
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Last login: Thu Nov  5 03:10:24 2015 from 10.0.2.2
Welcome to your Vagrant-built virtual machine.
[vagrant@localhost ~]$ 
使用其它工具登录,初始账号是vagrant/vagrant
  • 关闭
D:\vagrant\centos>vagrant halt
==> default: Attempting graceful shutdown of VM...
  • vagrant命令
vagrant up  启动
vagrant halt 普通关闭
vagrant ssh 连接
vagrant suspend 休眠
vagrant reload  重启
vagrant destroy 删除
vagrant box add --name box_name /path/of/box/file #添加本地box
 
Avatar_small
the fate reviews 说:
2020年12月16日 16:01

i am always looking for some free stuffs over the internet. there are also some companies which gives free samples.

Avatar_small
dumpster rental segu 说:
2020年12月16日 19:00

You make so many great points here that I read your article a couple of times. Your views are in accordance with my own for the most part. This is great content for your readers. <a href="https://www.gojbar.com/seguin">dumpster rental seguin tx</a>

Avatar_small
Microsoft Lync Users 说:
2020年12月16日 21:30

This particular papers fabulous, and My spouse and i enjoy each of the perform that you have placed into this. I’m sure that you will be making a really useful place. I has been additionally pleased. Good perform!

Avatar_small
Mattress Protectors 说:
2020年12月19日 21:45

Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.

Avatar_small
Cannabis Concentrate 说:
2020年12月21日 19:01

I got what you mean , thanks for posting .Woh I am happy to find this website through google.

Avatar_small
Cannabis concentrate 说:
2020年12月21日 21:36

Everything has its value. Thanks for sharing this informative information with us. GOOD works!

Avatar_small
Robinjack 说:
2020年12月23日 17:32

For ice cream program, you would love your activities with long term ice cream flavors along with flavors of month sub method and significantly far more other system. You would get every month new taste of month for ice cream under flavor of month subprograms. Other subprograms are sherbets, rotators, sorbets, ices, small fats and yogurts gone nuts. types of medical mask

Avatar_small
ยิงปลาพารวย 说:
2020年12月26日 15:45

Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck.

Avatar_small
YouTube Vanced 说:
2021年1月03日 16:45

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. <a href="http://cummingselectriccompany.com/a-solution-to-produce-youtube-films-load-fast/">YouTube Vanced</a>

Avatar_small
satta king online 说:
2021年1月07日 17:18

Hello, this weekend is good for me, since this time i am reading this enormous informative article here at my home. <a href="http://vedadate.com/member/blog_post_view.php?postId=94791">satta king online</a>

Avatar_small
Pg Slot เครดิตฟรี 说:
2021年1月08日 20:14

Instantly that web site could possibly irrefutably finish up popular concerning just about every publishing some people, on account of conscientious articles or blog posts in addition to opinions in addition to reviews.

Avatar_small
pop ups 说:
2021年1月09日 22:43

You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!! <a href="https://popfay.com/">pop ups</a>

Avatar_small
гидра онион 说:
2021年1月09日 23:15

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best.

Avatar_small
Solution Manual for 说:
2021年1月11日 16:11

It can be as well a considerable position i incredibly savored surfing around. Isn't really day by day that supply the candidate to watch a specific thing.

Avatar_small
Nowpia 说:
2023年7月11日 20:22

I ran across your site last week and started to follow your posts consistently. I haven’t commented on any kind of blog site just yet but I was considering to start soon. It’s truly exciting to actually contribute to an article even if it’s only a blog. I really don’t know exactly what to write other than I really loved reading through a couple of of your articles. Great articles for sure. I will keep visiting your blog regularly. I learned a lot from you. Thanks!

Avatar_small
best headphones revi 说:
2023年7月15日 11:47

I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much.

Avatar_small
MTCSE Exam Dumps 说:
2023年7月24日 20:57

Preparing for the pdf exam can be daunting, but CertsQuestions simplifies the process with its comprehensive collection of exam questions in PDF format. These questions are meticulously crafted to cover the key topics and concepts you need to master to ace the exam. By practicing with these exam questions, you'll gain the confidence and knowledge necessary to tackle the real test.
<a href="https://www.certsquestions.com/1Z0-1116-23-pdf-dumps.html">1Z0-1116-23 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/1Z0-1118-23-pdf-dumps.html">1Z0-1118-23 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/1Z0-1111-23-pdf-dumps.html">1Z0-1111-23 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/1Z0-1114-23-pdf-dumps.html">1Z0-1114-23 PDF Dumps</a><br/>

Avatar_small
1Z0-106 PDF Dumps 说:
2023年7月24日 20:58

Looking for a simple and effective way to pass the 1Z0-106 exam? Look no further! With CertsQuestions, you can easily purchase and access 1Z0-106 PDF exam questions that will streamline your preparation and boost your chances of success.

Avatar_small
NSE7_ADA-6.3 PDF Que 说:
2023年7月24日 21:00

As a highly qualified and experienced professional, I offer premium NSE7_ADA-6.3 PDF dumps that will help you ace your exams and propel your career forward. Whether you're a student aiming for top grades or a professional seeking certification, my service is tailored to meet your needs.

Avatar_small
Dynaty search 说:
2023年8月04日 19:06

I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject.

Avatar_small
Dynaty search 说:
2023年8月05日 21:20

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with extra information? It is extremely helpful for me.

Avatar_small
SABA 说:
2023年8月22日 19:46

Oh my goodness! an excellent article dude. Many thanks However I am experiencing trouble with ur rss . Do not know why Not able to enroll in it. Will there be any person obtaining identical rss dilemma? Anyone who knows kindly respond. Thnkx pointclickcare cna login

Avatar_small
Exam Dumps 说:
2023年8月28日 20:03

CertsQuestions gives the most excellent and Substantial PDF Exam Dumps with affirmed questions & answers for Exam Dumps affirmations.
<a href="https://www.certsquestions.com/71301X-pdf-dumps.html">71301X PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/NSE5_FAZ-7.2-pdf-dumps.html">NSE5_FAZ-7.2 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/H19-338-pdf-dumps.html">H19-338 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/H19-110_V2.0-pdf-dumps.html">H19-110_V2.0 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/C_S4CS_2308-pdf-dumps.html">C_S4CS_2308 PDF Dumps</a><br/>
<a href="https://www.certsquestions.com/2V0-41.23-pdf-dumps.html">2V0-41.23 PDF Dumps</a><br/>

Avatar_small
C_S4CPR_2308 PDF Dum 说:
2023年8月28日 20:04

CertsQuestions gives the most excellent and Substantial C_S4CPR_2308 PDF Exam Dumps with affirmed questions & answers for Exam Dumps affirmations.

Avatar_small
POPM Dumps PDF 说:
2023年8月28日 20:07

CertsQuestions is the best stage for making POPM PDF Exam Questions. I have completed my all authentication test in the chief undertaking and have scored the top grade.

Avatar_small
1Z0-083 Exam Dumps 说:
2023年8月28日 20:09

Download the latest 1Z0-083 PDF Dumps questions from the part's area, and recall the questions and answers veritable pdf dumps preceding appearance in the authentic pdf dumps.

Avatar_small
CCA131 Dumps Exam 说:
2023年8月28日 20:10

Sure CertsQuestions offers this part and with no additional charges, it gives you the most strengthened Best CCA131 pdf dumps.

Avatar_small
DASSM PDF Exam Dumps 说:
2023年8月28日 20:11

CertsQuestions gives the best DASSM PDF Questions to complete any DASSM PDF Exam. All pdf questions are 100% certified and updated.

Avatar_small
jala 说:
2023年8月30日 18:58

I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. mcdonald's near my location

Avatar_small
Meghalaya 8th Class 说:
2023年9月11日 19:48

Meghalaya Board Textbooks 2024 for Hindi, English Medium Produced by NCERT are Upload on pdf format, NCERT has scanned, Rare old Editions of Textbooks and has made Available on Official Website, Meghalaya Board High School Students can Start their Studies immediately, All the Textbooks for These High School have been uploaded online,Meghalaya Board School Students can Start their Studies Meghalaya 8th Class Textbook 2024 immediately, All the Meghalaya Board 8th Textbooks 2024 for these two classes have been Uploaded Online. Students can Download them in English or Hindi, in PDF format from the official NCERT website linked below.

Avatar_small
Scrum PSPO-II PDF Ex 说:
2023年10月05日 20:31

Learn about the format and structure of your PSPO-II PDF Exam Dumps, including the number of questions and time limit.

Avatar_small
PSPO-III Exam Dumps 说:
2023年10月05日 20:32

Get our top PSPO-III pdf dumps tips to help you prepare and pass your PSPO-III exam dumps on the first try.

Avatar_small
Microsoft DP-203 Exa 说:
2023年10月05日 20:33

Enroll in our online /DP-203 pdf dumps prep courses to improve your chances of passing your exam.

Avatar_small
Cisco 350-401 Exam D 说:
2023年10月05日 20:34

Review and analyze your 350-401 PDF Exam Dumps results to identify areas where you need to improve.

Avatar_small
MB-800 Dumps PDF 说:
2023年10月05日 20:35

Practice for your MB-800 PDF Dumps with our MB-800 exam dumps, which include mock tests and practice questions.

Avatar_small
wirepost 说:
2023年11月17日 01:30

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.

Avatar_small
wirepost 说:
2023年11月17日 02:13

I really appreciate this wonderful post that you have provided for us. I assure this would be beneficial for most of the people.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter