vagrant 使用
来源:互联网 发布:中国交通地图软件 编辑:程序博客网 时间:2024/05/20 18:50
vagrant 文档: http://docs.vagrantup.com/v2/getting-started/index.html
1. 初识vagrant
从 http://www.vagrantup.com/downloads 站点下载相应版本的vagrant并安装
安装完成后会自动将"vagrant"加入系统的环境变量中.
vagrant支持的provider有virtualbox, vmware, aws等,下面的介绍中使用的是virtualbox, virtualbox免费并支持多个平台.
1.1 用vagrant来启动一台32位的ubuntu虚拟机
➜ ~ vagrant init hashicorp/precise32A `Vagrantfile` has been placed in this directory. You are nowready to `vagrant up` your first virtual environment! Please readthe comments in the Vagrantfile as well as documentation on`vagrantup.com` for more information on using Vagrant.
➜ ~ vagrant upBringing machine 'default' up with 'virtualbox' provider...==> default: Box 'hashicorp/precise32' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0==> default: Loading metadata for box 'hashicorp/precise32' default: URL: https://vagrantcloud.com/hashicorp/precise32==> default: Adding box 'hashicorp/precise32' (v1.0.0) for provider: virtualbox default: Downloading: https://vagrantcloud.com/hashicorp/precise32/version/1/provider/virtualbox.box==> default: Successfully added box 'hashicorp/precise32' (v1.0.0) for 'virtualbox'!==> default: Importing base box 'hashicorp/precise32'...==> default: Matching MAC address for NAT networking...==> default: Checking if box 'hashicorp/precise32' is up to date...==> default: Setting the name of the VM: hsgroot_default_1399458969510_99441==> 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: Warning: Connection timeout. Retrying... default: Warning: Connection timeout. Retrying... default: Warning: Remote connection disconnect. Retrying...==> default: Machine booted and ready!==> default: Checking for guest additions in VM... default: The guest additions on this VM do not match the installed version of default: VirtualBox! In most cases this is fine, but in rare cases it can default: prevent things such as shared folders from working properly. If you see default: shared folder errors, please make sure the guest additions within the default: virtual machine match the version of VirtualBox you have installed on default: your host and reload your VM. default: default: Guest Additions Version: 4.2.0 default: VirtualBox Version: 4.3==> default: Mounting shared folders... default: /vagrant => /home/hsgroot
1.2 登陆刚创建的虚拟机
vagrant ssh
1.3 注销虚拟机
vagrant destroy
2 建立vagrant 工程
创建vagrant工程时会自动生成配置文件Vagrantfile. Vagrantfile是描述Project中的虚拟机的类型以及如何配置这些虚拟机.
0 0
- vagrant 使用
- vagrant 使用
- Vagrant使用指南:Vagrant命令使用简介
- vagrant使用笔记
- 使用Vagrant練習環境佈署
- vagrant基本配置使用
- 开始使用vagrant
- 开始使用 Vagrant
- vagrant使用资料
- vagrant使用简介
- Vagrant使用【1】
- Vagrant简介和使用
- vagrant 安装与使用
- Vagrant安装和使用
- Vagrant
- vagrant
- vagrant
- vagrant
- 《linux 内核完全剖析》 signal.c 代码分析笔记
- 四川工商局开展打击利用互联网销售假冒伪劣农资行为专项行动
- 多线程IO操作(fork-join版)
- 深入Java集合学习系列:HashMap的实现原理
- 如何去掉a标签的下划线 各种样式详解
- vagrant 使用
- Java各种数据库连接
- string类扩展函数
- Direct Memory Access (DMA) 解析 以及 DMA 给Xen 虚拟化带来的挑战
- android.app.Fragment$InstantiationException 解决办法
- iOS app支付宝接口调用的一点总结(补充支付宝SDK&Demo下载地址)
- 20060328-Image overlays
- 终于找了个可以上班时写博客的公司
- Spring整合JUnit框架进行单元测试代码使用详解