choco install WinRM

37 views
Skip to first unread message

Henrry Salinas

unread,
Oct 11, 2018, 10:44:26 PM10/11/18
to Packer

I am using Packer to provision a VM (win7) with installed packages using chocolatey


One of these packages is mssqlserver2014express, see below:


"provisioners":{

    {
     
"type":"powershell",
     
"script":"./scripts/installChocolatey.ps1"
   
},
   
{
     
"type":"powershell",
     
"inline":[
         
"choco install mssqlserver2014express -y"
     
]
   
}
}  

The result of the execution stops with an error7


Exit code was '-2068774911' Error Message: 


The install of mssqlserver2014express was NOT successful.


The  package is being installed via a Remote PS WinRM script.


Does anyone that had the same error was able to solve it?

Message has been deleted

Jordan Borean

unread,
Oct 12, 2018, 3:04:14 AM10/12/18
to Packer
SQL Server requires use of DPAPI for the installation to work, by default a network logon like WinRM will not have access to the user's credentials to access its DPAPI store hence it failing. You need to run this with the "elevated_user" and "elevated_password" options which runs the process in a scheduled task with explicit credentials so it can access the DPAPI store. Another option is to call chocolatey with PsExec but you still need to specify the username/password for this to work.

Thanks

Jordan

Luis Mayorga

unread,
Oct 12, 2018, 7:20:33 AM10/12/18
to packe...@googlegroups.com
Running in debug mode -debug and login to your hypervisor to see the sql logs. You might be missing a dependency or net framework and and specific win update.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/ee7886f8-5245-4552-9c91-e5d6010f325a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Luis Mayorga
Software & Devops Engineer
E. lmayorga@lm3corp.com
T. @louismayorga

Henrry Salinas

unread,
Oct 12, 2018, 1:02:17 PM10/12/18
to packe...@googlegroups.com
The issue was indeed as Jordan Borean said  "by default a network logon like WinRM will not have access to the user's credentials to access its DPAPI store hence it failing "

the below modification made the magic
"provisioners":{

    {
     
"type":"powershell",
     
"script":"./scripts/installChocolatey.ps1"
   
},
   
{
     
"type":"powershell",
           "elevated_user":"packer",
           "elevated_password":"{{.WinRMPassword}}",
      "inline":[
         
"choco install mssqlserver2014express -y"
     
]
   
}
}

Thanks,
Regards.

Reply all
Reply to author
Forward
0 new messages