Vagrant/README.md

44 lines
1.1 KiB
Markdown
Raw Permalink Normal View History

# Vagrant
2018-11-02 14:19:19 +00:00
```shell
# 插件安装
➜ vagrant plugin install vagrant-vbguest
➜ vagrant plugin install vagrant-hosts
```
```sh
2018-11-02 14:19:19 +00:00
➜ cd base
2020-02-26 06:52:38 +00:00
➜ wget https://www.dropbox.com/s/570sb9j9k6b9rpp/centos-7.5-ehlxr.box?dl=0 -O centos-7.5-ehlxr.box
2020-02-26 06:52:38 +00:00
➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq
2020-02-26 06:52:38 +00:00
➜ vagrant package --output centos-7.5-ehlxr.box
2020-02-26 06:52:38 +00:00
➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
2018-11-02 14:19:19 +00:00
```
```sh
2020-02-26 06:52:38 +00:00
# onedrive.live.com、drive.google.com、pan.baidu.com 下载 centos-7.5-ehlxr
2018-11-02 14:19:19 +00:00
2020-02-26 06:52:38 +00:00
➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
2018-11-02 14:37:52 +00:00
# vagrant package --base vghost1 --output centos-ehlxr.box
2018-11-02 14:19:19 +00:00
➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq
2020-02-26 06:52:38 +00:00
```
## vagrant plugin install 超时解决方法
```sh
➜ gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/
➜ gem sources -l
# 确保只有 gems.ruby-china.com
➜ vagrant plugin install vagrant-vbguest --plugin-clean-sources --plugin-source https://gems.ruby-china.com/
```