Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
c1c9204e
Commit
c1c9204e
authored
Jun 11, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/virtualbox: actually attach the hard drive
parent
7a9499e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
builder/virtualbox/driver.go
builder/virtualbox/driver.go
+11
-4
builder/virtualbox/step_create_disk.go
builder/virtualbox/step_create_disk.go
+2
-2
No files found.
builder/virtualbox/driver.go
View file @
c1c9204e
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
=
&
std
err
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
{
...
...
builder/virtualbox/step_create_disk.go
View file @
c1c9204e
...
...
@@ -27,7 +27,7 @@ func (s *stepCreateDisk) Run(state map[string]interface{}) multistep.StepAction
command
:=
[]
string
{
"createhd"
,
"--filename"
,
path
,
"--size"
,
"40"
,
"--size"
,
"40
000
"
,
"--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
{
"storage
ctl
"
,
vmName
,
"storage
attach
"
,
vmName
,
"--storagectl"
,
controllerName
,
"--port"
,
"0"
,
"--device"
,
"0"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment