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

Provisioning fails because /tmp is not empty? #80

Closed
mikebayliss opened this Issue Jun 23, 2014 · 10 comments

Comments

Projects
None yet
@mikebayliss
Contributor

mikebayliss commented Jun 23, 2014

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):

"./scripts/vm-guest-tools.bat",
"./scripts/enable-remote-desktop.bat",
"./scripts/vagrant-ssh.bat",
"./scripts/puppet.bat"

The console ouput ends with:
==> virtualbox-iso: Provisioning with shell script: ./scripts/puppet.bat
virtualbox-iso:
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:
virtualbox-iso: C:\Users\vagrant>msiexec /qn /i C:\Windows\Temp\puppet.msi /log C:\Windows\Temp\puppet.log
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>set /p ".=;C:\Program Files (x86)\Puppet Labs\Puppet\bin" 0<nul 1>>C:\Windows\Temp\PATH
virtualbox-iso:
virtualbox-iso: C:\Users\vagrant>set /p PATH= 0<C:\Windows\Temp\PATH
virtualbox-iso:
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:
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?

Thanks,

Mike

@SchwarzM

This comment has been minimized.

Show comment
Hide comment
@SchwarzM

SchwarzM Jun 23, 2014

i have the exact same issue ... currently no workaround yet.
please let me know if you stumble across something.

kind regards
Marian

SchwarzM commented Jun 23, 2014

i have the exact same issue ... currently no workaround yet.
please let me know if you stumble across something.

kind regards
Marian

@dylanmei

This comment has been minimized.

Show comment
Hide comment
@dylanmei

dylanmei Jun 23, 2014

Collaborator

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

 {
    "type": "shell",
    "inline": [
      "rm -rf /tmp/*"
    ]
  }
Collaborator

dylanmei commented Jun 23, 2014

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

 {
    "type": "shell",
    "inline": [
      "rm -rf /tmp/*"
    ]
  }
@rgl

This comment has been minimized.

Show comment
Hide comment
@rgl

rgl Jun 26, 2014

Contributor

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

Contributor

rgl commented Jun 26, 2014

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

@kensykora kensykora added this to the 1.22 milestone Aug 16, 2014

@interweb0

This comment has been minimized.

Show comment
Hide comment
@interweb0

interweb0 Aug 27, 2014

I'm having the same issue. There's no solution to this anywhere.

interweb0 commented Aug 27, 2014

I'm having the same issue. There's no solution to this anywhere.

@lmayorga1980

This comment has been minimized.

Show comment
Hide comment
@lmayorga1980

lmayorga1980 Sep 22, 2014

Contributor

The same thing is happening to me with Packer 0.7.1

Contributor

lmayorga1980 commented Sep 22, 2014

The same thing is happening to me with Packer 0.7.1

@gerardkok

This comment has been minimized.

Show comment
Hide comment
@gerardkok

gerardkok Sep 24, 2014

I can report success by rewriting rgl's solution to "rm -rf /tmp/* || ! false"

gerardkok commented Sep 24, 2014

I can report success by rewriting rgl's solution to "rm -rf /tmp/* || ! false"

@tommyziegler

This comment has been minimized.

Show comment
Hide comment
@tommyziegler

tommyziegler Oct 15, 2014

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

Greetings, Tommy

tommyziegler commented Oct 15, 2014

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

Greetings, Tommy

@jreadytalk

This comment has been minimized.

Show comment
Hide comment
@jreadytalk

jreadytalk commented Oct 29, 2014

+1

@kensykora

This comment has been minimized.

Show comment
Hide comment
@kensykora

kensykora Nov 5, 2014

Collaborator

Fixed in cf59ea8 per @dylanmei's suggestion

Collaborator

kensykora commented Nov 5, 2014

Fixed in cf59ea8 per @dylanmei's suggestion

@kensykora kensykora closed this Nov 5, 2014

@avtar

This comment has been minimized.

Show comment
Hide comment
@avtar

avtar Dec 17, 2014

I'm using the following on Arch to create a Windows 8.1 Vagrant box:

  • Packer 0.7.5
  • VirtualBox 4.3.20
  • Vagrant 1.7.0

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.

avtar commented Dec 17, 2014

I'm using the following on Arch to create a Windows 8.1 Vagrant box:

  • Packer 0.7.5
  • VirtualBox 4.3.20
  • Vagrant 1.7.0

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.

jbarber added a commit to jbarber/packer-windows that referenced this issue Sep 30, 2015

Update windows_81.json
Addresses joefitzgerald#80 for Windows 8.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment