Commit c1c9204e authored by Mitchell Hashimoto's avatar Mitchell Hashimoto

builder/virtualbox: actually attach the hard drive

parent 7a9499e1
package virtualbox
import (
"bytes"
"fmt"
"log"
"os/exec"
"strings"
"time"
)
......@@ -46,13 +48,18 @@ func (d *VBox42Driver) SuppressMessages() error {
}
func (d *VBox42Driver) VBoxManage(args ...string) error {
var stdout, stderr bytes.Buffer
log.Printf("Executing VBoxManage: %#v", args)
cmd := exec.Command(d.VBoxManagePath, args...)
if err := cmd.Run(); err != nil {
return err
}
cmd.Stdout = &stdout
cmd.Stderr = &stderr
err := cmd.Run()
return nil
log.Printf("stdout: %s", strings.TrimSpace(stdout.String()))
log.Printf("stderr: %s", strings.TrimSpace(stderr.String()))
return err
}
func (d *VBox42Driver) Verify() error {
......
......@@ -27,7 +27,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
command := []string{
"createhd",
"--filename", path,
"--size", "40",
"--size", "40000",
"--format", format,
"--variant", "Standard",
}
......@@ -52,7 +52,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
// Attach the disk to the controller
command = []string{
"storagectl", vmName,
"storageattach", vmName,
"--storagectl", controllerName,
"--port", "0",
"--device", "0",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment