ppggff / vagrant-qemu

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

Issue #52: work-around for new Packer format #53

Closed unixerius closed 9 months ago

unixerius commented 9 months ago

Hi!

I'm not saying this is a solid solution for issue #52 , but at least it's a work-around to get Vagrant imports to work again.

I have tested the changes using generic/alma9 and generic/alpine318, while also testing with perk/ubuntu-2204-arm64 which still uses the old Packer format. All three boxes can be imported without errors.

tsluijter@tess-M2 Vagrant % vagrant init generic/alpine318

tsluijter@tess-M2 Vagrant % vagrant up     
Bringing machine 'default' up with 'qemu' provider...
==> default: Box 'generic/alpine318' could not be found. Attempting to find and install...
    default: Box Provider: libvirt
    default: Box Version: >= 0
==> default: Loading metadata for box 'generic/alpine318'
    default: URL: https://vagrantcloud.com/api/v2/vagrant/generic/alpine318
==> default: Adding box 'generic/alpine318' (v4.3.12) for provider: libvirt (arm64)
    default: Downloading: https://vagrantcloud.com/generic/boxes/alpine318/versions/4.3.12/providers/libvirt/arm64/vagrant.box
    default: Calculating and comparing box checksum...
==> default: Successfully added box 'generic/alpine318' (v4.3.12) for 'libvirt (arm64)'!
==> default: Checking if box 'generic/alpine318' version '4.3.12' is up to date...
==> default: Importing a QEMU instance
    default: Creating and registering the VM...
    default: Successfully imported VM
...
...
==> default: Machine booted and ready!

tsluijter@tess-M2 Vagrant % find ~/.vagrant.d/boxes/ -name "box*.img"
...
/Users/tsluijter/.vagrant.d/boxes//generic-VAGRANTSLASH-alpine318/4.3.12/arm64/libvirt/box_0.img
ppggff commented 9 months ago

Thanks, the v0.3.6 try to support libvirt box v2 format with multiple disks

unixerius commented 8 months ago

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