website/docs: update getting started guide to use box directory

This commit is contained in:
Mitchell Hashimoto 2014-03-01 10:00:19 +01:00
parent 6d7315840c
commit 45b17571ae
5 changed files with 87 additions and 12 deletions

View File

@ -96,6 +96,7 @@
<li<%= sidebar_current("gettingstarted-syncedfolders") %>><a href="/v2/getting-started/synced_folders.html">Synced Folders</a></li>
<li<%= sidebar_current("gettingstarted-provisioning") %>><a href="/v2/getting-started/provisioning.html">Provisioning</a></li>
<li<%= sidebar_current("gettingstarted-networking") %>><a href="/v2/getting-started/networking.html">Networking</a></li>
<li<%= sidebar_current("gettingstarted-share") %>><a href="/v2/getting-started/share.html">Share</a></li>
<li<%= sidebar_current("gettingstarted-teardown") %>><a href="/v2/getting-started/teardown.html">Teardown</a></li>
<li<%= sidebar_current("gettingstarted-rebuild") %>><a href="/v2/getting-started/rebuild.html">Rebuild</a></li>
<li<%= sidebar_current("gettingstarted-providers") %>><a href="/v2/getting-started/providers.html">Providers</a></li>

View File

@ -23,17 +23,17 @@ under a specific name so that multiple Vagrant environments can re-use it.
If you haven't added a box yet, you can do so now:
```
$ vagrant box add precise32 \
http://files.vagrantup.com/precise32.box
$ vagrant box add hashicorp/precise32
```
This will download the box from an HTTP source and save it as "precise32"
in a directory that Vagrant manages (away from your project). You can also
add boxes from a local file path.
This will download the box named "hashicorp/precise32" from
[Vagrant Cloud](http://www.vagrantcloud.com), a place where you can find
and host boxes. While it is easiest to download boxes from Vagrant Cloud
you can also add boxes from a local file, custom URL, etc.
Added boxes can be re-used by multiple projects. Each project uses a box
as an initial image to clone from, and never modifies the actual base
image. This means that if you have two projects both using the `precise32`
image. This means that if you have two projects both using the `hashicorp/precise32`
box we just added, adding files in one guest machine will have no effect
on the other machine.
@ -45,12 +45,30 @@ contents to the following:
```ruby
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.box = "hashicorp/precise32"
end
```
The "precise32" in this case must match the name you used to add
the box above. This is how Vagrant knows what box to use.
The "hashicorp/precise32" in this case must match the name you used to add
the box above. This is how Vagrant knows what box to use. If the box wasn't
added before, Vagrant will automatically download and add the box when it is
run.
In the next section, we'll bring up the guest machine and interact
In the next section, we'll bring up the Vagrant environment and interact
with it a little bit.
## Finding More Boxes
For the remainder of this getting started guide, we'll only use the
"hashicorp/precise32" box we added previously. But soon after finishing
this getting started guide, the first question you'll probably have is
"where do I find more boxes?"
The best place to find more boxes is [Vagrant Cloud](http://www.vagrantcloud.com).
Vagrant Cloud has a public directory of freely available boxes that
run various platorms and technologies. Vagrant Cloud also has a great search
feature to allow you to find the box you care about.
In addition to finding free boxes, Vagrant Cloud lets you host your own
boxes, as well as private boxes if you intend on creating boxes for your
own organization.

View File

@ -34,7 +34,7 @@ Vagrant: Up and Running
## Up and Running
```
$ vagrant init precise32 http://files.vagrantup.com/precise32.box
$ vagrant init hashicorp/precise32
$ vagrant up
```

View File

@ -0,0 +1,56 @@
---
page_title: "Share - Getting Started"
sidebar_current: "gettingstarted-share"
---
# Share
Now that we have a web server up and running and accessible from your machine,
we have a fairly functional development environment. But in addition to
providing a development environment, Vagrant also makes it easy to share
and collaborate on these environments. The primary feature to do this in
Vagrant is called [Vagrant Share](/v2/share/index.html).
Vagrant Share lets you share your Vagrant environment to anyone around the
world. It will give you a URL that will route directly to your Vagrant
environment from any device in the world that is connected to the internet.
## Login to Vagrant Cloud
Before being able to share your Vagrant environment, you'll need an account on
[Vagrant Cloud](http://www.vagrantcloud.com). Don't worry, it's free.
Once you have an account, log in using `vagrant login`:
```
$ vagrant login:
Username or Email: mitchellh
Password (will be hidden):
You're now logged in!
```
## Share
Once you're logged in, run `vagrant share`:
```
$ vagrant share
...
==> default: Your Vagrant Share is running!
==> default: URL: http://frosty-weasel-0857.vagrantshare.com
...
```
Your URL will be different, so don't try the URL above. Instead, copy
the URL that `vagrant share` outputted for you and visit that in a web
browser. It should load the index page we setup in the previous pages.
Now, modify your "index.html" file and refresh the URL. It will be updated!
That URL is routing directly into your Vagrant environment, and works from
any device in the world that is connected to the internet.
To end the sharing session, hit `Ctrl+C` in your terminal. You can refresh
the URL again to verify that your environment is no longer being shared.
Vagrant Share is much more powerful than simply HTTP sharing. For more
details, see the [complete Vagrant Share documentation](/v2/share/index.html).

View File

@ -5,7 +5,7 @@ sidebar_current: "gettingstarted-up"
# Up And SSH
It is time to boot your first guest machine. Run the following:
It is time to boot your first Vagrant environment. Run the following:
```
$ vagrant up