Skip to content
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

docker fails with ~/.vagrant.d/boxes file exists, if boxes are symlinked somewhere else #1740

Open
thigg opened this issue May 5, 2023 · 1 comment

Comments

@thigg
Copy link

thigg commented May 5, 2023

Describe the bug
I got a symlink from .vagrant.d/boxes to another disk. This lets the example from the readme fail with:

/opt/vagrant/embedded/lib/ruby/2.7.0/fileutils.rb:250:in `mkdir': File exists @ dir_s_mkdir - /.vagrant.d/boxes (Errno::EEXIST)

To Reproduce
Steps to reproduce the behavior:

  1. symlink .vagrant.d/boxes somewhere else
  2. run
docker run -it --rm \
  -e LIBVIRT_DEFAULT_URI \
  -v /var/run/libvirt/:/var/run/libvirt/ \
  -v ~/.vagrant.d:/.vagrant.d \
  -v $(realpath "${PWD}"):${PWD} \
  -w "${PWD}" \
  --network host \
  vagrantlibvirt/vagrant-libvirt:latest \
    vagrant status

Expected behavior
Works

Screenshots

Versions (please complete the following information)::

  • Libvirt version: 9.2.0
  • Vagrant version [output of vagrant version]: 2.3.4
  • Vagrant flavour [Upstream or Distro]: distro (arch)
  • Vagrant plugins versions (including vagrant-libvirt) [output of vagrant plugin list]:

Debug Log
shouldn't matter

A Vagrantfile to reproduce the issue:
shouldn't matter

@electrofelix
Copy link
Contributor

If you symlink the boxes folder elsewhere then you will need to modify the docker command to add a volume mount for the other path and mount it into the image under the expected path as well, there isn't any way around this.

The only solution to this is to provide a more complex script that checks the entire contents of ~/.vagrant.d and also mounts in any symlinked paths recursively.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants