From e2d8c0bfd78b9accb789e886bdac752b2d1a14aa Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 8 Feb 2019 09:28:10 -0800 Subject: [PATCH] docs --- builder/virtualbox/ovf/builder.go | 7 ++-- builder/virtualbox/ovf/config.go | 32 +++++++++++-------- .../docs/builders/virtualbox-iso.html.md.erb | 6 ++++ .../docs/builders/virtualbox-ovf.html.md.erb | 4 +++ 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/builder/virtualbox/ovf/builder.go b/builder/virtualbox/ovf/builder.go index 60142728f..3a8b3f901 100644 --- a/builder/virtualbox/ovf/builder.go +++ b/builder/virtualbox/ovf/builder.go @@ -84,7 +84,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe ImportFlags: b.config.ImportFlags, }, &vboxcommon.StepAttachGuestAdditions{ - GuestAdditionsMode: b.config.GuestAdditionsMode, + GuestAdditionsMode: b.config.GuestAdditionsMode, + GuestAdditionsInterface: b.config.GuestAdditionsInterface, }, &vboxcommon.StepConfigureVRDP{ VRDPBindAddress: b.config.VRDPBindAddress, @@ -136,7 +137,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe Timeout: b.config.ShutdownTimeout, Delay: b.config.PostShutdownDelay, }, - new(vboxcommon.StepRemoveDevices), + &vboxcommon.StepRemoveDevices{ + GuestAdditionsInterface: b.config.GuestAdditionsInterface, + }, &vboxcommon.StepVBoxManage{ Commands: b.config.VBoxManagePost, Ctx: b.config.ctx, diff --git a/builder/virtualbox/ovf/config.go b/builder/virtualbox/ovf/config.go index bd60a4c4c..03eccf029 100644 --- a/builder/virtualbox/ovf/config.go +++ b/builder/virtualbox/ovf/config.go @@ -1,4 +1,4 @@ -package ovf +Gpackage ovf import ( "fmt" @@ -28,19 +28,20 @@ type Config struct { vboxcommon.VBoxManagePostConfig `mapstructure:",squash"` vboxcommon.VBoxVersionConfig `mapstructure:",squash"` - Checksum string `mapstructure:"checksum"` - ChecksumType string `mapstructure:"checksum_type"` - GuestAdditionsMode string `mapstructure:"guest_additions_mode"` - GuestAdditionsPath string `mapstructure:"guest_additions_path"` - GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256"` - GuestAdditionsURL string `mapstructure:"guest_additions_url"` - ImportFlags []string `mapstructure:"import_flags"` - ImportOpts string `mapstructure:"import_opts"` - SourcePath string `mapstructure:"source_path"` - TargetPath string `mapstructure:"target_path"` - VMName string `mapstructure:"vm_name"` - KeepRegistered bool `mapstructure:"keep_registered"` - SkipExport bool `mapstructure:"skip_export"` + Checksum string `mapstructure:"checksum"` + ChecksumType string `mapstructure:"checksum_type"` + GuestAdditionsMode string `mapstructure:"guest_additions_mode"` + GuestAdditionsPath string `mapstructure:"guest_additions_path"` + GuestAdditionsInterface string `mapstructure:"guest_additions_interface"` + GuestAdditionsSHA256 string `mapstructure:"guest_additions_sha256"` + GuestAdditionsURL string `mapstructure:"guest_additions_url"` + ImportFlags []string `mapstructure:"import_flags"` + ImportOpts string `mapstructure:"import_opts"` + SourcePath string `mapstructure:"source_path"` + TargetPath string `mapstructure:"target_path"` + VMName string `mapstructure:"vm_name"` + KeepRegistered bool `mapstructure:"keep_registered"` + SkipExport bool `mapstructure:"skip_export"` ctx interpolate.Context } @@ -72,6 +73,9 @@ func NewConfig(raws ...interface{}) (*Config, []string, error) { if c.GuestAdditionsPath == "" { c.GuestAdditionsPath = "VBoxGuestAdditions.iso" } + if b.config.GuestAdditionsInterface == "" { + b.config.GuestAdditionsInterface = "ide" + } if c.VMName == "" { c.VMName = fmt.Sprintf( diff --git a/website/source/docs/builders/virtualbox-iso.html.md.erb b/website/source/docs/builders/virtualbox-iso.html.md.erb index 4337cb7c8..e7ec0b84d 100644 --- a/website/source/docs/builders/virtualbox-iso.html.md.erb +++ b/website/source/docs/builders/virtualbox-iso.html.md.erb @@ -164,6 +164,12 @@ builder. - `format` (string) - Either `ovf` or `ova`, this specifies the output format of the exported virtual machine. This defaults to `ovf`. +- `guest_additions_interface` (string) - The interface type to use to mount + guest additions when `guest_additions_mode` is set to `attach`. Will + default to the value set in `iso_interface`, if `iso_interface` is set. + Will default to "ide", if `iso_interface` is not set. Options are "ide" and + "sata". + - `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 diff --git a/website/source/docs/builders/virtualbox-ovf.html.md.erb b/website/source/docs/builders/virtualbox-ovf.html.md.erb index d3ca4d7ae..379e5cb8a 100644 --- a/website/source/docs/builders/virtualbox-ovf.html.md.erb +++ b/website/source/docs/builders/virtualbox-ovf.html.md.erb @@ -152,6 +152,10 @@ builder. - `format` (string) - Either `ovf` or `ova`, this specifies the output format of the exported virtual machine. This defaults to `ovf`. +- `guest_additions_interface` (string) - The interface type to use to mount + guest additions when `guest_additions_mode` is set to `attach`. Will + default to "ide" if not set. Options are "ide" and "sata". + - `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