1

Using Vagrant on a Windows Virtualbox, I'm receiving the error "File in Use" whenever I try to delete an asset from a shared folder on the Host OS or change its filename. This occurs after I load a file/asset through Nginx.

Windows Error

File In Use The action can't be completed because the file is open in VBoxHeadless Close the file and try again.

Also moving/deleting the file within the Guest OS fails:

$ mv test.css test2.css
mv: cannot move `test.css' to `tests2.css': Text file busy
$ rm test.css
rm: cannot remove `test.css': Text file busy
Ricky Boyce
  • 1,772
  • 21
  • 26

1 Answers1

4

Just leaving this here for any future readers. I found that the Nginx configurations open_file_cache & sendfile were the culprits, and after turning these off during development, removed the error.

Nginx.conf

open_file_cache off;
sendfile off;
Ricky Boyce
  • 1,772
  • 21
  • 26
  • 1
    Just removing `sendfile on` (the default value is `off`) worked for me, as indicated in the [Vagrant docs](https://www.vagrantup.com/docs/synced-folders/virtualbox.html#caveats). I knew about this issue by reading this page before, but couldn't associate it to the "busy file" error outputed on my terminal until I found this SO answer. Thank you @Ricky Boyce. – cdoublev Nov 15 '18 at 15:59
  • What's the equivalent for `Apache` ? – Jonathan Oct 05 '21 at 13:15