站点更新:2020-02-26 14:52:38

This commit is contained in:
ehlxr 2020-02-26 14:52:38 +08:00
parent 43d1b9faec
commit 39d961e7a3
2 changed files with 20 additions and 9 deletions

View File

@ -10,24 +10,35 @@
```sh ```sh
➜ cd base ➜ cd base
➜ wget https://www.dropbox.com/s/nuz6ts1hlx4vy27/vagrant-centos-7.2.box\?dl\=0 -O vagrant-centos-7.2.box ➜ wget https://www.dropbox.com/s/570sb9j9k6b9rpp/centos-7.5-ehlxr.box?dl=0 -O centos-7.5-ehlxr.box
➜ vagrant box add -f centos-7.2 vagrant-centos-7.2.box ➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq ➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq
➜ vagrant package --output centos-7.2-ehlxr.box ➜ vagrant package --output centos-7.5-ehlxr.box
➜ vagrant box add -f centos-7.2-ehlxr centos-7.2-ehlxr.box ➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
``` ```
```sh ```sh
# onedrive.live.com、drive.google.com、pan.baidu.com 下载 centos-7.2-ehlxr.box # onedrive.live.com、drive.google.com、pan.baidu.com 下载 centos-7.5-ehlxr
➜ vagrant box add -f centos-7.2-ehlxr centos-7.2-ehlxr.box ➜ vagrant box add -f centos-7.5-ehlxr centos-7.5-ehlxr.box
# vagrant package --base vghost1 --output centos-ehlxr.box # vagrant package --base vghost1 --output centos-ehlxr.box
➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq ➜ vagrant up # 执行 init.sh 脚本时,最好保证能够 fq
``` ```
## 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/
```

6
Vagrantfile vendored
View File

@ -45,9 +45,9 @@ Vagrant.configure("2") do |config|
# do NOT check the correct additions version when booting this machine插件安装vagrant plugin install vagrant-vbguest # do NOT check the correct additions version when booting this machine插件安装vagrant plugin install vagrant-vbguest
cfg.vbguest.auto_update = false cfg.vbguest.auto_update = false
# cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant/vm_share", "/root/", type: "virtualbox" # cfg.vm.synced_folder "./", "/root/", type: "virtualbox"
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/vagrant", disabled: true cfg.vm.synced_folder "./", "/vagrant", disabled: true
cfg.vm.synced_folder "/Users/ehlxr/works/Vagrant", "/root/share", type: "virtualbox" cfg.vm.synced_folder "./", "/root/share", type: "virtualbox"
# 开机运行命令 # 开机运行命令
cfg.vm.provision "shell", run: "always", inline: <<-SHELL cfg.vm.provision "shell", run: "always", inline: <<-SHELL