使用vagrant安装box
1.首先安装vagrant 就不用说了,请看我得另一篇文章。2.提前准备好眼安装得.box(虚拟机)文件3.然后根据下图最主要得操作是vagrant box add study fangpian.box然后得添加一个配置文件,这里给一个示例# -*- mode: ruby -*-# vi: set ft=ruby :Vagrant.configure("2") do |c...
·
1.首先安装vagrant 就不用说了,请看我得另一篇文章。
2.提前准备好眼安装得.box(虚拟机)文件
3.然后根据下图
最主要得操作是
vagrant box add study fangpian.box
然后得添加一个配置文件,这里给一个示例
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "study"
config.vm.network "forwarded_port", guest: 9091, host: 9091, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 9092, host: 9092, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 9093, host: 9093, host_ip: "127.0.0.1"
# sd1.2x
config.vm.network "forwarded_port", guest: 8081, host: 80, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8083, host: 8083, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 13306, host: 13306, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8085, host: 8085, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 16379, host: 16379, host_ip: "127.0.0.1"
#config.vm.network "forwarded_port", guest: 80, host: 80, host_ip: "127.0.0.1"
# swoft
config.vm.network "forwarded_port", guest: 8084, host: 8084, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 9051, host: 9051, host_ip: "127.0.0.1"
config.vm.network "forwarded_port", guest: 8000, host: 8000, host_ip: "127.0.0.1"
#config.vm.network "forwarded_port", guest: 8081, host: 9081, host_ip: "127.0.0.1"
# 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"
config.vm.synced_folder "../caoxiukang/probject", "/vagrant/caoxiukang"
# 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"
# 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"
# 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.
# 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
# apt-get update
# apt-get install -y apache2
# SHELL
end
完了
更多推荐
所有评论(0)