ppggff / vagrant-qemu

Use Vagrant to manage machines using QEMU. Test with Apple Silicon / M1 and CentOS aarch64 image
MIT License
408 stars 32 forks source link

packer-plugin-vagrant has been updated with breaking changes #52

Closed dafyddj closed 3 months ago

dafyddj commented 8 months ago

Hi,

packer-plugin-vagrant has recently been updated to v1.1.0 and the structure of the files included in the Vagrant box has changed. See https://github.com/hashicorp/packer-plugin-vagrant/pull/48

If I'm not mistaken, this causes the check on this line to fail: https://github.com/ppggff/vagrant-qemu/blob/4d85f60032bf0a4ef3f7d26f4a102fce1f3213f2/lib/vagrant-qemu/action/import.rb#L22

This is using vagrant-qemu version v0.3.5

ppggff commented 8 months ago

Thanks, do you have a example box for test?

dafyddj commented 8 months ago

You can try this one

ppggff commented 8 months ago

To support the new version of libvirt box, I need to find a workable libvirt machine for test. (See how libvirt convert multiple disk config to qemu command) It'll take a while.

There is temporary workaround for single disk box: use the image file directly.

Install box and find image path:

# install box as "test_new_box"
vagrant box add --name test_new_box ./alpine318-packer_plugin_v1.1.0.box

# find the image file, the default location for "test_new_box":
~/.vagrant.d/boxes/test_new_box/0/libvirt/box_0.img

Set image_path config in Vagrantfile.

qe.image_path = "/Users/xxx/.vagrant.d/boxes/test_new_box/0/libvirt/box_0.img"
dafyddj commented 8 months ago

Thanks for the update

Xantios commented 5 months ago

running into this same issue, currently hardcoding paths in my Vagrantfile. is there any plans on fixing this so i don't need a workaround ?

unixerius commented 5 months ago

Instead of hardcoding the path, I decided to symlink "box_0.img" to "box.img" which is equally nasty. Both solutions break on the next update of the box image.

For me, the issues occured with generic/alma9 and generic/fedora39.

unixerius commented 5 months ago

I've made a pull request to at least get this plugin working again with boxes that have one single drive image.

ppggff commented 4 months ago

Please try the new v0.3.6

unixerius commented 3 months ago

I can confirm that your version 0.3.6 seems to be working for me.

Please feel free to close this issue.