Running windows-shell provisioner via ssh communicator cannot open gui application

29 views
Skip to first unread message

Marcus Lorentschk

unread,
May 20, 2019, 3:25:08 PM5/20/19
to Packer
We have a windows 10 image which is part of a vmware template. On top of this base VM we need to install some setup packages. All of them having silent installers except WinPCap 4.1.3. In order to get this setup installing automatically we are using autoIt which offers a script language to handle the setup window and buttons. This works fine even when invoking inside a vm via cmd.
But when executing the same command via windows-shell provisioner the setup gui is not opened (due to ssh restrictions).
Is there any provisionier we can use to handle that?

PsExec.exe offers a parameter-i which can invoke gui application via ssh like [PsExec.exe -i -d -s \\\\127.0.0.1 notepad]. Is there any Packer equivalent?

Megan Marsh

unread,
May 21, 2019, 3:04:48 PM5/21/19
to packe...@googlegroups.com
You may be able to try to change the execute_command option to call PsExec.exe; if PsExec needs to be called on your host machine rather than your guest VM you cab use the shell-local provisioner to call it instead of the windows-shell provisioner.

Marcus Lorentschk

unread,
May 22, 2019, 1:12:55 AM5/22/19
to Packer
I have tried to invoke the autoIt command on guest VM within PsExec and the -i parameter, with the help of a windows-shell provisioner, unfortunately this also does not open any UI. When i look into the task manager, i can see autoscript process as well as the target setup being startet, but never the less no UI is opened and therefor autoIt cannot handle any button.

Megan Marsh

unread,
May 22, 2019, 1:44:58 PM5/22/19
to packe...@googlegroups.com
Then there may not be a way to do this. Packer was not designed with the need for GUI interaction in mind.

Jordan Borean

unread,
May 22, 2019, 3:02:14 PM5/22/19
to Packer
If you want to show it on an existing logon session you need to use the -i <session id> argument where the session is the ID of the session you want to show it on. If you omit the number after -i it will use the current session to display the program interactively but because Packer runs over WinRM it will be session 0 which is never an console or RDP logon session.

Marcus Lorentschk

unread,
May 22, 2019, 3:06:53 PM5/22/19
to Packer
Yes, packer was not designed to show UI inside the guest VM, we just need this for the issue with non silent installers. I found a way to do this via PsExec. I invoke this within a local shell provider (opening a second ssh session) using the -i parameter. This works fine. 

Thanks for your suggestions.
Reply all
Reply to author
Forward
0 new messages