Right at the end of building a windows 7 VM packer failed with an error from what looks like an internally generated script.
This is Windows 7 building virtualbox. I'm on the latest versions of virtualbox, vagrant and packer. Everything has gone fine building the image (including all updates) and provisioning seems to have completed with the following scripts (all from the packer-windows project):
The console ouput ends with:
==> virtualbox-iso: Provisioning with shell script: ./scripts/puppet.bat
virtualbox-iso: C:\Users\vagrant>if not exist "C:\Windows\Temp\puppet.msi" (powershell -Command "(New-Object System.Net.WebClient).DownloadFile('http://downloads.puppetlabs.com/windows/puppet-3.5.1.msi', 'C:\Windows\Temp\puppet.msi')" 0<NUL )
virtualbox-iso: C:\Users\vagrant>msiexec /qn /i C:\Windows\Temp\puppet.msi /log C:\Windows\Temp\puppet.log
virtualbox-iso: C:\Users\vagrant>set /p ".=;C:\Program Files (x86)\Puppet Labs\Puppet\bin" 0<nul 1>>C:\Windows\Temp\PATH
virtualbox-iso: C:\Users\vagrant>set /p PATH= 0<C:\Windows\Temp\PATH
virtualbox-iso: C:\Users\vagrant>setx PATH "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Puppet Labs\Puppet\bin" /m
virtualbox-iso: SUCCESS: Specified value was saved.
==> virtualbox-iso: Provisioning with shell script: C:\Users\mbayliss\AppData\Local\Temp\packer-shell448994023
virtualbox-iso: rm: cannot remove `/tmp/TMP000000060D8C519E2AA75846': Device or resource busy
==> virtualbox-iso: Unregistering and deleting virtual machine...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Script exited with non-zero exit status: 1
Anybody seen this before? Any suggestions for a workaround?
i have the exact same issue ... currently no workaround yet.
please let me know if you stumble across something.
I've never seen that myself. Assuming I'm reading your output correctly, then the workaround is to remove the following provision step from your packer file, as it's not strictly necessary
"rm -rf /tmp/*"
Here it fails at that rm step too:
virtualbox-iso: rm: cannot remove `/tmp/winstore.log': Device or resource busy
That winstore.log is from the windows store; I think its there because at the first run, the metro ui tries to download the default apps (at least the download icon appears on all titles).
So maybe we can shortcircuit that command? e.g. rm ... || true
rm ... || true
I'm having the same issue. There's no solution to this anywhere.
The same thing is happening to me with Packer 0.7.1
I can report success by rewriting rgl's solution to "rm -rf /tmp/* || ! false"
The solution of gerardkok works, but still I receive following error:
==> virtualbox-iso: Provisioning with shell script: /var/folders/mp/8rxvhtsd3jn9rdj1z3780wxm0000gn/T/packer-shell735432321
virtualbox-iso: rm: cannot remove `/tmp/TMP000003B59E3A8A8F295F0693': Device or resource busy
virtualbox-iso: rm: cannot remove `/tmp/TMP000003B68745D3E4F2719CAA': Device or resource busy
Has someone a idea? I use Packer v0.7.1 and Vagrant 1.6.5
Fixed in cf59ea8 per @dylanmei's suggestion
I'm using the following on Arch to create a Windows 8.1 Vagrant box:
I was getting the rm: cannot remove/tmp/winstore.log'error when using the [windows_81.json template](https://github.com/joefitzgerald/packer-windows/blob/26c9f76a98f9b221130fb22661a5094f604bad1e/windows_81.json#L87) with justrm -rf /tmp/set. Changing that to"rm -rf /tmp/ || ! false"` resulted in a successful build.
rm: cannot remove
error when using the [windows_81.json template](https://github.com/joefitzgerald/packer-windows/blob/26c9f76a98f9b221130fb22661a5094f604bad1e/windows_81.json#L87) with just
set. Changing that to
Addresses joefitzgerald#80 for Windows 8.1