Skip to content

Instantly share code, notes, and snippets.

@taylor
Last active June 27, 2018 23:06
Show Gist options
  • Save taylor/d221a0ceb0d7883ceb62b0077ad2fe23 to your computer and use it in GitHub Desktop.
Save taylor/d221a0ceb0d7883ceb62b0077ad2fe23 to your computer and use it in GitHub Desktop.
vagrant box build and use failure for vDNS
root@cnfdev07:/var/lib/libvirt/images# tar zcvf vDNS-$(date +%Y%m%d-%H%M).box ./metadata.json ./Vagrantfile ./vDNS.img
root@cnfdev07:/var/lib/libvirt/images# vagrant box add --name vDNS vDNS-20180627-2300.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'vDNS' (v0) for provider:
    box: Unpacking necessary files from: file:///var/lib/libvirt/images/vDNS-20180627-2300.box
==> box: Successfully added box 'vDNS' (v0) for 'libvirt'!
root@cnfdev07:/var/lib/libvirt/images# mkdir x
root@cnfdev07:/var/lib/libvirt/images# cd x
root@cnfdev07:/var/lib/libvirt/images/x# vagrant init  vDNS
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
root@cnfdev07:/var/lib/libvirt/images/x# vagrant up --provider=libvirt
Bringing machine 'default' up with 'libvirt' provider...
==> default: Uploading base box image as volume into libvirt storage...
The box 'vDNS' does not exist. Please double check and
try again. You can see the boxes that are installed with
`vagrant box list`.
@taylor
Copy link
Author

taylor commented Jun 27, 2018

Vagrantfile try1:

Vagrant.configure("2") do |config|
        config.vm.provider :libvirt do |libvirt|
                libvirt.driver = "kvm"
                libvirt.host = 'localhost'
                libvirt.uri = 'qemu:///system'
        end
        config.vm.define "new" do |custombox|
                custombox.vm.box = "vDNS"
                custombox.vm.provider :libvirt do |test|
                        test.memory = 1024
                        test.cpus = 1
                end
        end
end

@taylor
Copy link
Author

taylor commented Jun 27, 2018

Vagrantfile try 2:

Vagrant.configure("2") do |config|
        config.vm.provider :libvirt do |libvirt|
                libvirt.driver = "kvm"
        end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment