使用VAGRANT安装VIRTUALBOX虚拟机说明

 

首先安装这个玩意VirtualBox~~

 

 

然后安装这个玩意vagrant

 

设置环境:

 

如果vagrant 命令不可用 讲这个目录添加到环境变量PATH里 : D:\ProgramS\Vagrant\bin; (D:\ProgramS\Vagrant 为Vagrant 安装目录)

 

PATH: 添加 D:\ProgramS\VirtualBox; 你安装VirtualBox的路径,确保在cmd下VBoxManage 命令可用

 

 

添加环境变量 VAGRANT_HOME : 自己在其他盘建个目录 路径写上就行了

 

 

找个盘建个目录

 

 

开始->运行 cmd 进入到上一步建立的目录里

 

vagrant box add centos ~/box/precise64.box 加红的名称后边会用到

 

vagrant init centos # 初始化

 

记事本打开目录里 Vagrantfile 文件 配置一些信息: 具体看下边

 

vagrant up # 启动环境

 

vagrant reload 重启

 

vagrant halt 关机

 

Ps: 配置文件

# -*- mode: ruby -*-
# vi: set ft=ruby :
 
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.
 
  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://atlas.hashicorp.com/search.
  config.vm.box = "archlinux"    # 红色位置为上边标红的名称
 
  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false
 
  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # config.vm.network "forwarded_port", guest: 80, host: 8080  自行映射linux端口到外边使用
 
 
  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"
 
  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"
  config.vm.network "public_network", ip: "192.168.1.71"  设置桥接的ip 占公用IP . 建议使用端口映射
 
  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data"
  config.vm.synced_folder "D:/webroot", "/var/webroot"   配置一些共享目录

# 下边的设置 自行百度

# Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  # config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
  #
  #   # Customize the amount of memory on the VM:
  #   vb.memory = "1024"
  # end
  #
  # View the documentation for the provider you are using for more
  # information on available options.
 
  # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
  # such as FTP and Heroku are also available. See the documentation at
  # https://docs.vagrantup.com/v2/push/atlas.html for more information.
  # config.push.define "atlas" do |push|
  #   push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
  # end
 
  # Enable provisioning with a shell script. Additional provisioners such as
  # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   sudo apt-get update
  #   sudo apt-get install -y apache2
  # SHELL
end

 

时间: 2024-07-31 00:10:03

使用VAGRANT安装VIRTUALBOX虚拟机说明的相关文章

Mac Pro怎么安装VirtualBox虚拟机

  VirtualBox号称是最强的免费虚拟机软件,它不仅具有丰富的特色,而且性能也很优异,它简单易用,可以虚拟所有的Windows系统.日前,网友"潮水011"分享了一个2015年款Retina Mac Pro安装VirtualBox虚拟机的实用教程,一起来看看吧. 在正式操作之前,我们需要做好以下准备工作: -进入VirtualBox下载页面[链接],下载两个文件,分别是VirtualBox 5.0.18 for OS X hostsamd64和VirtualBox 5.0.18

ubuntu 14.04 server 安装virtualbox (虚拟机)deb

安装之前 ,请先更新 sudo apt-get update sudo apt-get upgrade sudo apt-get update 风来了.呆狐狸 1.下载 deb https://www.virtualbox.org/wiki/Linux_Downloads wget http://download.virtualbox.org/virtualbox/4.3.18/virtualbox-4.3_4.3.18-96516~Ubuntu~raring_amd64.deb 2.安装dkm

使用Virtualbox虚拟机安装Ubuntu的图文教程

前面介绍了如何安装VirtualBox虚拟机,今天像大家介绍如何使用VirtualBox建立虚拟机和安装虚拟系统. 这里以Ubuntu 9.10 DVD的ISO镜像文件为演示安装虚拟系统,详细步骤请参照下面图片说明: 到这里就安装完了,不过我猜想你需要看看下面两个帖子的文章.

虚拟机管理工具vagrant安装配置

简介 vagrant是一个基于业界成熟的虚拟化技术打造可配置,可重新生成和可移植的工作环境的工具,一个配置文件完成所有状态定义. 特性 •简单,一个配置文件搞定 •可通过多种方式自定义虚拟机配置,如shell脚本,ansible等 •网络配置,支持私有,共有网络配置 •目录同步,保持guest和host文件同步,默认将当前目录映射到虚拟机的/vagrant下 •多虚拟机支持,构建自己的集群测试环境 •多中虚拟技术支持,如virtualbox,vmware,AWS和docker •插件机制,扩展灵

Windows上使用VirtualBox+Vagrant安装CentOS 7环境教程

在Windows上使用VirtualBox+Vagrant安装CentOS 7环境,需要安装VirtualBox和Vagrant工具,以及下载一个CentOS 7的box镜像文件. 一.安装好以上工具,下载好box文件后,使用vagrant命令添加镜像到Vagrant: vagrant box add 名称 路径 这里成功添加镜像到Vagrant,如下: 二.初始化开发环境 由于是在Windows下,在D盘新建一个文件夹dev,然后进行如下操作: D:\dev>vagrant up Bringi

virtualbox虚拟机安装Windows8图文教程

virtualbox虚拟机安装Windows8图文教程 1.双击virtualbox安装文件 2.点击Browse选择安装目录,默认安装是c盘下,我个人安装到e盘.修改好目录后,可以点击Disk Usage看下安装所需的硬盘空间,然后直接下一步安装 3.创建快捷方式 4.安装完毕后打开的界面

VirtualBox虚拟机安装增强工具包图文教程

在使用VirtualBox和相关的客户机系统,比如XP,Mac等,需要用到一些相关功能,共享剪贴板等等,这时候,需要安装VirtualBox中的一个工具,叫做Guest Additions,中文叫法不一:增强工具包,功能增强包,增强功能包,都是一个意思. 下面,就以客户机为XP为例,详细解释一下,如何为VirtualBox中安装功能增强包: 1. 打开正在运行的客户机操作系统 此处是XP系统. 2.从窗口的左上角的工具栏中选择: 设备->安装增强功能 3. 然后客户机(XP虚拟机)中,会自动加载

VirtualBox虚拟机如何安装Win8

  一.准备工作和说明: 1.下载VirtualBox:首先下载Oracle VirtualBox的最新版本,这是多国语言版,含简体中文. 2.下载Win8:如果您没有下载过Windows 8 的版本,请网络上自行寻找! 3.安装VirtualBox:如果您登陆Windows的用户名是中文,可能会在安装VirtualBox的时候发生故障,关于VirtualBox 的具体安装步骤,本文不详细说明了,一步一步非常简单.不懂的地方就点击确定确定. 4.其他说明:本文是在64位Windows 7简体中文

win8-Genytion virtualbox安装了虚拟机打不开

问题描述 Genytion virtualbox安装了虚拟机打不开 本人win8,求大神帮忙解决一下 解决方案 插上网线了么?给你的虚拟机的网卡一个固定的静态ip看看. 解决方案二: 不行啊,我没差网线也还是这样. 解决方案三: 请问有谁会使用android studio? 我安装这个虚拟机的目的就是想学android studio,有哪位大神可以指点迷津,该怎么做,我现在下载好了android studio,就是不知道怎么弄一个模拟器