Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builder/virtualbox/common/step_attach_floppy.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (s *StepAttachFloppy) Run(ctx context.Context, state multistep.StateBag) mu
// Create the floppy disk controller
command := []string{
"storagectl", vmName,
"--name", "Floppy Controller",
"--name", "Floppy",
"--add", "floppy",
}
if err := driver.VBoxManage(command...); err != nil {
Expand All @@ -74,7 +74,7 @@ func (s *StepAttachFloppy) Run(ctx context.Context, state multistep.StateBag) mu
// Attach the floppy to the controller
command = []string{
"storageattach", vmName,
"--storagectl", "Floppy Controller",
"--storagectl", "Floppy",
"--port", "0",
"--device", "0",
"--type", "fdd",
Expand Down Expand Up @@ -106,7 +106,7 @@ func (s *StepAttachFloppy) Cleanup(state multistep.StateBag) {

command := []string{
"storageattach", vmName,
"--storagectl", "Floppy Controller",
"--storagectl", "Floppy",
"--port", "0",
"--device", "0",
"--medium", "none",
Expand Down
18 changes: 9 additions & 9 deletions builder/virtualbox/common/step_attach_isos.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,43 +79,43 @@ func (s *StepAttachISOs) Run(ctx context.Context, state multistep.StateBag) mult
switch diskCategory {
case "boot_iso":
// figure out controller path
controllerName = "IDE Controller"
controllerName = "IDE"
port = 0
device = 1
if s.ISOInterface == "sata" {
controllerName = "SATA Controller"
controllerName = "SATA"
port = 13
device = 0
} else if s.ISOInterface == "virtio" {
controllerName = "VirtIO Controller"
controllerName = "VirtioSCSI"
port = 13
device = 0
}
ui.Message("Mounting boot ISO...")
case "guest_additions":
controllerName = "IDE Controller"
controllerName = "IDE"
port = 1
device = 0
if s.GuestAdditionsInterface == "sata" {
controllerName = "SATA Controller"
controllerName = "SATA"
port = 14
device = 0
} else if s.GuestAdditionsInterface == "virtio" {
controllerName = "VirtIO Controller"
controllerName = "VirtioSCSI"
port = 14
device = 0
}
ui.Message("Mounting guest additions ISO...")
case "cd_files":
controllerName = "IDE Controller"
controllerName = "IDE"
port = 1
device = 1
if s.ISOInterface == "sata" {
controllerName = "SATA Controller"
controllerName = "SATA"
port = 15
device = 0
} else if s.ISOInterface == "virtio" {
controllerName = "VirtIO Controller"
controllerName = "VirtioSCSI"
port = 15
device = 0
}
Expand Down
4 changes: 2 additions & 2 deletions builder/virtualbox/common/step_remove_devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (s *StepRemoveDevices) Run(ctx context.Context, state multistep.StateBag) m
ui.Message("Removing floppy drive...")
command := []string{
"storageattach", vmName,
"--storagectl", "Floppy Controller",
"--storagectl", "Floppy",
"--port", "0",
"--device", "0",
"--medium", "none",
Expand All @@ -59,7 +59,7 @@ func (s *StepRemoveDevices) Run(ctx context.Context, state multistep.StateBag) m
// Don't forget to remove the floppy controller as well
command = []string{
"storagectl", vmName,
"--name", "Floppy Controller",
"--name", "Floppy",
"--remove",
}
err := driver.VBoxManage(command...)
Expand Down
12 changes: 6 additions & 6 deletions builder/virtualbox/common/step_remove_devices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestStepRemoveDevices_attachedIso(t *testing.T) {
diskUnmountCommands := map[string][]string{
"boot_iso": []string{
"storageattach", "myvm",
"--storagectl", "IDE Controller",
"--storagectl", "IDE",
"--port", "0",
"--device", "1",
"--type", "dvddrive",
Expand All @@ -67,7 +67,7 @@ func TestStepRemoveDevices_attachedIso(t *testing.T) {
if len(driver.VBoxManageCalls) != 1 {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
if driver.VBoxManageCalls[0][3] != "IDE Controller" {
if driver.VBoxManageCalls[0][3] != "IDE" {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
}
Expand All @@ -79,7 +79,7 @@ func TestStepRemoveDevices_attachedIsoOnSata(t *testing.T) {
diskUnmountCommands := map[string][]string{
"boot_iso": []string{
"storageattach", "myvm",
"--storagectl", "SATA Controller",
"--storagectl", "SATA",
"--port", "0",
"--device", "1",
"--type", "dvddrive",
Expand All @@ -103,7 +103,7 @@ func TestStepRemoveDevices_attachedIsoOnSata(t *testing.T) {
if len(driver.VBoxManageCalls) != 1 {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
if driver.VBoxManageCalls[0][3] != "SATA Controller" {
if driver.VBoxManageCalls[0][3] != "SATA" {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
}
Expand All @@ -129,10 +129,10 @@ func TestStepRemoveDevices_floppyPath(t *testing.T) {
if len(driver.VBoxManageCalls) != 2 {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
if driver.VBoxManageCalls[0][3] != "Floppy Controller" {
if driver.VBoxManageCalls[0][3] != "Floppy" {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
if driver.VBoxManageCalls[1][3] != "Floppy Controller" {
if driver.VBoxManageCalls[1][3] != "Floppy" {
t.Fatalf("bad: %#v", driver.VBoxManageCalls)
}
}
20 changes: 10 additions & 10 deletions builder/virtualbox/iso/step_create_disk.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) mult
// Add the IDE controller so we can later attach the disk.
// When the hard disk controller is not IDE, this device is still used
// by VirtualBox to deliver the guest extensions.
err := driver.VBoxManage("storagectl", vmName, "--name", "IDE Controller", "--add", "ide")
err := driver.VBoxManage("storagectl", vmName, "--name", "IDE", "--add", "ide")
if err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
Expand All @@ -80,7 +80,7 @@ func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) mult
// the IDE controller above because some other things (disks) require
// that.
if config.HardDriveInterface == "sata" || config.ISOInterface == "sata" {
if err := driver.CreateSATAController(vmName, "SATA Controller", config.SATAPortCount); err != nil {
if err := driver.CreateSATAController(vmName, "SATA", config.SATAPortCount); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
Expand All @@ -92,7 +92,7 @@ func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) mult
// the VirtIO controller above because some other things (disks) require
// that.
if config.HardDriveInterface == "virtio" || config.ISOInterface == "virtio" {
if err := driver.CreateVirtIOController(vmName, "VirtIO Controller"); err != nil {
if err := driver.CreateVirtIOController(vmName, "VirtioSCSI"); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
Expand All @@ -101,14 +101,14 @@ func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) mult
}

if config.HardDriveInterface == "scsi" {
if err := driver.CreateSCSIController(vmName, "SCSI Controller"); err != nil {
if err := driver.CreateSCSIController(vmName, "SCSI"); err != nil {
err := fmt.Errorf("Error creating disk controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
return multistep.ActionHalt
}
} else if config.HardDriveInterface == "pcie" {
if err := driver.CreateNVMeController(vmName, "NVMe Controller", config.NVMePortCount); err != nil {
if err := driver.CreateNVMeController(vmName, "NVMe", config.NVMePortCount); err != nil {
err := fmt.Errorf("Error creating NVMe controller: %s", err)
state.Put("error", err)
ui.Error(err.Error())
Expand All @@ -117,15 +117,15 @@ func (s *stepCreateDisk) Run(ctx context.Context, state multistep.StateBag) mult
}

// Attach the disk to the controller
controllerName := "IDE Controller"
controllerName := "IDE"
if config.HardDriveInterface == "sata" {
controllerName = "SATA Controller"
controllerName = "SATA"
} else if config.HardDriveInterface == "scsi" {
controllerName = "SCSI Controller"
controllerName = "SCSI"
} else if config.HardDriveInterface == "virtio" {
controllerName = "VirtIO Controller"
controllerName = "VirtioSCSI"
} else if config.HardDriveInterface == "pcie" {
controllerName = "NVMe Controller"
controllerName = "NVMe"
}

nonrotational := "off"
Expand Down