How to use this box with Vagrant:

Vagrant.configure("2") do |config|
  config.vm.box = "zjj/centos7-openvpn"
  config.vm.box_version = "1.0.0"
end
vagrant init zjj/centos7-openvpn \
  --box-version 1.0.0
vagrant up

This version was created 12 months ago.

centos7-openvpn

1.简介

内置:centos7+openvpn

2.单机搭建

Vagrantfile配置文件内容:

Vagrant.configure("2") do |config|

  config.vm.box = "zjj/centos7-openvpn"
  config.vm.box_version = "1.0.0"
  # 屏蔽默认映射的2222端口防止报错
  config.vm.network "forwarded_port", guest: 22, host: 2222, id: "ssh", disabled: "true"
  # 使用自定义端口映射(这里取2001-2100)需要手动修改
  config.vm.network "forwarded_port", guest: 22, host: 1999

  # 手动固定内网ip(这里取101-200)需要手动修改
  config.vm.network "private_network", ip: "192.168.56.99"

  # 设置主机与虚拟机的共享目录,屏蔽掉,不然会报错
  config.vm.synced_folder ".", "/vagrant", disabled: true

  config.vm.hostname = "node-openvpn"
  # VirtaulBox相关配置
  config.vm.provider "virtualbox" do |v|
    # 设置虚拟机的名称
    v.name = "node-openvpn"
    # 设置虚拟机的内存大小
    v.memory = 1024
    # 设置虚拟机的CPU个数
    v.cpus = 1
  end

  # 设置主机与虚拟机的共享目录,屏蔽掉,不然会报错
  config.vm.synced_folder ".", "/vagrant", disabled: true

 # 配置账号密码,vagrant ssh登录时会使用此账号密码
  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"

end
1 provider for this version.
  • virtualbox
    unknown Hosted by Vagrant Cloud (2.61 GB)