From ea86cb4c7e6c3ca3e8f894d8277ce91bc478b8bf Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 13 Jun 2015 19:30:16 -0400 Subject: [PATCH] builder/qemu: use proper ssh port [GH-2074] --- builder/qemu/step_run.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/builder/qemu/step_run.go b/builder/qemu/step_run.go index 4f64c4d8b..816a3d3d3 100644 --- a/builder/qemu/step_run.go +++ b/builder/qemu/step_run.go @@ -80,7 +80,8 @@ func getCommandArgs(bootDrive string, state multistep.StateBag) ([]string, error defaultArgs["-name"] = vmName defaultArgs["-machine"] = fmt.Sprintf("type=%s", config.MachineType) - defaultArgs["-netdev"] = fmt.Sprintf("user,id=user.0,hostfwd=tcp::%v-:22", sshHostPort) + defaultArgs["-netdev"] = fmt.Sprintf( + "user,id=user.0,hostfwd=tcp::%v-:%d", sshHostPort, config.SSHPort) defaultArgs["-device"] = fmt.Sprintf("%s,netdev=user.0", config.NetDevice) defaultArgs["-drive"] = fmt.Sprintf("file=%s,if=%s,cache=%s,discard=%s", imgPath, config.DiskInterface, config.DiskCache, config.DiskDiscard) if !config.DiskImage {