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?