Replies: 1 comment 1 reply
-
I don't think there is one yet, though maybe this could be the start of something that is added to document it. There's lots of information dotted around this repo, and in various issues, files, etc., so I'll try to provide some references. For a box to be usable with vagrant-libvirt, currently require 2 things:
Likely one of both of these requirements are not being met by the image file referenced. Any it'll possibly require an iterative process to work out the required steps for a specific image (though potentially could apply via a script to many images). Start with reviewing the troubleshooting section to see what is happening when the image is stuck waiting for an IP address: Subsequently, look at how to use virt-sysprep, as it's likely will need to inject the required ssh key so that it's possible to connect over ssh from vagrant (which if this is all that is required would be great): Vagrant-libvirt itself makes use of virt-sysprep with specific settings to prevent the host keys needing to be regenerated, avoiding removing the ssh keys, etc: There are also two pieces of documentation in the existing README.md page that focus on how to create boxes:
They however start from the position of taking an existing vagrant box, customizing it, and then packaging the result. Which isn't quite the same, but they do provide some hints of the usage of libguestfs-tools to help in prepping the image to be booted by vagrant-libvirt. There are also integration tests with do some packaging, but again they start with a box image that is known to boot. https://github.com/vagrant-libvirt/vagrant-libvirt/blob/5eac9de00695fe522b92ed60f7cd06560c04f532/tests/runtests.bats provides the current integration tests at the time of writing this post. It shows how we override the sysprep options in certain cases vagrant-libvirt/tests/runtests.bats Lines 186 to 187 in 5eac9de And finally there is a script https://github.com/vagrant-libvirt/vagrant-libvirt/blob/master/tools/create_box.sh, but again this assumes the image itself will boot and contains he ssh key needed. It's possible if all that is needed is to inject the ssh key, that a virt-sysprep or virt-customize could be added to that script and it would work for most cloud images then? |
Beta Was this translation helpful? Give feedback.
-
Is there any tutorial about building a vagrant box of libvirt type by using exists ubuntu cloud image
I'd tried by following this article. But stuck on waiting for ip address when exec
vagrant up --debug
. I have no idea check which log to resolve this? So, any helpful tips?Beta Was this translation helpful? Give feedback.
All reactions