Skip to content

Instantly share code, notes, and snippets.

@lihongjie0209
Last active May 10, 2021 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lihongjie0209/a51f841be840473880cbb50b3c9c3678 to your computer and use it in GitHub Desktop.
Save lihongjie0209/a51f841be840473880cbb50b3c9c3678 to your computer and use it in GitHub Desktop.
common = <<-SHELL
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
timedatectl set-timezone Asia/Shanghai
echo '' > /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free' >> /etc/apt/sources.list
echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free' >> /etc/apt/sources.list
apt update -y
apt install -y wget curl htop vim tmux gnupg apt-transport-https ca-certificates lsb-release
SHELL
Vagrant.configure("2") do |config|
config.vm.define "server" do |server|
server.vm.box = "debian/contrib-buster64"
server.vm.box_check_update = false
server.vm.network "private_network", ip: "192.168.33.100"
server.vm.network "public_network"
server.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "1024"
end
server.vm.provision "shell", inline: common
end
config.vm.define "client" do |client|
client.vm.box = "debian/contrib-buster64"
client.vm.box_check_update = false
client.vm.network "private_network", ip: "192.168.33.200"
client.vm.network "public_network"
client.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.memory = "1024"
end
client.vm.provision "shell", inline: common
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment