Study Hsueh
2014/04/26
Java RAD Study Group Meeting #2
$ vagrant box add {title} {url}
# {title}是box的名稱
# {url}是box的下載網址
$ vagrant init {title}
$ vagrant up
$ vagrant halt
$ vagrant box add precise32 http://files.vagrantup.com/precise32.box $ mkdir precise32_vm $ cd precise32_vm $ vagrant init precise32 $ vagrant up $ vagrant ssh # 透過ssh連進vm
$ vagrant package
$ vagrant init hashicorp/precise64
Vagrant.configure("2") do |config|
# ... other configuration
config.vm.provision "shell" do |s|
s.inline = "yum -y update"
end
end
$ vagrant plugin install vagrant-aws
$ vagrant box add dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box
$ vi Vagrantfile
Vagrant.configure("2") do |config|
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
aws.access_key_id = "YOUR KEY"
aws.secret_access_key = "YOUR SECRET KEY"
aws.keypair_name = "KEYPAIR NAME"
aws.instance_type = "t1.micro"
aws.region = "ap-northeast-1" # Tokyo
aws.ami = "ami-bddaa2bc" # Ubuntu x64 14.04 LTS
override.ssh.username = "ubuntu"
override.ssh.private_key_path = "PATH TO YOUR PRIVATE KEY"
end
end
$ vagrant up --provider=aws




