vagrant 的使用

1
2
3
vagrant  ssh-config
# 查看 vagrant的 ssh 配置
# 给 vscode 使用
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
Host default
  HostName 127.0.0.1
  User vagrant
  Port 2222
  UserKnownHostsFile /dev/null
  StrictHostKeyChecking no
  PasswordAuthentication no
  IdentityFile F:/vagrant/centos7/.vagrant/machines/default/virtualbox/private_key
  IdentitiesOnly yes
  LogLevel FATAL

为了方便使用,还是加个宝塔吧

1
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh

Bt-Panel: http://120.230.101.193:8888 username: jfeswz3l password: 89251ec9

Warning: If you cannot access the panel, release the following port (8888|888|80|443|20|21) in the security group

这里开放一下端口

1
2
# 环境是 centos7
firewall-cmd --zone=public --add-port=8888/tcp --permanent

然后登陆网页

选择极速安装模式 安装 配套

vagrant 保存个快照

1
2
3
4
5
6
7
vagrant snapshot save  "target01"

vagrant snapshot delete "target01"
# 删除 快照

vagrant snapshot list
#查看