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
5b6140b2
Commit
5b6140b2
authored
Aug 11, 2015
by
Kristopher Ruzic
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix up
parent
60bbe850
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
builder/qemu/builder.go
builder/qemu/builder.go
+7
-1
builder/qemu/step_type_boot_command.go
builder/qemu/step_type_boot_command.go
+3
-1
No files found.
builder/qemu/builder.go
View file @
5b6140b2
...
...
@@ -105,6 +105,7 @@ type Config struct {
ShutdownCommand
string
`mapstructure:"shutdown_command"`
SSHHostPortMin
uint
`mapstructure:"ssh_host_port_min"`
SSHHostPortMax
uint
`mapstructure:"ssh_host_port_max"`
VncIP
string
`mapstructure:"vnc_ip"`
VNCPortMin
uint
`mapstructure:"vnc_port_min"`
VNCPortMax
uint
`mapstructure:"vnc_port_max"`
VMName
string
`mapstructure:"vm_name"`
...
...
@@ -354,10 +355,15 @@ func (b *Builder) Prepare(raws ...interface{}) ([]string, error) {
"a checksum is highly recommended."
)
}
if
b
.
config
.
VncIP
==
""
{
warnings
=
append
(
warnings
,
"No VNC IP address specified, will default to 127.0.0.1"
)
b
.
config
.
VncIP
=
"127.0.0.1"
}
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
return
warnings
,
errs
}
return
warnings
,
nil
}
...
...
builder/qemu/step_type_boot_command.go
View file @
5b6140b2
...
...
@@ -40,10 +40,12 @@ func (s *stepTypeBootCommand) Run(state multistep.StateBag) multistep.StepAction
httpPort
:=
state
.
Get
(
"http_port"
)
.
(
uint
)
ui
:=
state
.
Get
(
"ui"
)
.
(
packer
.
Ui
)
vncPort
:=
state
.
Get
(
"vnc_port"
)
.
(
uint
)
vncAddr
:=
state
.
Get
(
"vnc_ip"
)
.
(
string
)
// Connect to VNC
ui
.
Say
(
"Connecting to VM via VNC"
)
nc
,
err
:=
net
.
Dial
(
"tcp"
,
fmt
.
Sprintf
(
"127.0.0.1:%d"
,
vncPort
))
// tbh why is this hardcoded anyway?
nc
,
err
:=
net
.
Dial
(
"tcp"
,
fmt
.
Sprintf
(
"%s:%d"
,
vncAddr
,
vncPort
))
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error connecting to VNC: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
...
...
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