所需软件 | 下载地址 |
---|---|
VirtualBox-5.2.8-121009-Win | https://download.virtualbox.org/virtualbox/5.2.12/VirtualBox-5.2.12-122591-Win.exe |
vagrant_2.1.1_x86_64 | https://releases.hashicorp.com/vagrant/2.1.1/vagrant_2.1.1_x86_64.msi |
vagrant-centos-7.2.box | https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.2/vagrant-centos-7.2.box |
略
vagrant box add Djstudy1 D:\im
ages\vagrant-centos-7.2.box
vagrant init Djstudy1
初始化后会在目录中建个Vagrantfile,可以在文件中加入如下两行(指明虚机的账号密码)
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
vagrant up
vagrant ssh
vagrant status
vagrant halt
vagrant suspend
vagrant reload
vagrant destory
Tools --> Vagrant --> Init in Project Root --> Djstudy1