Skip to content
Snippets Groups Projects
Vagrantfile 1.19 KiB
Newer Older
$lxc_script = <<-SCRIPT
MJB's avatar
MJB committed

apt-get install python3 python3-setuptools jq -y
MJB's avatar
MJB committed

# install util for persistent ip tables
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections
apt-get -y install iptables-persistent
MJB's avatar
MJB committed

lxd init --auto --storage-backend dir 
lxc network create lxcbr0 ipv6.address=none ipv4.address=172.40.231.1/24 ipv4.nat=true
# enable NTP
# use network time to make sure we are synchronised
echo "Disabling timesyncd..."
timedatectl set-ntp no

# The following hangs with bionic
#until timedatectl | grep -m 1 "Network time on: no";
#do
#  echo "Waiting for timesyncd to turn off.."
#  sleep 1
#done

apt-get install ntp -y
echo "timesync set to ntpd"

# set timezone to London
timedatectl set-timezone Europe/London

MJB's avatar
MJB committed

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
  config.disksize.size = '50GB'
MJB's avatar
MJB committed
  config.vm.provider "virtualbox" do |vb|
    vb.cpus = 4
    vb.memory = "8192"
Michael Boniface's avatar
Michael Boniface committed
  end
MJB's avatar
MJB committed

  #config.vm.network "forwarded_port", guest: 8888, host: 8888
MJB's avatar
MJB committed

  config.vm.provision :shell, inline: $lxc_script