├── source ├── index.html.erb ├── favicon.ico ├── images │ ├── bullet_1.png │ ├── bullet_2.png │ ├── bullet_3.png │ ├── customers.png │ ├── logo_docs.png │ ├── logo_small.png │ ├── open_close.png │ ├── search_icon.png │ ├── icon_caution.png │ ├── logo_vagrant.png │ ├── customers_small.png │ ├── logo_docs_small.png │ ├── steps_background.png │ ├── footer_background.png │ ├── footer_hashi_logo.png │ ├── footer_vagrant_logo.png │ ├── get_started_background.png │ ├── sidebar_background_docs.png │ ├── sidebar_background_inner.png │ └── vagrant_header_background.png ├── v2 │ ├── other │ │ ├── index.html.md │ │ └── debugging.html.md │ ├── index.html.md │ ├── providers │ │ ├── custom.html.md │ │ ├── installation.html.md │ │ ├── default.html.md │ │ ├── index.html.md │ │ └── configuration.html.md │ ├── cli │ │ ├── resume.html.md │ │ ├── status.html.md │ │ ├── version.html.md │ │ ├── rsync.html.md │ │ ├── ssh_config.html.md │ │ ├── halt.html.md │ │ ├── suspend.html.md │ │ ├── rdp.html.md │ │ ├── provision.html.md │ │ ├── reload.html.md │ │ ├── init.html.md │ │ ├── connect.html.md │ │ ├── non-primary.html.md │ │ ├── index.html.md │ │ ├── ssh.html.md │ │ ├── up.html.md │ │ ├── destroy.html.md │ │ ├── global-status.html.md │ │ ├── package.html.md │ │ ├── share.html.md │ │ ├── login.html.md │ │ ├── rsync-auto.html.md │ │ └── plugin.html.md │ ├── docker │ │ ├── boxes.html.md │ │ ├── index.html.md │ │ └── commands.html.md │ ├── virtualbox │ │ ├── usage.html.md │ │ ├── index.html.md │ │ ├── common-issues.html.md │ │ ├── networking.html.md │ │ └── configuration.html.md │ ├── synced-folders │ │ ├── index.html.md │ │ ├── virtualbox.html.md │ │ ├── smb.html.md │ │ └── rsync.html.md │ ├── vagrantfile │ │ ├── vagrant_settings.html.md │ │ ├── vagrant_version.html.md │ │ ├── tips.html.md │ │ ├── version.html.md │ │ ├── winrm_settings.html.md │ │ └── index.html.md │ ├── hyperv │ │ ├── usage.html.md │ │ ├── configuration.html.md │ │ ├── index.html.md │ │ └── limitations.html.md │ ├── vmware │ │ ├── known-issues.html.md │ │ ├── index.html.md │ │ ├── usage.html.md │ │ ├── kernel-upgrade.html.md │ │ ├── configuration.html.md │ │ └── boxes.html.md │ ├── plugins │ │ ├── index.html.md │ │ ├── usage.html.md │ │ ├── host-capabilities.html.md │ │ ├── provisioners.html.md │ │ ├── hosts.html.md │ │ ├── guests.html.md │ │ └── guest-capabilities.html.md │ ├── getting-started │ │ ├── rebuild.html.md │ │ ├── project_setup.html.md │ │ ├── providers.html.md │ │ ├── up.html.md │ │ ├── index.html.md │ │ ├── synced_folders.html.md │ │ ├── networking.html.md │ │ ├── share.html.md │ │ ├── teardown.html.md │ │ ├── provisioning.html.md │ │ └── boxes.html.md │ ├── share │ │ ├── provider.html.md │ │ ├── index.html.md │ │ ├── connect.html.md │ │ ├── security.html.md │ │ ├── ssh.html.md │ │ └── http.html.md │ ├── installation │ │ ├── upgrading-from-1-0.html.md │ │ ├── index.html.md │ │ ├── upgrading.html.md │ │ ├── uninstallation.html.md │ │ └── backwards-compatibility.html.md │ ├── provisioning │ │ ├── file.html.md │ │ ├── index.html.md │ │ ├── chef_zero.html.md │ │ ├── puppet_agent.html.md │ │ ├── chef_apply.html.md │ │ └── chef_client.html.md │ ├── networking │ │ ├── basic_usage.html.md │ │ ├── index.html.md │ │ ├── private_network.html.md │ │ └── forwarded_ports.html.md │ ├── push │ │ ├── index.html.md │ │ ├── local-exec.html.md │ │ ├── ftp.html.md │ │ ├── heroku.html.md │ │ └── atlas.html.md │ ├── boxes.html.md │ └── why-vagrant │ │ └── index.html.md ├── 404.html.erb ├── stylesheets │ ├── vagrantup.less │ ├── _type.less │ ├── _variables.less │ ├── _components.less │ ├── _nav.less │ ├── _footer.less │ └── _sidebar.less └── javascripts │ ├── vagrantup.js │ ├── fittext.js │ └── backstretch.js ├── Procfile ├── wc.sh ├── .buildpacks ├── Gemfile ├── README.md ├── helpers └── sidebar_helpers.rb ├── lib ├── redirect_to_latest.rb └── redirect_v1_docs.rb ├── Vagrantfile ├── config.rb └── config.ru /source/index.html.erb: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: bundle exec thin start -p $PORT 2 | -------------------------------------------------------------------------------- /source/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/favicon.ico -------------------------------------------------------------------------------- /source/images/bullet_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/bullet_1.png -------------------------------------------------------------------------------- /source/images/bullet_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/bullet_2.png -------------------------------------------------------------------------------- /source/images/bullet_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/bullet_3.png -------------------------------------------------------------------------------- /source/images/customers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/customers.png -------------------------------------------------------------------------------- /source/images/logo_docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/logo_docs.png -------------------------------------------------------------------------------- /wc.sh: -------------------------------------------------------------------------------- 1 | wc -l `find . -type f | grep -E -v 'images|javascripts|stylesheet|favicon|\.git'` | sort -bn | sed 's/^/ - [ ] /' 2 | -------------------------------------------------------------------------------- /source/images/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/logo_small.png -------------------------------------------------------------------------------- /source/images/open_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/open_close.png -------------------------------------------------------------------------------- /source/images/search_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/search_icon.png -------------------------------------------------------------------------------- /.buildpacks: -------------------------------------------------------------------------------- 1 | https://github.com/heroku/heroku-buildpack-ruby.git 2 | https://github.com/hashicorp/heroku-buildpack-middleman.git 3 | -------------------------------------------------------------------------------- /source/images/icon_caution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/icon_caution.png -------------------------------------------------------------------------------- /source/images/logo_vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/logo_vagrant.png -------------------------------------------------------------------------------- /source/images/customers_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/customers_small.png -------------------------------------------------------------------------------- /source/images/logo_docs_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/logo_docs_small.png -------------------------------------------------------------------------------- /source/images/steps_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/steps_background.png -------------------------------------------------------------------------------- /source/images/footer_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/footer_background.png -------------------------------------------------------------------------------- /source/images/footer_hashi_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/footer_hashi_logo.png -------------------------------------------------------------------------------- /source/images/footer_vagrant_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/footer_vagrant_logo.png -------------------------------------------------------------------------------- /source/images/get_started_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/get_started_background.png -------------------------------------------------------------------------------- /source/images/sidebar_background_docs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/sidebar_background_docs.png -------------------------------------------------------------------------------- /source/images/sidebar_background_inner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/sidebar_background_inner.png -------------------------------------------------------------------------------- /source/v2/other/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Other" 3 | sidebar_current: "other" 4 | --- 5 | 6 | # 其他 7 | 8 | 这一节包含了一些不适合放在其他分类下的信息,请参看左侧的列表。 9 | -------------------------------------------------------------------------------- /source/images/vagrant_header_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aneasystone/vagrant-doc-chinese/master/source/images/vagrant_header_background.png -------------------------------------------------------------------------------- /source/v2/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_current: "overview" 3 | --- 4 | 5 | # Vagrant 文档 6 | 7 | 欢迎访问 Vagrant 文档!本站点自顶向下的介绍了 Vagrant,详细的覆盖了 Vagrant 的每个特性。如果你正在开始使用 Vagrant,强烈推荐你开始阅读[入门指南](/v2/getting-started/index.html). -------------------------------------------------------------------------------- /source/v2/providers/custom.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Custom Provider - Providers" 3 | sidebar_current: "providers-custom" 4 | --- 5 | 6 | # 自定义 Provider 7 | 8 | 想学习如何制作自己的 provider,请阅读插件开发指南 [创建自定义 provider](/v2/plugins/providers.html)。 9 | -------------------------------------------------------------------------------- /source/404.html.erb: -------------------------------------------------------------------------------- 1 |

Page Not Found

2 | 3 |

4 | Sorry, the page you tried to visit doesn't exist. This could be our fault, 5 | and if so we'll fix that up right away. Please go back, or go back 6 | home to get back on track. 7 |

8 | -------------------------------------------------------------------------------- /source/v2/cli/resume.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant resume - Command-Line Interface" 3 | sidebar_current: "cli-resume" 4 | --- 5 | 6 | # 恢复 7 | 8 | **命令:`vagrant resume`** 9 | 10 | 这个命令用于恢复之前被挂起的 Vagrant 机器,挂起可以使用 [suspend 命令](/v2/cli/suspend.html) 。 11 | -------------------------------------------------------------------------------- /source/v2/providers/installation.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Installation - Providers" 3 | sidebar_current: "providers-installation" 4 | --- 5 | 6 | # 安装 Provider 7 | 8 | Provider 是作为 Vagrant 的插件来发布的,因此要使用 Vagrant 的[标准插件安装步骤](/v2/plugins/usage.html) 来安装。在安装完一个包含 provider 的插件之后,provider 就可以立即使用了。 9 | -------------------------------------------------------------------------------- /source/v2/cli/status.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant status - Command-Line Interface" 3 | sidebar_current: "cli-status" 4 | --- 5 | 6 | # 状态 7 | 8 | **命令: `vagrant status`** 9 | 10 | 该命令用于告诉你 Vagrant 正在管理的机器的状态。 11 | 12 | 你可能常常会忘记你的 Vagrant 机器当前是正在运行中,还是挂起或者还没创建,尤其是当你习惯使用 Vagrant 之后,这个命令可以告诉你当前机器的状态。 13 | -------------------------------------------------------------------------------- /source/v2/cli/version.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant version - Command-Line Interface" 3 | sidebar_current: "cli-version" 4 | --- 5 | 6 | # 版本 7 | 8 | **命令:`vagrant version`** 9 | 10 | 该命令用于查看你安装的 Vagrant 版本,以及当前可用的最新的版本。 11 | 12 | 为了获取当前可用的最新版本,这个命令必须访问网络,如果你只需要查看当前安装的版本,可以使用 `vagrant --version` 命令。 13 | -------------------------------------------------------------------------------- /source/v2/cli/rsync.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant rsync - Command-Line Interface" 3 | sidebar_current: "cli-rsync" 4 | --- 5 | 6 | # Rsync 7 | 8 | **命令:`vagrant rsync`** 9 | 10 | 该命令用于在[rsync 同步目录](/v2/synced-folders/rsync.html)上执行一次强制同步操作。 11 | 12 | 注意如果你修改了 rsync 同步目录下的设置,譬如 exclude path 参数,你需要先运行 `vagrant reload` 命令让这些修改生效。 13 | -------------------------------------------------------------------------------- /source/v2/cli/ssh_config.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant ssh-config - Command-Line Interface" 3 | sidebar_current: "cli-ssh_config" 4 | --- 5 | 6 | # SSH 配置 7 | 8 | **命令:`vagrant ssh-config`** 9 | 10 | 该命令用于输出一个有效的 SSH 配置文件,使用这个配置文件可以通过 `ssh` 命令直接连接正在运行的 Vagrant 机器,而不是使用 `vagrant ssh` 命令。 11 | 12 | ## 选项 13 | 14 | * `--host NAME` - 指定输出配置文件中的主机名。 15 | -------------------------------------------------------------------------------- /source/v2/docker/boxes.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Boxes - Docker Provider" 3 | sidebar_current: "docker-boxes" 4 | --- 5 | 6 | # Docker Boxes 7 | 8 | Docker provider 并不需要 Vagrant box,所以 `config.vm.box` 设置完全是可选的。 9 | 10 | 尽管如此,仍然可以指定使用一个 box 来提供默认值,因为 box 的 `Vagrantfile` 文件是作为配置加载过程的一部分,这可以用来配置开发环境的基础。 11 | 12 | 但是,一般情况下,Docker provider 都是不需要 box 的。 13 | -------------------------------------------------------------------------------- /source/stylesheets/vagrantup.less: -------------------------------------------------------------------------------- 1 | /* 2 | /|\/|\/|\/|\/|\/|\ 3 | v a g r a n t u p 4 | \|/\|/\|/\|/\|/\|/ 5 | */ 6 | 7 | @import '_variables'; 8 | @import '_type'; 9 | @import '_mixins'; 10 | @import '_base'; 11 | @import '_nav'; 12 | @import '_components'; 13 | @import '_sidebar'; 14 | @import '_pages'; 15 | @import '_footer'; 16 | @import '_media-queries'; 17 | -------------------------------------------------------------------------------- /source/v2/cli/halt.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant halt - Command-Line Interface" 3 | sidebar_current: "cli-halt" 4 | --- 5 | 6 | # 关闭 7 | 8 | **命令:`vagrant halt`** 9 | 10 | 该命令用于关闭 Vagrant 正在管理的机器。 11 | 12 | Vagrant 首先会根据虚拟机提供的关机方法来优雅的关闭计算机,如果这一步失败了,或者指定了 `--force` 选项,Vagrant 就会直接关闭电源。 13 | 14 | ## 选项 15 | 16 | * `-f` or `--force` - 不使用优雅关机,直接关闭虚拟机电源。 17 | -------------------------------------------------------------------------------- /source/v2/virtualbox/usage.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Usage - VirtualBox Provider" 3 | sidebar_current: "virtualbox-usage" 4 | --- 5 | 6 | # 使用方法 7 | 8 | Vagrant VirtualBox provider 的使用方法和其他 provider 一样,请阅读 provider 通用的 [基本用法](/v2/providers/basic_usage.html) 页面。 9 | 10 | 使用的 `--provider` 参数值为 `virtualbox` 。 11 | 12 | 当前 Vagrant VirtualBox provider 还不支持并行执行,使用 `--parallel` 选项将不起作用。 13 | -------------------------------------------------------------------------------- /source/v2/synced-folders/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Synced Folders" 3 | sidebar_current: "syncedfolder" 4 | --- 5 | 6 | # 同步目录 7 | 8 | 同步目录可以让 Vagrant 从本地主机同步一个目录到虚拟机,这样你就可以继续在你的本地项目文件上进行工作,但是却可以使用虚拟机上的资源来编译或运行你的项目。 9 | 10 | Vagrant 默认情况下会把你的项目目录(包含 [Vagrantfile](/v2/vagrantfile/index.html) 文件的目录) 同步到 `/vagrant` 。 11 | 12 | 阅读 [基本用法](/v2/synced-folders/basic_usage.html) 一节开始使用同步目录吧。 13 | -------------------------------------------------------------------------------- /source/v2/cli/suspend.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant suspend - Command-Line Interface" 3 | sidebar_current: "cli-suspend" 4 | --- 5 | 6 | # 挂起 7 | 8 | **命令:`vagrant suspend`** 9 | 10 | 该命令用于挂起 Vagrant 正在管理的虚拟机,而不是[关闭](/v2/cli/halt.html) 或 [销毁](/v2/cli/destroy.html) 它。 11 | 12 | 挂起可以有效的保存机器的 _实时状态_ ,当你之后 [恢复](/v2/cli/resume.html) 它时,可以马上从保存的那个时间点继续运行,而无需一次完整的启动过程。 13 | 14 | 一般情况下,这需要额外的磁盘空间来存储虚拟机内存中的所有内容,挂起之后将不会再继续消耗主机的内存和 CPU 。 15 | -------------------------------------------------------------------------------- /source/v2/vagrantfile/vagrant_settings.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "config.vagrant - Vagrantfile" 3 | sidebar_current: "vagrantfile-vagrant" 4 | --- 5 | 6 | # Vagrant 设置 7 | 8 | **配置名字空间:`config.vagrant`** 9 | 10 | 11 | `config.vagrant` 这个名字空间下的配置用于修改 Vagrant 自身的行为。 12 | 13 | ## 可用配置 14 | 15 | `config.vagrant.host` - 用于设置运行 Vagrant 的主机类型,默认值为 `:detect` ,可以让 Vagrant 自动检测主机。Vagrant 需要知道这些信息,用来做一些和主机相关的事情,譬如初始化 NFS 目录。只有当自动检测失败的情况下你才需要手工设置它。 16 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | ruby "2.2.2" 4 | 5 | gem "less", "~> 2.2.2" 6 | gem "middleman", "~> 3.0.6" 7 | gem "middleman-minify-html", "~> 3.0.0" 8 | gem "rack-contrib", "~> 1.1.0" 9 | gem "redcarpet", "~> 2.2.2" 10 | gem "rb-inotify", "~> 0.9", require: false 11 | gem "therubyracer", "~> 0.12.0" 12 | gem "thin", "~> 1.5.0" 13 | gem "rack-protection", "~> 1.5" 14 | 15 | group :development do 16 | gem "highline", "~> 1.6.15" 17 | end 18 | -------------------------------------------------------------------------------- /source/v2/cli/rdp.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant rdp - Command-Line Interface" 3 | sidebar_current: "cli-rdp" 4 | --- 5 | 6 | # RDP 7 | 8 | **命令:`vagrant rdp`** 9 | 10 | 这个命令会启动一个 RDP 客户端来创建到虚拟机的远程桌面会话。注意该命令只能用于支持远程桌面的 Vagrant 环境,一般情况下就是 Windows 。 11 | 12 | ## 命令参数 13 | 14 | 你可以在命令行中使用 RDP 客户端原生的命令参数,只需要将这些参数放在 `--` 后面,Vagrant 会把 `--` 后面的参数透传给 RDP 客户端。例如: 15 | 16 | ``` 17 | $ vagrant rdp -- /span 18 | ... 19 | ``` 20 | 21 | 上面的命令如果在 Windows 系统上运行的话,将会运行 `mstsc.exe /span config.rdp` 命令,允许你扩展到多个桌面。 22 | -------------------------------------------------------------------------------- /source/v2/docker/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Docker Provider" 3 | sidebar_current: "docker" 4 | --- 5 | 6 | # Docker 7 | 8 | Vagrant 支持使用 Docker 作为 provider,这使得你可以将 Docker 容器作为你的开发环境,而无需使用虚拟机。 另外,它为你开发 Dockerfile 提供了一个好的工作流程。 9 | 10 |
11 |

12 | 警告:需要了解 Docker 相关知识。 我们假设你知道什么是 Docker ,并了解 Docker 的基本概念。如果你并不了解,我们推荐你使用其他的 provider ,譬如:VirtualBox。 13 |

14 |
15 | 16 | 请使用左侧的导航来阅读关于 Docker 的更多内容。 17 | -------------------------------------------------------------------------------- /source/v2/hyperv/usage.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Usage - Hyper-V Provider" 3 | sidebar_current: "hyperv-usage" 4 | --- 5 | 6 | # 使用方法 7 | 8 | Hyper-V provider 的使用方法和其他 provider 一样,请阅读 provider 通用的 [基本用法](/v2/providers/basic_usage.html) 页面。 9 | 10 | 使用的 `--provider` 参数为 `hyperv` 。 11 | 12 | 另外,Hyper-V 需要你使用管理员权限来运行 Vagrant,Hyper-V 虚拟机的创建和管理都需要管理员权限,如果没有权限,Vagrant 将会提示错误。 13 | 14 | Hyper-V box 可以很容易的在 [HashiCorp's Atlas](https://atlas.hashicorp.com/boxes/search) 上找到,你可以从尝试 `hashicorp/precise64` 这个 box 开始。 15 | -------------------------------------------------------------------------------- /source/javascripts/vagrantup.js: -------------------------------------------------------------------------------- 1 | // add dropshadow to nav on scroll 2 | $(document).ready(function(){ 3 | $(document).scroll(function() { 4 | var top = $(document).scrollTop(); 5 | if (top > 0) $('nav').addClass("drop-shadow"); 6 | if (top === 0) $('nav').removeClass("drop-shadow"); 7 | }); 8 | }); 9 | 10 | // open/close documentation side nav on small screens 11 | $(document).ready(function(){ 12 | $(".toggle").click(function() { 13 | $(".sidebar-nav ul").slideToggle('slow'); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /source/v2/vmware/known-issues.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Known Issues - VMware Provider" 3 | sidebar_current: "vmware-known-issues" 4 | --- 5 | 6 | # 已知问题 7 | 8 | 这个页面记录 VMware provider 的一些已知问题和限制,要注意的是,这些并不妨碍你使用 provider ,但是最好了解一下。 9 | 10 | ## Windows 机器上端口转发功能失效 11 | 12 | VMware Workstation 在 Windows 环境下存在一个 bug ,导致端口转发功能不能正常工作,Vagrant 实际上对该问题做了特殊处理来确保它能正常工作,但是,如果你在 Windows 上运行了虚拟网络编辑器(virtual network editor),端口转发会立即停止。 13 | 14 | 如果出现这种情况,运行一下 `vagrant reload` 命令即可恢复。 15 | 16 | 这个问题已经报告给 VMware 了,但目前官方还没有提供修复方法。 17 | -------------------------------------------------------------------------------- /source/v2/virtualbox/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "VirtualBox Provider" 3 | sidebar_current: "virtualbox" 4 | --- 5 | 6 | # VirtualBox 7 | 8 | Vagrant 原生支持 [VirtualBox](http://www.virtualbox.org),这是一个免费,跨平台的虚拟化产品。 9 | 10 | VirtualBox provider 兼容 VirtualBox 的 4.0.x、4.1.x、4.2.x、4.3.x 和 5.0.x 版本,不支持其他的版本,如果使用的是其他的版本,provider 将提示错误信息。 11 | 12 | 在使用 provider 之前,必须先安装 VirtualBox ,否则 provider 将提示错误信息要求你安装。 13 | 你可以 [下载](https://www.virtualbox.org/wiki/Downloads) 14 | 针对你的操作系统的 VirtualBox 安装包,并采用标准流程来安装它。 15 | 16 | 你可以通过左侧的导航来寻找和阅读更多关于 VirtualBox 的主题。 17 | -------------------------------------------------------------------------------- /source/v2/plugins/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Plugins" 3 | sidebar_current: "plugins" 4 | --- 5 | 6 | # 插件 7 | 8 | Vagrant 自带了很多强大的特性,可以让你的环境跑起来,但是有时,你还可能想要修改 Vagrant 的某种处理方式或者为 Vagrant 添加新的功能。这都可以通过 Vagrant 的 _插件_ 来实现。 9 | 10 | Vagrant 的插件相当强大,它属于头等公民,它有着良好的文档,稳定的 API,在主版本升级中也能很好的兼容。 11 | 12 | 实际上,Vagrant 的很多核心功能都是 [通过插件实现的](https://github.com/mitchellh/vagrant/tree/master/plugins)。你看,连 Vagrant 自己都在 [吃自己的狗粮](http://en.wikipedia.org/wiki/Eating_your_own_dog_food) ,所以,你要相信 Vagrant 的插件 API 是相当稳定的,而且可以得到很好的支持。 13 | 14 | 查看左侧 "插件" 一节下面的导航,可以进一步学习如何使用并构建自己的插件。 15 | -------------------------------------------------------------------------------- /source/v2/getting-started/rebuild.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Rebuild - Getting Started" 3 | sidebar_current: "gettingstarted-rebuild" 4 | --- 5 | 6 | # 重建 7 | 8 | 无论是明天,一周以后,还是一年以后,一当你打算重新回到你的项目中来时,启动并运行它是非常容易的: 9 | 10 | ``` 11 | $ vagrant up 12 | ``` 13 | 14 | 这样就行了!由于 Vagrant 的环境已经都通过 Vagrantfile 配置好了,你或你的同事们都只需要简单的运行一句 `vagrant up` 命令,无论在什么时候,Vagrant 都会重建你的工作环境。 15 | 16 | Teardown 17 | Providers 18 | -------------------------------------------------------------------------------- /source/v2/share/provider.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Custom Provider - Vagrant Share" 3 | sidebar_current: "share-provider" 4 | --- 5 | 6 | # 自定义 Provider 7 | 8 |
9 |

10 | 警告:高级话题! 这个话题涉及到 Vagrant 插件的开发,如果你对此不甚感兴趣,或者你刚刚接触 Vagrant ,你完全可以跳过这个页面。 11 |

12 |
13 | 14 | 如果你正在开发一个[自定义 provider](/v2/plugins/providers.html),为了能和 Vagrant Share 一起工作,你还需要更进一步的做一些工作。 15 | 16 | 目前为止,只需要一步: 17 | 18 | * `public_address` provider 功能 - 你必须实现这个功能,返回一个地址字符串,使用这个地址可以从 Vagrant 访问到主机。这个地址不用是全局的可路由的地址,只需要能被运行着 Vagrant 的机器访问到即可。如果你检测不到地址,返回 `nil` 。 19 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Vagrant 文档 2 | 3 | 这里是 [Vagrant 官方文档](http://docs.vagrantup.com) 的源码仓库。 4 | 5 | 这其实是一个 [Middleman](http://middlemanapp.com) 项目, 它可以根据这些源码生成一个静态站点。我们的站点部署在 [Heroku](http://heroku.com) 6 | 主机上,前端采用了 [Fastly](http://fastly.com) 主题。 7 | 8 | ## 欢迎反馈 9 | 10 | 如果你发现文档中有拼写错误,或者你可以改善页面的 HTML、CSS 和 JavaScript,欢迎反馈给我们。你可以像其他的 GitHub 项一样,提交 issues 或者 pull request ,我们将会合并进来。 11 | 12 | ## 本地运行站点 13 | 14 | 在本地直接运行这个站点很简单,将项目 clone 到本地,然后运行下面的命令: 15 | 16 | ``` 17 | $ bundle 18 | $ bundle exec middleman server 19 | ``` 20 | 21 | 然后打开 `localhost:4567` 即可。注意有些 URL 可能需要在尾部添加 ".html" 才能访问(类似于导航链接)。 22 | -------------------------------------------------------------------------------- /source/v2/providers/default.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Default Provider - Providers" 3 | sidebar_current: "providers-default" 4 | --- 5 | 6 | # 默认 Provider 7 | 8 | Vagrant 使用 VirtualBox 作为默认的 provider ,VirtualBox 依然是最容易获取的平台:它免费,跨平台,而且多年来一直被 Vagrant 所支持。VirtualBox 作为默认的 provider,对于新手入门 Vagrant 来说也是最容易的。 9 | 10 | 尽管如此,在你使用 Vagrant 一段时间以后,可能希望使用其他的 provider 作为默认的 provider 。实际上,这相当普遍。为了获得更好的体验,Vagrant 允许使用 `VAGRANT_DEFAULT_PROVIDER` 这个环境变量来指定默认 provider 。 11 | 12 | 你只需要将 `VAGRANT_DEFAULT_PROVIDER` 变量设置成你希望的默认 provider 即可。譬如,如果你使用 VMware Fusion,你可以将这个环境变量设置成 `vmware_fusion` ,这样它就是你的默认 provider 了。 13 | -------------------------------------------------------------------------------- /source/v2/providers/index.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Providers" 3 | sidebar_current: "providers" 4 | --- 5 | 6 | # Providers 7 | 8 | Vagrant 自诞生以来就开始支持 [VirtualBox](http://www.virtualbox.org) 虚拟机,而且它也可以管理其他类型的虚拟机,这可以通过 Vagrant 其他的 provider 来实现。 9 | 10 | 不同的 provider 可以提供你不同的功能,这可以在你的工作场景下更有用。例如,如果你在真实工作中使用 Vagrant ,推荐使用 [VMware](http://www.vmware.com) 11 | provider ,因为 Vagrant 对它支持的很好,而且它通常比 VirtualBox 更稳定更高效。 12 | 13 | 在你使用其他的 provider 之前,你需要先安装它。Vagrant 只提供了 VirtualBox 的安装支持,其他 provider 的安装可以通过 Vagrant 的插件系统来实现。 14 | 15 | 一旦你安装好了 provider ,Vagrant 使用起来就正如你期望的一样,非常简单直接。你可以通过左侧的导航来阅读更多的相关信息。 16 | -------------------------------------------------------------------------------- /source/v2/cli/provision.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "vagrant provision - Command-Line Interface" 3 | sidebar_current: "cli-provision" 4 | --- 5 | 6 | # Provision 7 | 8 | **命令:`vagrant provision`** 9 | 10 | 在指定 Vagrant 虚拟机上运行已配置的 [provisioner](/v2/provisioning/index.html) 。 11 | 12 | 这个命令用来测试 provisioner 非常快速方便,而且它尤其适合于 shell 脚本、Chef 或者 Puppet 模块的增量开发。你只需要简单的在你本地修改要测试的脚本,然后运行 `vagrant provision` 命令来检查返回值是否符合预期。如此反复测试即可。 13 | 14 | # 选项 15 | 16 | * `--provision-with x,y,z` - 只运行指定 provisioner,例如,如果你有两个 provisioner:一个 `:shell` 一个 `:chef_solo`,当你运行 `vagrant provision --provision-with shell` 时,只有 shell provisioner 将会被执行。 17 | -------------------------------------------------------------------------------- /helpers/sidebar_helpers.rb: -------------------------------------------------------------------------------- 1 | module SidebarHelpers 2 | # This helps by setting the "current" class for sidebar nav elements 3 | # if the YAML frontmatter matches the expected value. 4 | def sidebar_current(expected) 5 | current = current_page.data.sidebar_current 6 | if current == expected || sidebar_section == expected 7 | return " class=\"current\"" 8 | else 9 | return "" 10 | end 11 | end 12 | 13 | # This returns the overall section of the documentation we're on. 14 | def sidebar_section 15 | current = current_page.data.sidebar_current 16 | return "" if !current 17 | current.split("-")[0] 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /lib/redirect_to_latest.rb: -------------------------------------------------------------------------------- 1 | module HashiCorp 2 | module Rack 3 | # This redirects to the latest version of the docs. 4 | class RedirectToLatest 5 | def initialize(app) 6 | @app = app 7 | end 8 | 9 | def call(env) 10 | if env["PATH_INFO"] =~ /^\/$/ 11 | headers = { 12 | "Content-Type" => "text/html", 13 | "Location" => "/v2/", 14 | "Surrogate-Key" => "page" 15 | } 16 | message = "Redirecting to new URL..." 17 | 18 | return [301, headers, [message]] 19 | end 20 | 21 | @app.call(env) 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /source/v2/hyperv/configuration.html.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_title: "Configuration- Hyper-V Provider" 3 | sidebar_current: "hyperv-configuration" 4 | --- 5 | 6 | # Configuration 7 | 8 | Hyper-V provider 有一些特有的配置选项,下面是完整的参考列表: 9 | 10 | * `vmname` (string) - Hyper-V 管理器中显示的虚拟机名称,默认从镜像的 XML 配置文件中获取。 11 | * `cpus` (integer) - 虚拟机的虚拟 CPU 个数,默认从镜像的 XML 配置文件中获取。 12 | * `memory` (integer) - 启动时分配给虚拟机的内存大小,单位 MB ,默认从镜像的 XML 配置文件中获取。 13 | * `maxmemory` (integer) - 允许分配给虚拟机的最大内存大小,单位 MB ,该参数在动态内存分配( Dynamic Allocation)时有效。默认从镜像的 XML 配置文件中获取。 14 | * `vlan_id` (integer) - 设置虚拟机网卡的 vlan ID ,默认不设置该参数,不修改 vlan 配置。 15 | * `ip_address_timeout` (integer) - 等待虚拟机汇报 IP 地址的超时时间,单位秒,默认值为 120 秒。如果你的虚拟机启动时间较长,需要增加该值。 16 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | # -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | $script = <