I am using the following script to create images with vagrant and libvirt:

https://github.com/spyderdyne/mythos/blob/master/images/create-images.sh

My setup:

root@hostname:/opt/trunk/mythos/images# cat /etc/issue
Ubuntu 14.04.3 LTS \n \l

root@hostname:/opt/trunk/mythos/images# uname -a
Linux hostname 3.13.0-65-generic #106-Ubuntu SMP Fri Oct 2 22:08:27 UTC 
2015 x86_64 x86_64 x86_64 GNU/Linux
root@hostname:/opt/trunk/mythos/images# vagrant --version
Vagrant 1.4.3

Problem:

vagrant box list does not show boxes I have already added with this script 
even though I am able to see them in ~/.vagrant.d/boxes: 

vagrant-kvm (0.1.9)
vagrant-kvm plugin is installed.  Moving on...
vagrant-mutate (1.0.2)
vagrant-mutate plugin is installed.  Moving on...
Downloading box from URL: 
https://cloud-images.ubuntu.com/vagrant/vivid/current/vivid-server-cloudimg-amd64-vagrant-disk1.box
Extracting box...te: 23.7M/s, Estimated time remaining: 0:00:01)
The box you're attempting to add already exists:

Name: ubuntu/vivid64
Provider: virtualbox
Box ubuntu/vivid64 added.
./create-images.sh: line 81: box: command not found
Box ubuntu/vivid64 added.
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load 
such file -- vagrant/box_metadata (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate/box_loader.rb:7:in
 
`<top (required)>'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate/mutate.rb:1:in
 
`<top (required)>'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate.rb:14:in 
`block in <class:Plugin>'
        from /usr/lib/ruby/vendor_ruby/vagrant/registry.rb:27:in `call'
        from /usr/lib/ruby/vendor_ruby/vagrant/registry.rb:27:in `get'
        from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:28:in `execute'
        from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:484:in `cli'
        from /usr/bin/vagrant:127:in `<main>'
Box ubuntu/vivid64 mutated to libvirt format
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load 
such file -- vagrant/box_metadata (LoadError)
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate/box_loader.rb:7:in
 
`<top (required)>'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate/mutate.rb:1:in
 
`<top (required)>'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from 
/root/.vagrant.d/gems/gems/vagrant-mutate-1.0.2/lib/vagrant-mutate.rb:14:in 
`block in <class:Plugin>'
        from /usr/lib/ruby/vendor_ruby/vagrant/registry.rb:27:in `call'
        from /usr/lib/ruby/vendor_ruby/vagrant/registry.rb:27:in `get'
        from /usr/lib/ruby/vendor_ruby/vagrant/cli.rb:28:in `execute'
        from /usr/lib/ruby/vendor_ruby/vagrant/environment.rb:484:in `cli'
        from /usr/bin/vagrant:127:in `<main>'
Box ubuntu/vivid64 mutated to libvirt format.
Vagrant boxes ready to go:
There are no installed boxes! Use `vagrant box add` to add some.

When I create them myself in the terminal they also do not show up:  

root@csx-a-qatools-002:/opt/trunk/mythos/images# vagrant box add 
vivid/test64 
https://cloud-images.ubuntu.com/vagrant/vivid/current/vivid-server-cloudimg-amd64-vagrant-disk1.box
Downloading box from URL: 
https://cloud-images.ubuntu.com/vagrant/vivid/current/vivid-server-cloudimg-amd64-vagrant-disk1.box
Extracting box...te: 35.8M/s, Estimated time remaining: 0:00:02)
Successfully added box 'vivid/test64' with provider 'virtualbox'!
root@csx-a-qatools-002:/opt/trunk/mythos/images# vagrant box list
There are no installed boxes! Use `vagrant box add` to add some.

But you can see them in the proper paths with the proper ownerships:

ubuntu/           ubuntu-vividtest/ vivid/            
root@csx-a-qatools-002:/opt/trunk/mythos/images# ls -al ~/.vagrant.d/boxes/
total 20
drwxr-xr-x 5 root root 4096 Oct 12 20:37 .
drwxr-xr-x 7 root root 4096 Oct 12 17:42 ..
drwxr-xr-x 3 root root 4096 Oct 12 19:01 ubuntu
drwxr-xr-x 2 root root 4096 Oct 12 18:41 ubuntu-vividtest
drwxr-xr-x 3 root root 4096 Oct 12 20:37 vivid

The logic I am applying in my scripting relies on vagrant box list to 
determine if an image is there and not download/modify it again if it 
exists in the expected state.  I need vagrant to see the boxes I add, or I 
assume not only will the list logic not work, but there is little value in 
a workaround because if it cannot list them, it also cannot start them.

Any thoughts?  I tried to ask in the IRC chat, but even with over 400 
people in the room nobody responded.

Thanks.

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vagrant-up/ba775747-ae19-4e42-a25e-77225a0b479c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to