1. wget http://mirrors.aliyun.com/repo/Centos-7.repo
mv /etc/yum.repos.d/CentOS-Base.repo CentOS-Base.repo.bak
2 yum update kernel*
3 rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
4 yum install gcc kernel-devel kernel-headers dkms make bzip2 perl
Vagrant.configure("2") do |config|
config.vbguest.auto_update = false
ANSIBLE_RAW_SSH_ARGS = []
VAGRANT_VM_PROVIDER = "virtualbox"
machine_box = "c7"
config.vm.define "c1" do |machine|
machine.vm.box = machine_box
machine.vm.hostname = "c1"
machine.vm.network "private_network", ip: "192.168.11.11"
# machine.vm.synced_folder ".", "/vagrant", disabled: true
machine.vm.synced_folder ".", "/vagrant",type: "nfs"
machine.vm.network "public_network",
use_dhcp_assigned_default_route: true
machine.vm.provider "virtualbox" do |node|
node.name = "c1"
node.memory = 2048
node.cpus = 4
end
end
end
https://www.vagrantup.com/docs/synced-folders/nfs.html
centos7 nat and only private not aceess internet to resolve:
vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4