vmware-iso: Error: Can not open file as archive
{
"builders": [{
"type": "vmware-iso",
"boot_wait": "5m",
"communicator": "winrm",
"disk_size": 61440,
"floppy_files": [
"autounattend.xml",
"configure-winrm.ps1"
],
"guest_os_type": "windows8-64",
"headless": true,
"iso_url": "/Users/Lucius/ISOs/OSes/Windows81ENT/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_ENTERPRISE_EVAL_EN-US-IR3_CENA_X64FREE_EN-US_DV9.ISO",
"iso_checksum_type": "md5",
"iso_checksum": "ee63618e3be220d86b993c1abbcf32eb",
"winrm_username": "vagrant",
"winrm_password": "vagrant",
"winrm_timeout": "4h",
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"skip_compaction": false,
"vmx_data": {
"gui.fitguestusingnativedisplayresolution": "FALSE",
"memsize": "8192",
"numvcpus": "4",
"virtualHW.version": "10",
"scsi0.virtualDev": "lsisas1068"
}
}],
"provisioners": [
{
"type": "file",
"source": "windows.iso",
"destination": "c:\\Windows\\Temp\\windows.iso"
},
{
"type": "powershell",
"scripts": [
"install-7zip.ps1",
"install-vmware-tools.ps1"]
}],
"post-processors": [
{
"type": "vagrant",
"keep_input_artifact": false,
"output": "{{.Provider}}_windows-8.1.box"
}
]
}
"provisioners": [ { "type": "file", "source": "setup64.exe", "destination": "c:/windows/temp/vmware/setup64.exe" },
vmware-iso: Error restoring file from $env:TEMP\winrmcp-55a833bf-b981-55dd-44e6-8d2991140a6f.tmp to c:\windows\temp\vmware\setup64.exe: restore operation returned code=3221225725
==> vmware-iso: Uploading setup64.exe => C:/Windows/Temp/setup64.exe
==> vmware-iso: Upload failed: Error restoring file from $env:TEMP\winrmcp-55a88f5a-0b87-688d-d7e2-4ba4e8cee1c7.tmp to C:\Windows\Temp\setup64.exe: restore operation returned code=1
==> vmware-iso: Stopping virtual machine...
==> vmware-iso: Deleting output directory...
Build 'vmware-iso' errored: Error restoring file from $env:TEMP\winrmcp-55a88f5a-0b87-688d-d7e2-4ba4e8cee1c7.tmp to C:\Windows\Temp\setup64.exe: restore operation returned code=1
Hi there,
Packer build:
==> vmware-iso: Connected to WinRM!
==> vmware-iso: Uploading setup64.exe => C:/Windows/Temp/setup64.exe
==> vmware-iso: Provisioning with Powershell...
==> vmware-iso: Provisioning with shell script: install-vmware-tools.ps1
==> vmware-iso: Gracefully halting virtual machine...
vmware-iso: Waiting for VMware to clean up after itself...
==> vmware-iso: Deleting unnecessary VMware files...
and testing with vagrant$ vagrant up --provider=vmware_fusion | tee vagrant_up_provider_vmware_fusion.logBringing machine 'default' up with 'vmware_fusion' provider...
==> default: Verifying vmnet devices are healthy...
==> default: Preparing network adapters...
==> default: Starting the VMware VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: WinRM address: 192.168.177.136:5985
default: WinRM username: vagrant
default: WinRM transport: plaintext
==> default: Machine booted and ready!
==> default: Forwarding ports...
default: -- 5985 => 55985
default: -- 5986 => 55986
==> default: Configuring network adapters within the VM...
==> default: Configuring secondary network adapters through VMware
==> default: on Windows is not yet supported. You will need to manually
==> default: configure the network adapter.
==> default: Enabling and configuring shared folders...
default: -- /Volumes/hd1/Dropbox/work/hashicorp/windowsbuild: /vagrant
alvaros-Mac-mini:windowsbuild alvarom$
It works.
The only outstanding thing I found is the RDP is not enabled.
So, depending on your need, you may want to enable that or not.I found the easiest way is to enable it like this with a ps1 shell:
What I did change?Unattended file152 <CommandLine>cmd.exe /c winrm set winrm/config/winrs @{MaxMemoryPerShellMB="2048"}</CommandLine>
configure-winrm.ps1
4 winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="2048"}'
19 Set-Item wsman:localhost\Shell\MaxMemoryPerShellMB 2048 -Force
attached the updated version
So, if this should have failed, what I would try will be let packer to upload it, for this packer have these parameters:
tools_upload_flavor (string) - The flavor of the VMware Tools ISO to upload into the VM. Valid values are "darwin", "linux", and "windows". By default, this is empty, which means VMware tools won't be uploaded.
tools_upload_path (string) - The path in the VM to upload the VMware tools. This only takes effect if tools_upload_flavor is non-empty. This is a configuration template that has a single valid variable: Flavor, which will be the value of tools_upload_flavor. By default the upload path is set to {{.Flavor}}.iso.
This will give you an iso... so you would need 7zip to uncompress the iso..
Install 7zip:
https://gist.github.com/sneal/73a0a088c55fbbe07ec6
Install VMtools:
https://github.com/joefitzgerald/packer-windows/blob/master/scripts/vm-guest-tools.bat#L13-L27
This last script, will reuse the windows.iso in /c/users/vagrant or download from internet
won't be cheating.. will be using the less resistance path.
That the machine will be used by winrm, doesn't require everything should be done by winrm.. the upload was sloooooooowEnjoy
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/91078e9c-49a6-470f-9cb3-ca145dfd35d6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/packer-tool/a3676e14-5283-47b9-93a9-4cae1a061238%40googlegroups.com.