$lxc_script = <<-SCRIPT apt-get update apt-get install python3 python3-setuptools jq -y # 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 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 SCRIPT Vagrant.configure("2") do |config| config.vm.box = "ubuntu/bionic64" config.disksize.size = '50GB' config.vm.provider "virtualbox" do |vb| vb.cpus = 4 vb.memory = "8192" end #config.vm.network "forwarded_port", guest: 8888, host: 8888 # Install lxc config.vm.provision :shell, inline: $lxc_script end