New to Packer but am very close to getting my first base box for vagrant working properly. I have a script that will ensure our developers are using VirtualBox 5.2.0. I downloaded the VBoxGuestAdditions.iso and am placing it via my builder. I tried moving it around and placing it in /tmp then using a bootstrap to move it to the proper location but it isn't working. Once my base box is created, running vagrant up produces the following error:
[default] GuestAdditions versions on your host (5.2.0) and guest (5.0.18) do not match.
As we want to keep our hosts 5.2.0, I need to have my base box created with 5.2.0. Here is my current builder:
"builders": [
{
"type": "virtualbox-iso",
"guest_os_type": "Ubuntu_64",
"guest_additions_url": "./VBoxGuestAdditions.iso",
"iso_checksum": "f3532991e031cae75bcf5e695afb844dd278fff9",
"iso_checksum_type": "sha1",
"vm_name": "packer-ubuntu-16.04-amd64",
"disk_size": "{{ user `disk_size` }}",
"headless": "{{ user `headless` }}",
"boot_wait": "5s",
"http_directory": "http",
"boot_command": [
"<enter><wait>",
"<f6><esc>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
"<bs><bs><bs>",
"/install/vmlinuz ",
"initrd=/install/initrd.gz ",
"auto=true ",
"priority=critical ",
"net.ifnames=0 ",
"url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
"<wait><enter>"
],
"ssh_wait_timeout": "30m",
"ssh_username": "ubuntu",
"ssh_password": "ubuntu",
"shutdown_command": "sudo systemctl poweroff",
"vboxmanage": [
["modifyvm", "{{ .Name }}", "--memory", "{{ user `memory` }}"],
["modifyvm", "{{ .Name }}", "--cpus", "{{ user `cpus` }}"]
]
}
],
The guest_additions_url is the download straight from
virtualbox.org for 5.2.0. When Packer is building my image, I see the following info messages so not sure why it gets downgraded to 5.0.18:
==> virtualbox-iso: Downloading or copying Guest additions checksums
==> virtualbox-iso: Downloading or copying Guest additions
virtualbox-iso: Downloading or copying: file:///Users/matt.denton/config_management/puppet/packer/VBoxGuestAdditions.iso
Getting into my base box via vagrant up (and taking the time to update the guest additions via vagrant-vbguest plugin) I see the following broken symlink:
lrwxrwxrwx 1 root root 52 Oct 29 14:35 VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.2.0/lib/VBoxGuestAdditions
If I change the symlink to point /usr/lib/VboxGuestAdditions to the same .iso I have in my builder, it all works. Really been beating my head against the wall and any assistance on this would be appreciated. Thanks!