hashicorp / vagrant

Vagrant is a tool for building and distributing development environments.
https://www.vagrantup.com
Other
26.26k stars 4.43k forks source link

vagrant package command produces a erroneous box file of about 2KB in size. What's going on? #12048

Open bayeslearner opened 3 years ago

bayeslearner commented 3 years ago

Vagrant version

2.2.9

Host operating system

Windows 10 ubuntu WSL

Guest operating system

This is the operating system you run in the virtual machine. centos 7.8

Vagrantfile

Debug output

https://gist.github.com/bayeslearner/8bbf41b097592191dede411c3e14f93f

Expected behavior

What should have happened?

vagrant package command should create a package.box based on a running vagrant box.

Actual behavior

What actually happened? It creates a tiny package.box file of about 2KB

Steps to reproduce

$vagrant package ==> hdp: Attempting graceful shutdown of VM... ==> hdp: Clearing any previously set forwarded ports... ==> hdp: Exporting VM... ==> hdp: Compressing package to: /mnt/c/Users/kundeng/Dropbox/gitrepo/dev/ansible-vagrant-dshost/package.box

1-61803 commented 3 years ago

This is still a problem in 2.2.16. As workaround, temporarily disable WSL Vagrant home.

unset VAGRANT_WSL_DISABLE_VAGRANT_HOME
vagrant package --base my_vm --output my_vm.box
export VAGRANT_WSL_DISABLE_VAGRANT_HOME="1"

It seems that there was a fix in #9059.