Vagrant启动CentOS

CentOS 7

官网: https://app.vagrantup.com/centos/boxes/7
box: https://vagrantcloud.com/centos/boxes/7/versions/1905.1/providers/virtualbox.box

CentOS 8

官网: https://app.vagrantup.com/centos/boxes/8
box: https://vagrantcloud.com/centos/boxes/8/versions/1905.1/providers/virtualbox.box

CentOS启动

(1)Vagrantfile启动(在线)

1
2
3
Vagrant.configure("2") do |config|
config.vm.box = "centos/7"
end
1
2
> vagrant up
> vagrant ssh

(2)命令行启动(在线)

1
2
3
> vagrant init centos/7
> vagrant up
> vagrant ssh

(3)box启动(离线)

1
2
3
4
> vagrant box add CentOS7 E:/VagrantBox/vagrant-centos-7.box
> vagrant init CentOS7
> vagrant up
> vagrant ssh

网络配置

编辑Vagrantfile

1
config.vm.network "private_network", ip: "172.16.10.10"

使用 127.0.0.1:2222172.16.10.10:22 执行SSH连接

Powered by AppBlog.CN     浙ICP备14037229号

Copyright © 2012 - 2020 APP开发技术博客 All Rights Reserved.

访客数 : | 访问量 :