How to make Packer install guest additions and properly account for the Virtualbox version?

2,590 views
Skip to first unread message

smolinari

unread,
Mar 3, 2016, 4:46:38 AM3/3/16
to Packer
Hi,

I've got a shell provision, which installs the guest additions for Virtual box. However, I was lead to believe in another thread in the Vagrant forum that Packer can install these through some other method of provisioning. Something that is a default within Packer.

My main concern is, my provisioning is based on a certain version of Virtualbox.. How can I make the Packer provisioning independent of the Vagrant version being used? In fact, how can I make the provisioning take into account the right version of Virtualbox on the host system?

Scott 

Bernd Naumann

unread,
Mar 3, 2016, 5:34:31 AM3/3/16
to packe...@googlegroups.com
Hi scott,

Packer can automatically "insert" (copy) the guest-addtions, but you
have to install them by your self.
This is the default I think because I do not find any explicit config in
my files.
If you build the box i.e. with 4.3 and then start it on 5.0 you will get
a notice about that, and then have to update it manualy or via script.

Bernd

PS: https://www.packer.io/docs/builders/virtualbox-iso.html

guest_additions_mode (string) - The method by which guest additions are
made available to the guest for installation. Valid options are
"upload", "attach", or "disable". If the mode is "attach" the guest
additions ISO will be attached as a CD device to the virtual machine. If
the mode is "upload" the guest additions ISO will be uploaded to the
path specified by guest_additions_path. The default value is "upload".
If "disable" is used, guest additions won't be downloaded, either.

smolinari

unread,
Mar 3, 2016, 2:07:26 PM3/3/16
to Packer
Thanks Bernd. 

I guess I'll just assume everyone keeps their Virtualbox software up-to-date.

Scott 
Reply all
Reply to author
Forward
0 new messages