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
4ef38744
Commit
4ef38744
authored
Sep 02, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/virtualbox-*: seed RNG [GH-1386]
parent
df8e2f4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/virtualbox/iso/builder.go
builder/virtualbox/iso/builder.go
+8
-2
builder/virtualbox/ovf/builder.go
builder/virtualbox/ovf/builder.go
+5
-0
No files found.
CHANGELOG.md
View file @
4ef38744
...
...
@@ -18,6 +18,7 @@ BUG FIXES:
*
builder/parallels/all: Add support for Parallels Desktop 10 [GH-1438]
*
builder/parallels/all: Added some navigation keys [GH-1442]
*
builder/qemu: If headless, sdl display won't be used. [GH-1395]
*
builder/virtualbox/all: Seed RNG to avoid same ports. [GH-1386]
*
builder/vmware/all:
`ssh_host`
accepts templates. [GH-1396]
*
builder/vmware/vmx: Do not re-add floppy disk files to VMX [GH-1361]
...
...
builder/virtualbox/iso/builder.go
View file @
4ef38744
...
...
@@ -3,12 +3,15 @@ package iso
import
(
"errors"
"fmt"
"log"
"math/rand"
"strings"
"time"
"github.com/mitchellh/multistep"
vboxcommon
"github.com/mitchellh/packer/builder/virtualbox/common"
"github.com/mitchellh/packer/common"
"github.com/mitchellh/packer/packer"
"log"
"strings"
)
const
BuilderId
=
"mitchellh.virtualbox"
...
...
@@ -254,6 +257,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
// Seed the random number generator
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
// Create the driver that we'll use to communicate with VirtualBox
driver
,
err
:=
vboxcommon
.
NewDriver
()
if
err
!=
nil
{
...
...
builder/virtualbox/ovf/builder.go
View file @
4ef38744
...
...
@@ -4,6 +4,8 @@ import (
"errors"
"fmt"
"log"
"math/rand"
"time"
"github.com/mitchellh/multistep"
vboxcommon
"github.com/mitchellh/packer/builder/virtualbox/common"
...
...
@@ -32,6 +34,9 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
// Run executes a Packer build and returns a packer.Artifact representing
// a VirtualBox appliance.
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
// Seed the random number generator
rand
.
Seed
(
time
.
Now
()
.
UTC
()
.
UnixNano
())
// Create the driver that we'll use to communicate with VirtualBox
driver
,
err
:=
vboxcommon
.
NewDriver
()
if
err
!=
nil
{
...
...
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