diff --git a/builder/virtualbox/step_download_guest_additions.go b/builder/virtualbox/step_download_guest_additions.go index f28d9cd90..759336bb2 100644 --- a/builder/virtualbox/step_download_guest_additions.go +++ b/builder/virtualbox/step_download_guest_additions.go @@ -16,6 +16,11 @@ import ( "time" ) +var additionsVersionMap = map[string]string { + "4.2.1": "4.2.0", + "4.1.23": "4.1.22", +} + // This step uploads a file containing the VirtualBox version, which // can be useful for various provisioning reasons. // @@ -35,6 +40,11 @@ func (s *stepDownloadGuestAdditions) Run(state map[string]interface{}) multistep return multistep.ActionHalt } + if newVersion, ok := additionsVersionMap[version]; ok { + log.Printf("Rewriting guest additions version: %s to %s", version, newVersion) + version = newVersion + } + // First things first, we get the list of checksums for the files available // for this version. checksumsUrl := fmt.Sprintf("http://download.virtualbox.org/virtualbox/%s/SHA256SUMS", version)