and use -on-error=ask while developing so when it fails you can sort out
why and test out a working solution before restarting the build.

On 1 December 2016 at 15:07, Alvaro Miranda Aguilera <kiki...@gmail.com>
wrote:

> for the ps question, you can use virtualbox-iso for a base vm, and then
> virtualbox-ovf to create the next one.
>
> have a look here. there is a link to the github project:
> https://hodgkins.io/best-practices-with-packer-and-windows
>
> Alvaro.
>
> On Thu, Dec 1, 2016 at 2:16 PM, 'Florian' via Packer <
> packer-tool@googlegroups.com> wrote:
>
>> Hi,
>>
>> I have a strange issue trying to automatically install visual studio
>> inside a vm with packer:
>>
>>         {
>>             "type" : "powershell",
>>             "elevated_user": "{{user `ssh_name`}}",
>>             "elevated_password": "{{user `ssh_pass`}}",
>>             "inline": [
>>                 "NET USE S: /DELETE /YES >NUL 2>NUL",
>>                 "NET USE S: \\\\host\\shared /persistent:no /YES",
>>                 "while (!(Test-Path \"S:\\\")) {",
>>                 "   NET USE S: /DELETE /YES >NUL 2>NUL",
>>                 "   NET USE S: \\\\host\\shared /persistent:no /YES",
>>                 "}",
>>                 "S:",
>>                 "Write-Host \"Calling Unattended VS2015 Setup - This
>> takes a while ...\"",
>>                 "cmd /C start /WAIT 
>> s:\\iso\\windows\\vs2015\\vs_professional.exe
>> /Quiet /NoRestart /NoRefresh /NoWeb /AdminFile
>> s:\\vm-provisioning\\configs\\jenkins\\windows-7-64\\visual-studio-2015-professional.xml
>> /Log $env:temp\\vs2015-setup.log",
>>                 "Write-Host \"Exited with $lastexitcode\"",
>>                 "exit 0"
>>             ]
>>         },
>>
>> I run with "PACKER_LOG=1":
>>
>>     virtualbox-iso: Calling Unattended VS2015 Setup - This takes a while
>> ...
>>     virtualbox-iso: Exited with 0
>> 2016/12/01 13:57:05 ui:     virtualbox-iso: Exited with 0
>> 2016/12/01 13:57:10 packer: 2016/12/01 13:57:10 [INFO] command
>> 'powershell -executionpolicy bypass -file "%TEMP%\packer-elevated-shell-
>> 58401290-b1c8-b157-0cd6-b29913e0a38e.ps1"' exited with code: 2
>> 2016/12/01 13:57:10 packer: 2016/12/01 13:57:10 [INFO] RPC endpoint:
>> Communicator ended with: 2
>>
>> so: why the heck it exits with code "2" ???
>>
>> I even explicitly set "exit 0" there?
>>
>> Thank you very much.
>>
>> Florian
>>
>> P.S: Is there a way to use packer in a kind of "snapshot" mode, so I dont
>> have to wait 30min each time before the that provisioning step runs?
>>
>> --
>> This mailing list is governed under the HashiCorp Community Guidelines -
>> https://www.hashicorp.com/community-guidelines.html. Behavior in
>> violation of those guidelines may result in your removal from this mailing
>> list.
>>
>> GitHub Issues: https://github.com/mitchellh/packer/issues
>> IRC: #packer-tool on Freenode
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Packer" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to packer-tool+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/packer-tool/24a39902-19d0-4c45-bca2-ae33ee441973%40googlegroups.com
>> <https://groups.google.com/d/msgid/packer-tool/24a39902-19d0-4c45-bca2-ae33ee441973%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Alvaro
>
> --
> This mailing list is governed under the HashiCorp Community Guidelines -
> https://www.hashicorp.com/community-guidelines.html. Behavior in
> violation of those guidelines may result in your removal from this mailing
> list.
>
> GitHub Issues: https://github.com/mitchellh/packer/issues
> IRC: #packer-tool on Freenode
> ---
> You received this message because you are subscribed to the Google Groups
> "Packer" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/CAHqq0ezWn-cwWLhHTwE%2BDr%3DZ-rYs%
> 2BagtiaLy2oi-cbBc1Y8Wng%40mail.gmail.com
> <https://groups.google.com/d/msgid/packer-tool/CAHqq0ezWn-cwWLhHTwE%2BDr%3DZ-rYs%2BagtiaLy2oi-cbBc1Y8Wng%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CALz9Rt8ykjPtHeaiioX_C8qChYPT-Ak6JaThEwn1k%3D_9njcFJw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to