diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -182,8 +182,6 @@ ``` apt install vagrant virtualbox-6.0 nfs-kernel-server linux-headers-$(uname --kernel-release) -# An additional plugin must be installed to manage the virtualbox addons in the vms -vagrant plugin install vagrant-vbguest --plugin-version "< 0.25.0" ``` Note: @@ -192,7 +190,6 @@ - `nfs-kernel-server` is needed to export and share the local /tmp/puppet to the vm - `linux-headers` package is required for the vbox guest additions -- vagrant-vbguest 0.25.0 makes the first "vagrant up " fail ### Usage diff --git a/Vagrantfile b/Vagrantfile --- a/Vagrantfile +++ b/Vagrantfile @@ -4,12 +4,12 @@ environment="staging" # local configuration -#$global_debian10_box = "debian10-20200922-0913" -#$global_debian10_box_url = "file:///path/to/packer/builds/swh-debian-10.5-amd64-20200922-0913.box" +#$global_debian10_box = "debian10-20201001-0747" +#$global_debian10_box_url = "file:///path/to/packer/builds/swh-debian-10.6-amd64-20201001-0747.box" # http configuration -$global_debian10_box = "debian10-20200930-0816" -$global_debian10_box_url = "https://annex.softwareheritage.org/public/isos/virtualbox/debian/swh-debian-10.6-amd64-20200930-0816.box" +$global_debian10_box = "debian10-20201001-0747" +$global_debian10_box_url = "https://annex.softwareheritage.org/public/isos/virtualbox/debian/swh-debian-10.6-amd64-20201001-0747.box" Vagrant.configure("2") do |global_config| ################ diff --git a/packer/debian_buster.json b/packer/debian_buster.json --- a/packer/debian_buster.json +++ b/packer/debian_buster.json @@ -59,6 +59,14 @@ "scripts": [ "scripts/post-install.sh" ] + }, + { + "type": "shell", + "expect_disconnect": "false", + "execute_command": "echo 'vagrant'|{{.Vars}} sudo -S -E bash '{{.Path}}'", + "scripts": [ + "scripts/install-vbguest.sh" + ] } ], diff --git a/packer/scripts/install-vbguest.sh b/packer/scripts/install-vbguest.sh new file mode 100644 --- /dev/null +++ b/packer/scripts/install-vbguest.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Install kernel headers +export DEBIAN_FRONTEND=noninteractive +apt-get install -y build-essential linux-headers-$(uname -r) + +# mount the vbguest iso +env + +mount VBoxGuestAdditions_*.iso /media/cdrom +cd /media/cdrom + +./VBoxLinuxAdditions.run + +if ! test -f /lib/modules/$(uname -r)/kernel/drivers/virt/vboxguest/vboxguest.ko +then + echo "vboxsf module not detected" + echo "Installation of guest additions was not successful" + exit 1 +fi + +#### +# Cleanup +#### +umount /media/cdrom +rm -v /home/vagrant/VBoxGuestAdditions*.iso diff --git a/packer/scripts/post-install.sh b/packer/scripts/post-install.sh --- a/packer/scripts/post-install.sh +++ b/packer/scripts/post-install.sh @@ -14,6 +14,8 @@ deb-src http://deb.debian.org/debian buster-updates main EOF +export DEBIAN_FRONTEND=noninteractive + apt-get update apt-get install -y man wget curl telnet net-tools dnsutils traceroute unbound @@ -59,8 +61,3 @@ allow-hotplug eth0 iface eth0 inet dhcp EOF - -#### -# Cleanup -#### -#rm -v /home/vagrant/VBoxGuestAdditions*.iso