Tried the install with a batch script as well, but same result. Any 
suggestions?

==> vmware-iso: Provisioning with shell script: install_vmtools.bat

2019/05/28 04:52:27 cracklib-packer: 2019/05/28 04:52:27 Opening 
install_vmtools.bat for reading

2019/05/28 04:52:27 cracklib-packer: 2019/05/28 04:52:27 Uploading file to 
'c:/Windows/Temp/script.bat'

2019/05/28 04:52:27 cracklib-packer: 2019/05/28 04:52:27 [INFO] 80 bytes 
written for 'uploadData'

2019/05/28 04:52:27 [INFO] 80 bytes written for 'uploadData'

2019/05/28 04:52:43 cracklib-packer: 2019/05/28 04:52:43 [INFO] starting 
remote command: set "PACKER_BUILDER_TYPE=vmware-iso" && set 
"PACKER_BUILD_NAME=vmware-iso" && "c:/Windows/Temp/script.bat"

    vmware-iso:

    vmware-iso: C:\Users\vagrant>cmd /c 
C:\Windows\Temp\VMWaretools\VMWaretools\setup64.exe /S /v"/qn REBOOT=R\"

2019/05/28 04:53:44 [INFO] 0 bytes written for 'stderr'

2019/05/28 04:53:44 cracklib-packer: 2019/05/28 04:53:44 [INFO] command 
'set "PACKER_BUILDER_TYPE=vmware-iso" && set "PACKER_BUILD_NAME=vmware-iso" 
&& "c:/Windows/Temp/script.bat"' exited with code: 0

2019/05/28 04:53:44 cracklib-packer: 2019/05/28 04:53:44 [INFO] RPC 
endpoint: Communicator ended with: 0

2019/05/28 04:53:44 [INFO] 101 bytes written for 'stdout'

2019/05/28 04:53:44 [INFO] RPC client: Communicator ended with: 0

2019/05/28 04:53:44 [INFO] RPC endpoint: Communicator ended with: 0

2019/05/28 04:53:44 cracklib-packer: 2019/05/28 04:53:44 [INFO] 0 bytes 
written for 'stderr'

2019/05/28 04:53:44 cracklib-packer: 2019/05/28 04:53:44 [INFO] 101 bytes 
written for 'stdout'

2019/05/28 04:53:44 cracklib-packer: 2019/05/28 04:53:44 [INFO] RPC client: 
Communicator ended with: 0

2019/05/28 04:53:44 [INFO] (telemetry) ending windows-shell

2019/05/28 04:53:44 [INFO] (telemetry) Starting provisioner windows-restart



Command used: cmd /c C:\Windows\Temp\VMWaretools\VMWaretools\setup64.exe /S 
/v"/qn REBOOT=R\"


Thanks

Shyam

On Tuesday, 28 May 2019 11:50:28 UTC+5:30, Shyam J wrote:
>
> Hi,
>
> I am trying to install vmtools using a powershell script below. Above 
> snippets are for dealing with TLS issues. 
> I am facing issue with installing with last command for installation. Same 
> command works fine when run manually but not when run through Packer.
>
>
>
> add-type @"
>     using System.Net;
>     using System.Security.Cryptography.X509Certificates;
>     public class TrustAllCertsPolicy : ICertificatePolicy {
>         public bool CheckValidationResult(
>             ServicePoint srvPoint, X509Certificate certificate,
>             WebRequest request, int certificateProblem) {
>             return true;
>         }
>     }
> "@
> [System.Net.ServicePointManager]::CertificatePolicy = New-Object 
> TrustAllCertsPolicy;
> (New-Object System.Net.WebClient).DownloadFile('
> https://10.7.64.21/swrepo/VMwareTools.zip
> ','C:\Windows\Temp\VMwareTools.zip');
> Start-Sleep -Seconds 60;
> #Microsoft.PowerShell.Archive\Expand-Archive -literalpath 
> 'C:\Windows\Temp\VMwareTools.zip' -destinationpath 
> 'C:\Windows\Temp\VMwareTools';
> Add-Type -AssemblyName System.IO.Compression.FileSystem
> function Unzip
> {
>     param([string]$zipfile, [string]$outpath)
>
>     [System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
> }
>
> Unzip "C:\Windows\Temp\VMwareTools.zip" "C:\Windows\Temp\VMwareTools"
> Start-Sleep -Seconds 20;
> Start-Process -Wait -PassThru -FilePath 
> C:\Windows\Temp\VMWaretools\VMWaretools\setup64.exe -ArgumentList "/S /l 
> C:\Windows\Temp\vmware_tools.log /v""/qn REBOOT=R""";
> Start-Sleep -Seconds 300;
>
>
>
> Please see output below in logging mode. No errors are being thrown and 
> showing successful, but nothing has happened inside VM. Tried installing 
> changing different parameters but no luck.
>
> Output
> ======
>
> ==> vmware-iso: Provisioning with Powershell...
>
> ==> vmware-iso: Provisioning with powershell script: post_windows2.ps1
>
> 2019/05/21 08:30:01 cracklib-packer: 2019/05/21 08:30:01 Opening 
> post_windows2.ps1 for reading
>
> 2019/05/21 08:30:01 cracklib-packer: 2019/05/21 08:30:01 Uploading env 
> vars to 
> c:/Windows/Temp/packer-ps-env-vars-5ce3f82d-9a5e-bf27-ac72-f14cc6752312.ps1
>
> 2019/05/21 08:30:01 cracklib-packer: 2019/05/21 08:30:01 [INFO] 76 bytes 
> written for 'uploadData'
>
> 2019/05/21 08:30:01 [INFO] 76 bytes written for 'uploadData'
>
> 2019/05/21 08:30:01 cracklib-packer: 2019/05/21 08:30:01 Uploading file to 
> 'c:/Windows/Temp/packer-ps-env-vars-5ce3f82d-9a5e-bf27-ac72-f14cc6752312.ps1'
>
> 2019/05/21 08:30:25 cracklib-packer: 2019/05/21 08:30:25 Uploading file to 
> 'c:/Windows/Temp/script-5ce3f82d-affa-c82d-499f-42e5b41dcf37.ps1'
>
> 2019/05/21 08:30:25 cracklib-packer: 2019/05/21 08:30:25 [INFO] 1226 bytes 
> written for 'uploadData'
>
> 2019/05/21 08:30:25 [INFO] 1226 bytes written for 'uploadData'
>
> 2019/05/21 08:30:36 cracklib-packer: 2019/05/21 08:30:36 [INFO] starting 
> remote command: powershell -executionpolicy bypass "& { if (Test-Path 
> variable:global:ProgressPreference){set-variable -name 
> variable:global:ProgressPreference -value 'SilentlyContinue'};. 
> c:/Windows/Temp/packer-ps-env-vars-5ce3f82d-9a5e-bf27-ac72-f14cc6752312.ps1; 
> &'c:/Windows/Temp/script-5ce3f82d-affa-c82d-499f-42e5b41dcf37.ps1'; exit 
> $LastExitCode }"
>
>     vmware-iso:
>
>     vmware-iso: Handles  NPM(K)    PM(K)      WS(K) VM(M)   CPU(s)     Id 
> ProcessName
>
>     vmware-iso: -------  ------    -----      ----- -----   ------     -- 
> -----------
>
>     vmware-iso:      54       5      768       3216    43     0.06    908 
> setup64
>
> 2019/05/21 08:36:21 cracklib-packer: 2019/05/21 08:36:21 [INFO] command 
> 'powershell -executionpolicy bypass "& { if (Test-Path 
> variable:global:ProgressPreference){set-variable -name 
> variable:global:ProgressPreference -value 'SilentlyContinue'};. 
> c:/Windows/Temp/packer-ps-env-vars-5ce3f82d-9a5e-bf27-ac72-f14cc6752312.ps1; 
> &'c:/Windows/Temp/script-5ce3f82d-affa-c82d-499f-42e5b41dcf37.ps1'; exit 
> $LastExitCode }"' exited with code: 0
>
> 2019/05/21 08:36:21 cracklib-packer: 2019/05/21 08:36:21 [INFO] RPC 
> endpoint: Communicator ended with: 0
>
> 2019/05/21 08:36:21 [INFO] 245 bytes written for 'stdout'
>
> 2019/05/21 08:36:21 [INFO] 0 bytes written for 'stderr'
>
> 2019/05/21 08:36:21 [INFO] RPC client: Communicator ended with: 0
>
> 2019/05/21 08:36:21 [INFO] RPC endpoint: Communicator ended with: 0
>
> 2019/05/21 08:36:21 cracklib-packer: 2019/05/21 08:36:21 [INFO] 245 bytes 
> written for 'stdout'
>
> 2019/05/21 08:36:21 cracklib-packer: 2019/05/21 08:36:21 [INFO] 0 bytes 
> written for 'stderr'
>
> 2019/05/21 08:36:21 [INFO] (telemetry) ending powershell
>
>
> Thanks in advance
>
> Shyam
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/0f9fbd0e-e3bd-4804-b7b0-3dc1213d7ffe%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to