Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading files sometimes produces "Access is denied" errors #8

Open
sneal opened this issue Oct 27, 2015 · 3 comments
Open

Uploading files sometimes produces "Access is denied" errors #8

sneal opened this issue Oct 27, 2015 · 3 comments

Comments

@sneal
Copy link

sneal commented Oct 27, 2015

Posting this to start a discussion from a Packer group discussion

[[WSMAN ERROR CODE: 5]: <f:WSManFault Code='5' Machine='127.0.0.1' xmlns:f='http://schemas.microsoft.com/wbem/wsman/1/wsmanfault'><f:Message><f:ProviderFault path='%systemroot%\system32\winrscmd.dll' provider='Shell cmd plugin'>Access is denied. </f:ProviderFault></f:Message></f:WSManFault>]

I've seen this error reproduced outside this codebase via test-kitchen which is Ruby based, so its not necessarily a winrmcp lib problem. The common denominator seems to be uploading files to a Windows 2012R2 guest via WinRM from a Linux host. Oddly this seems to work fine from an OS X host.

@sneal
Copy link
Author

sneal commented Oct 27, 2015

Might be related to the network being set to public instead of work with VirtualBox...

@jozefizso
Copy link

I have problems with uploading VMWare windows.iso (102MB) from packer to Windows 7. I am running on Windows 10 Pro. The upload fails consistently even after several tries.

packer 0.8.6
VMware Workstation 12 Pro
Windows 7 Professional SP1
--> vmware-iso: Error uploading VMware Tools: Error uploading file to $env:TEMP\winrmcp-56b4a5be-9889-214a-65ea-17865dabf8b0.tmp: http error: 500
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:e="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:n="http://schemas.xmlsoap.org/ws/2004/09/enumeration" xmlns:p="http://schemas.microsoft.com/wbem/wsman/1/wsman.xsd" xmlns:w="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd" xmlns:x="http://schemas.xmlsoap.org/ws/2004/09/transfer" xml:lang="en-US">
  <s:Header>
    <a:Action>http://schemas.dmtf.org/wbem/wsman/1/wsman/fault</a:Action>
    <a:MessageID>uuid:5F713771-EB61-422F-8C43-839FA7E9C6CB</a:MessageID>
    <a:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</a:To>
    <a:RelatesTo>uuid:ecee6264-a016-412a-407e-684d861e8603</a:RelatesTo>
  </s:Header>
  <s:Body>
    <s:Fault>
      <s:Code>
        <s:Value>s:Sender</s:Value>
        <s:Subcode>
          <s:Value>w:AccessDenied</s:Value>
        </s:Subcode>
      </s:Code>
      <s:Reason>
        <s:Text xml:lang="en-US">Access is denied.</s:Text>
      </s:Reason>
      <s:Detail>
        <f:WSManFault xmlns:f="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault" Code="5" Machine="192.168.207.136">
          <f:Message>
            <f:ProviderFault provider="Shell cmd plugin" path="%systemroot%\system32\winrscmd.dll">Access is denied.</f:ProviderFault>
          </f:Message>
        </f:WSManFault>
      </s:Detail>
    </s:Fault>
  </s:Body>
</s:Envelope>

WinRM config:

winrm quickconfig -q
winrm quickconfig -transport:http
winrm set winrm/config @{MaxTimeoutms="1800000"}
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="2048"}
winrm set winrm/config/service @{AllowUnencrypted="true"}
winrm set winrm/config/service/auth @{Basic="true"}
winrm set winrm/config/client/auth @{Basic="true"}
winrm set winrm/config/listener?Address=*+Transport=HTTP @{Port="5985"}

@dragon788
Copy link

I have seen this Access denied error on a Windows 7 host attempting to build Win2012R2 so I don't think it's platform specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants