installing visualstudio

169 views
Skip to first unread message

Florian

unread,
Dec 1, 2016, 8:16:03 AM12/1/16
to Packer
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?

Alvaro Miranda Aguilera

unread,
Dec 1, 2016, 9:07:33 AM12/1/16
to packe...@googlegroups.com
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:

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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/24a39902-19d0-4c45-bca2-ae33ee441973%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Rickard von Essen

unread,
Dec 1, 2016, 2:54:40 PM12/1/16
to packe...@googlegroups.com
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.

Reply all
Reply to author
Forward
0 new messages