vmdk: no space left on device
sparky005 opened this issue · 9 comments
Hello! I tried to create this box but I got an error during the post-processing step:
==> windows-2016-amd64-virtualbox: Unregistering and deleting virtual machine...
==> windows-2016-amd64-virtualbox: Running post-processor: vagrant
==> windows-2016-amd64-virtualbox (vagrant): Creating Vagrant box for 'virtualbox' provider
windows-2016-amd64-virtualbox (vagrant): Copying from artifact: output-windows-2016-amd64-virtualbox/packer-windows-2016-amd64-virtualbox-1505050546-disk001.vmdk
Build 'windows-2016-amd64-virtualbox' errored: 1 error(s) occurred:
* Post-processor failed: write /tmp/packer073329394/packer-windows-2016-amd64-virtualbox-1505050546-disk001.vmdk: no space left on device
==> Some builds didn't complete successfully and had errors:
--> windows-2016-amd64-virtualbox: 1 error(s) occurred:
* Post-processor failed: write /tmp/packer073329394/packer-windows-2016-amd64-virtualbox-1505050546-disk001.vmdk: no space left on device
==> Builds finished but no artifacts were created.
Do you know what might have caused this / how I can resolve? I know it's not my computer's disk because I have ~100GB free.
Before trying again set the PACKER_LOG=1
environment variable to see more information, maybe that will shed some light about the problem. But it seems your disk actually did fill up during the vagrant box creation.
Now that I'm thinking about it, I think maybe the tmpfs filesystem did indeed fill up. The tmpfs filesystem is only like 4GB I think, on my system. I will retry after increasing my tmpfs size.
I think this will be the case on most Linux systems (tmpfs is usually not that big, IIRC) so if it works I may create a pull request for the documentation (if that's okay with you!)
That was indeed the issue. After increasing the size of my tmpfs I was able to build successfully. The tmpfs never got over 6.2GB use. AFAIK there are two ways to solve this problem:
- Increase the size of tmpfs temporarily by issuing
sudo mount -o remount,size=10G,noatime /tmp
- Outputting the temporary file to another directory (perhaps a subdirectory of the working dir.)
What do you think?
Or you could set the TMP environment variable to a real disk location during the build. But, this has nothing to do with this repo, it's a characteristic of your system. So there's nothing to do here.
It's not just a characteristic of my system, it's a characteristic of most popular Linux systems. /tmp is mounted from /dev/shm and is by default set to be half the amount of RAM as is installed on the system. So anybody that tries to use this repo with less than 12.4GB of RAM on Linux will run into this issue.
Oh I never noticed that caveat because I mainly use Debian/Ubuntu and they don't do that by default. What do you think about adding the following note to the README.md file?
NB if the build fails with something like Post-processor failed: write /tmp/packer073329394/packer-windows-2016-amd64-virtualbox-1505050546-disk001.vmdk: no space left on device
you need to increase your temporary partition size or change its location as described in the packer TMPDIR/TMP environment variable documentation.
Can you try setting TMPDIR and see if that works?
Ahh, that explains our differing experiences! I haven't used Debian/Ubuntu in a long time. Anyway that note seems spot on, I think that's an easy way to solve this problem. I went ahead and tested setting TMPDIR and it worked exactly as expected.
Fantastic, thanks!